-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 #103611 - Rageking8:fix-103574, r=lcnr
Add test for issue 103574 Fixes #103574 Together with some slight formatting. r? `@lcnr`
- Loading branch information
Showing
6 changed files
with
56 additions
and
4 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
src/test/ui/marker_trait_attr/overlap-marker-trait-with-static-lifetime.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,10 @@ | ||
// check-pass | ||
#![feature(marker_trait_attr)] | ||
|
||
#[marker] | ||
trait Marker {} | ||
|
||
impl Marker for &'static () {} | ||
impl Marker for &'static () {} | ||
|
||
fn main() {} |
9 changes: 9 additions & 0 deletions
9
src/test/ui/marker_trait_attr/overlap-marker-trait-with-underscore-lifetime.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,9 @@ | ||
#![feature(marker_trait_attr)] | ||
|
||
#[marker] | ||
trait Marker {} | ||
|
||
impl Marker for &'_ () {} //~ ERROR type annotations needed | ||
impl Marker for &'_ () {} //~ ERROR type annotations needed | ||
|
||
fn main() {} |
31 changes: 31 additions & 0 deletions
31
src/test/ui/marker_trait_attr/overlap-marker-trait-with-underscore-lifetime.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,31 @@ | ||
error[E0283]: type annotations needed: cannot satisfy `&(): Marker` | ||
--> $DIR/overlap-marker-trait-with-underscore-lifetime.rs:6:6 | ||
| | ||
LL | impl Marker for &'_ () {} | ||
| ^^^^^^ | ||
| | ||
note: multiple `impl`s satisfying `&(): Marker` found | ||
--> $DIR/overlap-marker-trait-with-underscore-lifetime.rs:6:1 | ||
| | ||
LL | impl Marker for &'_ () {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^ | ||
LL | impl Marker for &'_ () {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error[E0283]: type annotations needed: cannot satisfy `&(): Marker` | ||
--> $DIR/overlap-marker-trait-with-underscore-lifetime.rs:7:6 | ||
| | ||
LL | impl Marker for &'_ () {} | ||
| ^^^^^^ | ||
| | ||
note: multiple `impl`s satisfying `&(): Marker` found | ||
--> $DIR/overlap-marker-trait-with-underscore-lifetime.rs:6:1 | ||
| | ||
LL | impl Marker for &'_ () {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^ | ||
LL | impl Marker for &'_ () {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0283`. |
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