Skip to content

Commit 344c7a7

Browse files
compiler-errorslcnr
authored andcommitted
enable -Znext-solver by default
1 parent 386b97f commit 344c7a7

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

compiler/rustc_ast_passes/src/feature_gate.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -653,10 +653,13 @@ fn check_new_solver_banned_features(sess: &Session, features: &Features) {
653653
.map(|feat| feat.attr_sp)
654654
{
655655
#[allow(rustc::symbol_intern_string_literal)]
656-
sess.dcx().emit_err(errors::IncompatibleFeatures {
657-
spans: vec![gce_span],
658-
f1: Symbol::intern("-Znext-solver=globally"),
659-
f2: sym::generic_const_exprs,
660-
});
656+
sess.dcx()
657+
.create_fatal(errors::IncompatibleFeatures {
658+
spans: vec![gce_span],
659+
f1: Symbol::intern("-Znext-solver=globally"),
660+
f2: sym::generic_const_exprs,
661+
})
662+
.with_code(rustc_errors::E0001)
663+
.emit();
661664
}
662665
}

compiler/rustc_middle/src/ty/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3475,7 +3475,7 @@ impl<'tcx> TyCtxt<'tcx> {
34753475
}
34763476

34773477
pub fn next_trait_solver_globally(self) -> bool {
3478-
self.sess.opts.unstable_opts.next_solver.globally
3478+
self.sess.opts.unstable_opts.next_solver.globally && !self.features().generic_const_exprs()
34793479
}
34803480

34813481
pub fn next_trait_solver_in_coherence(self) -> bool {

0 commit comments

Comments
 (0)