-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
fatal error if both -Znext-solver and GCE are enabled
#158738
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
Merged
rust-bors
merged 3 commits into
rust-lang:main
from
Dnreikronos:next_trait_solver/gce_expr_recovery
Jul 22, 2026
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
15 changes: 15 additions & 0 deletions
15
tests/ui/const-generics/generic_const_exprs/next-solver-gce-incompatible-issue-158428.rs
This file contains hidden or 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 @@ | ||
| //@ compile-flags: -Znext-solver=globally | ||
|
|
||
| #![feature(min_generic_const_args)] | ||
| #![feature(generic_const_args)] | ||
| #![feature(generic_const_exprs)] | ||
| //~^ ERROR `-Znext-solver=globally` and `generic_const_exprs` are incompatible | ||
| //@ normalize-stderr: "(--> ).*/tests/ui/const-generics/generic_const_exprs" -> "$1$$DIR" | ||
|
|
||
| use std::mem::size_of; | ||
|
|
||
| union AsBytes<T> { | ||
| as_bytes: [u8; const { size_of::<T>() }], | ||
| } | ||
|
|
||
| fn main() {} |
10 changes: 10 additions & 0 deletions
10
tests/ui/const-generics/generic_const_exprs/next-solver-gce-incompatible-issue-158428.stderr
This file contains hidden or 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: `-Znext-solver=globally` and `generic_const_exprs` are incompatible, using them at the same time is not allowed | ||
| --> $DIR/next-solver-gce-incompatible-issue-158428.rs:5:12 | ||
| | | ||
| LL | #![feature(generic_const_exprs)] | ||
| | ^^^^^^^^^^^^^^^^^^^ | ||
| | | ||
| = help: remove one of these features | ||
|
|
||
| error: aborting due to 1 previous error | ||
|
|
This file contains hidden or 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
56 changes: 21 additions & 35 deletions
56
tests/ui/traits/const-traits/unsatisfied-const-trait-bound.stderr
This file contains hidden or 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 |
|---|---|---|
| @@ -1,45 +1,31 @@ | ||
| error: `-Znext-solver=globally` and `generic_const_exprs` are incompatible, using them at the same time is not allowed | ||
| --> $DIR/unsatisfied-const-trait-bound.rs:5:30 | ||
| error[E0277]: the trait bound `T: const Trait` is not satisfied | ||
| --> $DIR/unsatisfied-const-trait-bound.rs:28:37 | ||
| | | ||
| LL | #![feature(const_trait_impl, generic_const_exprs)] | ||
| | ^^^^^^^^^^^^^^^^^^^ | ||
| LL | fn accept0<T: Trait>(_: Container<{ T::make() }>) {} | ||
| | ^ | ||
|
|
||
| error[E0277]: the trait bound `T: const Trait` is not satisfied | ||
| --> $DIR/unsatisfied-const-trait-bound.rs:32:51 | ||
| | | ||
| = help: remove one of these features | ||
| LL | const fn accept1<T: [const] Trait>(_: Container<{ T::make() }>) {} | ||
| | ^ | ||
|
|
||
| error[E0391]: cycle detected when evaluating type-level constant | ||
| --> $DIR/unsatisfied-const-trait-bound.rs:28:35 | ||
| error[E0277]: the trait bound `Ty: const Trait` is not satisfied | ||
| --> $DIR/unsatisfied-const-trait-bound.rs:21:15 | ||
| | | ||
| LL | fn accept0<T: Trait>(_: Container<{ T::make() }>) {} | ||
| | ^^^^^^^^^^^^^ | ||
| LL | require::<Ty>(); | ||
| | ^^ | ||
| | | ||
| = note: ...which requires const-evaluating + checking `accept0::{constant#0}`... | ||
| = note: ...which requires checking if `accept0::{constant#0}` is a trivial const... | ||
| = note: ...which requires building MIR for `accept0::{constant#0}`... | ||
| = note: ...which requires building an abstract representation for `accept0::{constant#0}`... | ||
| = note: ...which requires building THIR for `accept0::{constant#0}`... | ||
| = note: ...which requires type-checking `accept0::{constant#0}`... | ||
| = note: ...which requires computing normalized predicates of `accept0::{constant#0}`... | ||
| = note: ...which again requires evaluating type-level constant, completing the cycle | ||
| = note: cycle used when computing normalized predicates of `accept0` | ||
| = note: for more information, see <https://rustc-dev-guide.rust-lang.org/overview.html#queries> and <https://rustc-dev-guide.rust-lang.org/query.html> | ||
|
|
||
| error[E0391]: cycle detected when checking if `accept1::{constant#0}` is a trivial const | ||
| --> $DIR/unsatisfied-const-trait-bound.rs:32:49 | ||
| note: required by a bound in `require` | ||
| --> $DIR/unsatisfied-const-trait-bound.rs:8:15 | ||
| | | ||
| LL | const fn accept1<T: [const] Trait>(_: Container<{ T::make() }>) {} | ||
| | ^^^^^^^^^^^^^ | ||
| LL | fn require<T: const Trait>() {} | ||
| | ^^^^^^^^^^^ required by this bound in `require` | ||
| help: make the `impl` of trait `Trait` `const` | ||
| | | ||
| = note: ...which requires building MIR for `accept1::{constant#0}`... | ||
| = note: ...which requires building an abstract representation for `accept1::{constant#0}`... | ||
| = note: ...which requires building THIR for `accept1::{constant#0}`... | ||
| = note: ...which requires type-checking `accept1::{constant#0}`... | ||
| = note: ...which requires computing normalized predicates of `accept1::{constant#0}`... | ||
| = note: ...which requires evaluating type-level constant... | ||
| = note: ...which requires const-evaluating + checking `accept1::{constant#0}`... | ||
| = note: ...which again requires checking if `accept1::{constant#0}` is a trivial const, completing the cycle | ||
| = note: cycle used when const-evaluating + checking `accept1::{constant#0}` | ||
| = note: for more information, see <https://rustc-dev-guide.rust-lang.org/overview.html#queries> and <https://rustc-dev-guide.rust-lang.org/query.html> | ||
| LL | impl const Trait for Ty { | ||
| | +++++ | ||
|
|
||
| error: aborting due to 3 previous errors | ||
|
|
||
| For more information about this error, try `rustc --explain E0391`. | ||
| For more information about this error, try `rustc --explain E0277`. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.