forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
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#124717 - compiler-errors:do-not-recomment-next-solver, r=lcnr Implement `do_not_recommend` in the new solver Put the test into `diagnostic_namespace` test folder even though it's not in the diagnostic namespace, because it should be soon. r? lcnr cc `@weiznich`
- Loading branch information
Showing
5 changed files
with
68 additions
and
1 deletion.
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
20 changes: 20 additions & 0 deletions
20
tests/ui/diagnostic_namespace/do_not_recommend/simple.current.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,20 @@ | ||
error[E0277]: the trait bound `*mut (): Foo` is not satisfied | ||
--> $DIR/simple.rs:19:17 | ||
| | ||
LL | needs_foo::<*mut ()>(); | ||
| ^^^^^^^ the trait `Send` is not implemented for `*mut ()`, which is required by `*mut (): Foo` | ||
| | ||
note: required for `*mut ()` to implement `Foo` | ||
--> $DIR/simple.rs:10:9 | ||
| | ||
LL | impl<T> Foo for T where T: Send {} | ||
| ^^^ ^ ---- unsatisfied trait bound introduced here | ||
note: required by a bound in `needs_foo` | ||
--> $DIR/simple.rs:14:17 | ||
| | ||
LL | fn needs_foo<T: Foo>() {} | ||
| ^^^ required by this bound in `needs_foo` | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
15 changes: 15 additions & 0 deletions
15
tests/ui/diagnostic_namespace/do_not_recommend/simple.next.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,15 @@ | ||
error[E0277]: the trait bound `*mut (): Foo` is not satisfied | ||
--> $DIR/simple.rs:19:17 | ||
| | ||
LL | needs_foo::<*mut ()>(); | ||
| ^^^^^^^ the trait `Foo` is not implemented for `*mut ()` | ||
| | ||
note: required by a bound in `needs_foo` | ||
--> $DIR/simple.rs:14:17 | ||
| | ||
LL | fn needs_foo<T: Foo>() {} | ||
| ^^^ required by this bound in `needs_foo` | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
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,23 @@ | ||
//@ revisions: current next | ||
//@ ignore-compare-mode-next-solver (explicit revisions) | ||
//@[next] compile-flags: -Znext-solver | ||
|
||
#![feature(do_not_recommend)] | ||
|
||
trait Foo {} | ||
|
||
#[do_not_recommend] | ||
impl<T> Foo for T where T: Send {} | ||
//[current]~^ NOTE required for `*mut ()` to implement `Foo` | ||
//[current]~| NOTE unsatisfied trait bound introduced here | ||
|
||
fn needs_foo<T: Foo>() {} | ||
//~^ NOTE required by a bound in `needs_foo` | ||
//~| NOTE required by this bound in `needs_foo` | ||
|
||
fn main() { | ||
needs_foo::<*mut ()>(); | ||
//~^ ERROR the trait bound `*mut (): Foo` is not satisfied | ||
//[current]~| NOTE the trait `Send` is not implemented for `*mut ()` | ||
//[next]~| NOTE the trait `Foo` is not implemented for `*mut ()` | ||
} |