@@ -6,7 +6,7 @@ use rustc_errors::msg;
66use rustc_feature:: Features ;
77use rustc_session:: Session ;
88use rustc_session:: diagnostics:: { feature_err, feature_warn} ;
9- use rustc_span:: { Span , Spanned , Symbol , sym} ;
9+ use rustc_span:: { Span , Spanned , sym} ;
1010
1111use crate :: diagnostics;
1212
@@ -436,7 +436,7 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
436436 maybe_stage_features ( sess, features, krate) ;
437437 check_incompatible_features ( sess, features) ;
438438 check_dependent_features ( sess, features) ;
439- check_new_solver_banned_features ( sess, features) ;
439+ warn_next_solver_and_gce ( sess, features) ;
440440 check_features_requiring_new_solver ( sess, features) ;
441441
442442 let mut visitor = PostExpansionVisitor { sess, features } ;
@@ -722,26 +722,21 @@ fn check_dependent_features(sess: &Session, features: &Features) {
722722 }
723723}
724724
725- fn check_new_solver_banned_features ( sess : & Session , features : & Features ) {
725+ fn warn_next_solver_and_gce ( sess : & Session , features : & Features ) {
726726 if !sess. opts . unstable_opts . next_solver . globally {
727727 return ;
728728 }
729729
730- // Ban GCE with the new solver, because it does not implement GCE correctly.
730+ // Warn people who uses GCE and -Znext-solver=globally
731+ // that their trait solver was downgraded to -Znext-solver=no
731732 if let Some ( gce_span) = features
732733 . enabled_lang_features ( )
733734 . iter ( )
734735 . find ( |feat| feat. gate_name == sym:: generic_const_exprs)
735736 . map ( |feat| feat. attr_sp )
736737 {
737- // Abort immediately, otherwise GCE can lower to `ConstKind::Expr`,
738- // which the new solver intentionally does not support.
739- #[ allow( rustc:: symbol_intern_string_literal) ]
740- sess. dcx ( ) . emit_fatal ( diagnostics:: IncompatibleFeatures {
741- spans : vec ! [ gce_span] ,
742- f1 : Symbol :: intern ( "-Znext-solver=globally" ) ,
743- f2 : sym:: generic_const_exprs,
744- } ) ;
738+ sess. dcx ( )
739+ . emit_warn ( diagnostics:: NextSolverDisabledForGenericConstExprs { span : gce_span } ) ;
745740 }
746741}
747742
0 commit comments