-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Fix effect predicates from item bounds in old solver #134638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
error[E0277]: the trait bound `U: ~const Other` is not satisfied | ||
--> $DIR/assoc-type-const-bound-usage-fail-2.rs:24:5 | ||
| | ||
LL | T::Assoc::<U>::func(); | ||
| ^^^^^^^^^^^^^ | ||
|
||
error[E0277]: the trait bound `U: ~const Other` is not satisfied | ||
--> $DIR/assoc-type-const-bound-usage-fail-2.rs:27:5 | ||
| | ||
LL | <T as Trait>::Assoc::<U>::func(); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
//@ compile-flags: -Znext-solver | ||
//@ revisions: current next | ||
//@[next] compile-flags: -Znext-solver | ||
|
||
// Check that `~const` item bounds only hold if the where clauses on the | ||
// associated type are also const. | ||
|
@@ -21,9 +22,11 @@ trait Other {} | |
|
||
const fn fails<T: ~const Trait, U: Other>() { | ||
T::Assoc::<U>::func(); | ||
//~^ ERROR the trait bound `<T as Trait>::Assoc<U>: ~const Trait` is not satisfied | ||
//[current]~^ ERROR the trait bound `U: ~const Other` is not satisfied | ||
//[next]~^^ ERROR the trait bound `<T as Trait>::Assoc<U>: ~const Trait` is not satisfied | ||
<T as Trait>::Assoc::<U>::func(); | ||
//~^ ERROR the trait bound `<T as Trait>::Assoc<U>: ~const Trait` is not satisfied | ||
//[current]~^ ERROR the trait bound `U: ~const Other` is not satisfied | ||
//[next]~^^ ERROR the trait bound `<T as Trait>::Assoc<U>: ~const Trait` is not satisfied | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
but we don't go deeper in the proof tree visitor b/c the nested obligation is not considered a where clause for the purposes of proof tree visitor. This may be fixed by #132345. |
||
} | ||
|
||
const fn works<T: ~const Trait, U: ~const Other>() { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
error[E0277]: the trait bound `T: ~const Trait` is not satisfied | ||
--> $DIR/assoc-type-const-bound-usage-fail.rs:17:5 | ||
| | ||
LL | T::Assoc::func(); | ||
| ^^^^^^^^ | ||
|
||
error[E0277]: the trait bound `T: ~const Trait` is not satisfied | ||
--> $DIR/assoc-type-const-bound-usage-fail.rs:19:5 | ||
| | ||
LL | <T as Trait>::Assoc::func(); | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
error[E0277]: the trait bound `NonConstAdd: ~const Add` is not satisfied | ||
--> $DIR/assoc-type.rs:37:16 | ||
| | ||
LL | type Bar = NonConstAdd; | ||
| ^^^^^^^^^^^ | ||
| | ||
note: required by a bound in `Foo::Bar` | ||
--> $DIR/assoc-type.rs:33:15 | ||
| | ||
LL | type Bar: ~const Add; | ||
| ^^^^^^ required by this bound in `Foo::Bar` | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
Uh oh!
There was an error while loading. Please reload this page.