Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/rustc_ast_passes/src/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ fn warn_next_solver_and_gce(sess: &Session, features: &Features) {
}

fn check_features_requiring_new_solver(sess: &Session, features: &Features) {
if sess.opts.unstable_opts.next_solver.globally {
if sess.opts.unstable_opts.next_solver.globally && !features.generic_const_exprs() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure this is the right way to do it? Shouldn't we really just emit an error when GCE and next_solver are both enabled instead of a warning? Downgrading next solver to coherence only appears the wrong approach.

What if we removed GCE as a feature?

return;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
//@ run-pass
//@ compile-flags: -Znext-solver=globally

#![feature(min_generic_const_args)]
#![feature(generic_const_args)]
//~^ ERROR:`generic_const_args` requires -Znext-solver=globally to be enabled

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//~^ ERROR:`generic_const_args` requires -Znext-solver=globally to be enabled
//~^ ERROR: `generic_const_args` requires -Znext-solver=globally to be enabled

#![feature(generic_const_exprs)]
//~^ WARN: `feature(generic_const_exprs)` is not supported with the next-generation trait solver
//@ normalize-stderr: "(--> ).*/tests/ui/const-generics/generic_const_exprs" -> "$1$$DIR"

use std::mem::size_of;

union AsBytes<T> {
//~^ WARN: union `AsBytes` is never used
as_bytes: [u8; { size_of::<T>() }],
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ LL | #![feature(generic_const_exprs)]
= note: the currently stable trait solver will be used for this crate
= note: see issues #160895 <https://github.com/rust-lang/rust/issues/160895> for more information

warning: union `AsBytes` is never used
--> $DIR/next-solver-gce-incompatible-issue-158428.rs:12:7
error: `generic_const_args` requires -Znext-solver=globally to be enabled
--> $DIR/next-solver-gce-incompatible-issue-158428.rs:4:12
|
LL | union AsBytes<T> {
| ^^^^^^^
LL | #![feature(generic_const_args)]
| ^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default
= help: enable all of these features

warning: 2 warnings emitted
error: aborting due to 1 previous error; 1 warning emitted

Loading