-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix E0284 to not use incorrect wording
- Loading branch information
Showing
9 changed files
with
81 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 4 additions & 8 deletions
12
src/test/ui/associated-types/associated-types-overridden-binding.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
pub trait Element<S> { | ||
type Array; | ||
} | ||
|
||
impl<T> Element<()> for T { | ||
type Array = T; | ||
} | ||
|
||
impl<T: Element<S>, S> Element<[S; 3]> for T { | ||
type Array = [T::Array; 3]; | ||
} | ||
|
||
trait Foo<I> | ||
where | ||
u8: Element<I>, | ||
{ | ||
fn foo(self, x: <u8 as Element<I>>::Array); | ||
} | ||
|
||
impl<I> Foo<I> for u16 | ||
where | ||
u8: Element<I>, | ||
{ | ||
fn foo(self, _: <u8 as Element<I>>::Array) {} | ||
} | ||
|
||
fn main() { | ||
let b: [u8; 3] = [0u8; 3]; | ||
|
||
0u16.foo(b); //~ ERROR type annotations needed | ||
//<u16 as Foo<[(); 3]>>::foo(0u16, b); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
error[E0284]: type annotations needed: cannot satisfy `<u8 as Element<_>>::Array == [u8; 3]` | ||
--> $DIR/issue-69683.rs:30:10 | ||
| | ||
LL | 0u16.foo(b); | ||
| ^^^ cannot satisfy `<u8 as Element<_>>::Array == [u8; 3]` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0284`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
fn main() { | ||
let n: u32 = 1; | ||
let mut d: u64 = 2; | ||
d = d % n.into(); //~ ERROR type annotations needed | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
error[E0284]: type annotations needed: cannot satisfy `<u64 as std::ops::Rem<_>>::Output == u64` | ||
--> $DIR/issue-71584.rs:4:11 | ||
| | ||
LL | d = d % n.into(); | ||
| ^ cannot satisfy `<u64 as std::ops::Rem<_>>::Output == u64` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0284`. |