forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
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 rust-lang#99095 - rhysd:issue-99092, r=compiler-errors
Remove duplicate notes from error on inter-crate ambiguous impl of traits Fixes rust-lang#99092
- Loading branch information
Showing
7 changed files
with
45 additions
and
13 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
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
19 changes: 19 additions & 0 deletions
19
src/test/ui/coherence/inter-crate-ambiguity-causes-notes.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,19 @@ | ||
struct S; | ||
|
||
impl From<()> for S { | ||
fn from(x: ()) -> Self { | ||
S | ||
} | ||
} | ||
|
||
impl<I> From<I> for S | ||
//~^ ERROR conflicting implementations of trait | ||
where | ||
I: Iterator<Item = ()>, | ||
{ | ||
fn from(x: I) -> Self { | ||
S | ||
} | ||
} | ||
|
||
fn main() {} |
14 changes: 14 additions & 0 deletions
14
src/test/ui/coherence/inter-crate-ambiguity-causes-notes.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,14 @@ | ||
error[E0119]: conflicting implementations of trait `std::convert::From<()>` for type `S` | ||
--> $DIR/inter-crate-ambiguity-causes-notes.rs:9:1 | ||
| | ||
LL | impl From<()> for S { | ||
| ------------------- first implementation here | ||
... | ||
LL | impl<I> From<I> for S | ||
| ^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `S` | ||
| | ||
= note: upstream crates may add a new impl of trait `std::iter::Iterator` for type `()` in future versions | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0119`. |