-
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 #131701 - compiler-errors:negative-bounds-on-unimplem…
…ented, r=lcnr Don't report `on_unimplemented` message for negative traits Kinda useless change but it was affecting my ability to read error messages when experimenting with negative bounds.
- Loading branch information
Showing
5 changed files
with
44 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#![feature(negative_bounds)] | ||
|
||
#[diagnostic::on_unimplemented(message = "this ain't fooing")] | ||
trait Foo {} | ||
struct NotFoo; | ||
|
||
fn hello() -> impl !Foo { | ||
//~^ ERROR the trait bound `NotFoo: !Foo` is not satisfied | ||
NotFoo | ||
} | ||
|
||
fn main() {} |
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,18 @@ | ||
error[E0277]: the trait bound `NotFoo: !Foo` is not satisfied | ||
--> $DIR/on-unimplemented.rs:7:15 | ||
| | ||
LL | fn hello() -> impl !Foo { | ||
| ^^^^^^^^^ the trait bound `NotFoo: !Foo` is not satisfied | ||
LL | | ||
LL | NotFoo | ||
| ------ return type was inferred to be `NotFoo` here | ||
| | ||
help: this trait has no implementations, consider adding one | ||
--> $DIR/on-unimplemented.rs:4:1 | ||
| | ||
LL | trait Foo {} | ||
| ^^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |