-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #68763 - JohnTitor:do-not-sugg-dup-bounds, r=estebank
- Loading branch information
Showing
5 changed files
with
49 additions
and
32 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
11 changes: 11 additions & 0 deletions
11
src/test/ui/associated-item/associated-item-duplicate-bounds.rs
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,11 @@ | ||
trait Adapter { | ||
const LINKS: usize; | ||
} | ||
|
||
struct Foo<A: Adapter> { | ||
adapter: A, | ||
links: [u32; A::LINKS], // Shouldn't suggest bounds already there. | ||
//~^ ERROR: no associated item named `LINKS` found | ||
} | ||
|
||
fn main() {} |
11 changes: 11 additions & 0 deletions
11
src/test/ui/associated-item/associated-item-duplicate-bounds.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
error[E0599]: no associated item named `LINKS` found for type parameter `A` in the current scope | ||
--> $DIR/associated-item-duplicate-bounds.rs:7:21 | ||
| | ||
LL | links: [u32; A::LINKS], // Shouldn't suggest bounds already there. | ||
| ^^^^^ associated item not found in `A` | ||
| | ||
= help: items from traits can only be used if the type parameter is bounded by the trait | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0599`. |
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