-
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 #103772 - compiler-errors:better-strict-coherence-err…
…, r=davidtwco better error for `rustc_strict_coherence` misuse Fixes #103753
- Loading branch information
Showing
5 changed files
with
45 additions
and
2 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
7 changes: 7 additions & 0 deletions
7
src/test/ui/coherence/strict-coherence-needs-negative-coherence.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,7 @@ | ||
#![feature(rustc_attrs)] | ||
|
||
#[rustc_strict_coherence] | ||
trait Foo {} | ||
//~^ ERROR to use `strict_coherence` on this trait, the `with_negative_coherence` feature must be enabled | ||
|
||
fn main() {} |
10 changes: 10 additions & 0 deletions
10
src/test/ui/coherence/strict-coherence-needs-negative-coherence.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,10 @@ | ||
error: to use `strict_coherence` on this trait, the `with_negative_coherence` feature must be enabled | ||
--> $DIR/strict-coherence-needs-negative-coherence.rs:4:1 | ||
| | ||
LL | #[rustc_strict_coherence] | ||
| ------------------------- due to this attribute | ||
LL | trait Foo {} | ||
| ^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|