This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +32
-2
lines changed Expand file tree Collapse file tree 2 files changed +32
-2
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,18 @@ impl Generator for Impl {
88 fn create ( ) -> u32 { 1 }
99}
1010
11+ impl Impl {
12+ fn new ( ) -> Self {
13+ Impl { }
14+ }
15+ }
16+
17+ impl Into < u32 > for Impl {
18+ fn into ( self ) -> u32 { 1 }
19+ }
20+
21+ fn foo ( bar : u32 ) { }
22+
1123struct AnotherImpl ;
1224
1325impl Generator for AnotherImpl {
@@ -17,3 +29,9 @@ impl Generator for AnotherImpl {
1729fn main ( ) {
1830 let cont: u32 = Generator :: create ( ) ; //~ ERROR E0283
1931}
32+
33+ fn buzz ( ) {
34+ let foo_impl = Impl :: new ( ) ;
35+ let bar = foo_impl. into ( ) * 1u32 ; //~ ERROR E0283
36+ foo ( bar) ;
37+ }
Original file line number Diff line number Diff line change 11error[E0283]: type annotations needed
2- --> $DIR/E0283.rs:18 :21
2+ --> $DIR/E0283.rs:30 :21
33 |
44LL | fn create() -> u32;
55 | ------------------- required by `Generator::create`
@@ -9,6 +9,18 @@ LL | let cont: u32 = Generator::create();
99 |
1010 = note: cannot satisfy `_: Generator`
1111
12- error: aborting due to previous error
12+ error[E0283]: type annotations needed
13+ --> $DIR/E0283.rs:35:24
14+ |
15+ LL | let bar = foo_impl.into() * 1u32;
16+ | ---------^^^^--
17+ | | |
18+ | | cannot infer type for type parameter `T` declared on the trait `Into`
19+ | this method call resolves to `T`
20+ | help: use the fully qualified path for the potential candidate: `<Impl as Into<u32>>::into(foo_impl)`
21+ |
22+ = note: cannot satisfy `Impl: Into<_>`
23+
24+ error: aborting due to 2 previous errors
1325
1426For more information about this error, try `rustc --explain E0283`.
You can’t perform that action at this time.
0 commit comments