]> git.proxmox.com Git - rustc.git/blobdiff - src/tools/clippy/tests/ui/fallible_impl_from.stderr
New upstream version 1.66.0+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / fallible_impl_from.stderr
index 89dfaf623ed83d4a67b4b78eca8cd4e318abccb5..21761484f8c45b3b6eda74e3dc9df3209517a4b1 100644 (file)
@@ -1,91 +1,93 @@
 error: consider implementing `TryFrom` instead
- --> $DIR/fallible_impl_from.rs:5:1
-  |
-5 | / impl From<String> for Foo {
-6 | |     fn from(s: String) -> Self {
-7 | |         Foo(s.parse().unwrap())
-8 | |     }
-9 | | }
-  | |_^
-  |
-note: lint level defined here
- --> $DIR/fallible_impl_from.rs:1:9
-  |
-1 | #![deny(fallible_impl_from)]
-  |         ^^^^^^^^^^^^^^^^^^
-  = help: `From` is intended for infallible conversions only. Use `TryFrom` if there's a possibility for the conversion to fail.
+  --> $DIR/fallible_impl_from.rs:6:1
+   |
+LL | / impl From<String> for Foo {
+LL | |     fn from(s: String) -> Self {
+LL | |         Foo(s.parse().unwrap())
+LL | |     }
+LL | | }
+   | |_^
+   |
+   = help: `From` is intended for infallible conversions only. Use `TryFrom` if there's a possibility for the conversion to fail
 note: potential failure(s)
- --> $DIR/fallible_impl_from.rs:7:13
-  |
-7 |         Foo(s.parse().unwrap())
-  |             ^^^^^^^^^^^^^^^^^^
+  --> $DIR/fallible_impl_from.rs:8:13
+   |
+LL |         Foo(s.parse().unwrap())
+   |             ^^^^^^^^^^^^^^^^^^
+note: the lint level is defined here
+  --> $DIR/fallible_impl_from.rs:1:9
+   |
+LL | #![deny(clippy::fallible_impl_from)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: consider implementing `TryFrom` instead
-  --> $DIR/fallible_impl_from.rs:28:1
+  --> $DIR/fallible_impl_from.rs:27:1
    |
-28 | / impl From<usize> for Invalid {
-29 | |     fn from(i: usize) -> Invalid {
-30 | |         if i != 42 {
-31 | |             panic!();
+LL | / impl From<usize> for Invalid {
+LL | |     fn from(i: usize) -> Invalid {
+LL | |         if i != 42 {
+LL | |             panic!();
 ...  |
-34 | |     }
-35 | | }
+LL | |     }
+LL | | }
    | |_^
    |
-   = help: `From` is intended for infallible conversions only. Use `TryFrom` if there's a possibility for the conversion to fail.
+   = help: `From` is intended for infallible conversions only. Use `TryFrom` if there's a possibility for the conversion to fail
 note: potential failure(s)
-  --> $DIR/fallible_impl_from.rs:31:13
+  --> $DIR/fallible_impl_from.rs:30:13
    |
-31 |             panic!();
-   |             ^^^^^^^^^
-   = note: this error originates in a macro outside of the current crate
+LL |             panic!();
+   |             ^^^^^^^^
+   = note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: consider implementing `TryFrom` instead
-  --> $DIR/fallible_impl_from.rs:37:1
+  --> $DIR/fallible_impl_from.rs:36:1
    |
-37 | / impl From<Option<String>> for Invalid {
-38 | |     fn from(s: Option<String>) -> Invalid {
-39 | |         let s = s.unwrap();
-40 | |         if !s.is_empty() {
+LL | / impl From<Option<String>> for Invalid {
+LL | |     fn from(s: Option<String>) -> Invalid {
+LL | |         let s = s.unwrap();
+LL | |         if !s.is_empty() {
 ...  |
-46 | |     }
-47 | | }
+LL | |     }
+LL | | }
    | |_^
    |
-   = help: `From` is intended for infallible conversions only. Use `TryFrom` if there's a possibility for the conversion to fail.
+   = help: `From` is intended for infallible conversions only. Use `TryFrom` if there's a possibility for the conversion to fail
 note: potential failure(s)
-  --> $DIR/fallible_impl_from.rs:39:17
+  --> $DIR/fallible_impl_from.rs:38:17
    |
-39 |         let s = s.unwrap();
+LL |         let s = s.unwrap();
    |                 ^^^^^^^^^^
-40 |         if !s.is_empty() {
-41 |             panic!(42);
-   |             ^^^^^^^^^^^
-42 |         } else if s.parse::<u32>().unwrap() != 42 {
+LL |         if !s.is_empty() {
+LL |             panic!("42");
+   |             ^^^^^^^^^^^^
+LL |         } else if s.parse::<u32>().unwrap() != 42 {
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^
-43 |             panic!("{:?}", s);
-   |             ^^^^^^^^^^^^^^^^^^
-   = note: this error originates in a macro outside of the current crate
+LL |             panic!("{:?}", s);
+   |             ^^^^^^^^^^^^^^^^^
+   = note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: consider implementing `TryFrom` instead
-  --> $DIR/fallible_impl_from.rs:55:1
+  --> $DIR/fallible_impl_from.rs:54:1
    |
-55 | / impl<'a> From<&'a mut <Box<u32> as ProjStrTrait>::ProjString> for Invalid {
-56 | |     fn from(s: &'a mut <Box<u32> as ProjStrTrait>::ProjString) -> Invalid {
-57 | |         if s.parse::<u32>().ok().unwrap() != 42 {
-58 | |             panic!("{:?}", s);
+LL | / impl<'a> From<&'a mut <Box<u32> as ProjStrTrait>::ProjString> for Invalid {
+LL | |     fn from(s: &'a mut <Box<u32> as ProjStrTrait>::ProjString) -> Invalid {
+LL | |         if s.parse::<u32>().ok().unwrap() != 42 {
+LL | |             panic!("{:?}", s);
 ...  |
-61 | |     }
-62 | | }
+LL | |     }
+LL | | }
    | |_^
    |
-   = help: `From` is intended for infallible conversions only. Use `TryFrom` if there's a possibility for the conversion to fail.
+   = help: `From` is intended for infallible conversions only. Use `TryFrom` if there's a possibility for the conversion to fail
 note: potential failure(s)
-  --> $DIR/fallible_impl_from.rs:57:12
+  --> $DIR/fallible_impl_from.rs:56:12
    |
-57 |         if s.parse::<u32>().ok().unwrap() != 42 {
+LL |         if s.parse::<u32>().ok().unwrap() != 42 {
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-58 |             panic!("{:?}", s);
-   |             ^^^^^^^^^^^^^^^^^^
-   = note: this error originates in a macro outside of the current crate
+LL |             panic!("{:?}", s);
+   |             ^^^^^^^^^^^^^^^^^
+   = note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to 4 previous errors