mirror of https://github.com/rust-lang/rust.git
Make `feature(effects)` require `-Znext-solver`
This commit is contained in:
parent
6c3485512f
commit
34ae56de35
|
@ -120,6 +120,10 @@ hir_analysis_drop_impl_reservation = reservation `Drop` impls are not supported
|
||||||
hir_analysis_duplicate_precise_capture = cannot capture parameter `{$name}` twice
|
hir_analysis_duplicate_precise_capture = cannot capture parameter `{$name}` twice
|
||||||
.label = parameter captured again here
|
.label = parameter captured again here
|
||||||
|
|
||||||
|
hir_analysis_effects_without_next_solver = using `#![feature(effects)]` without enabling next trait solver globally
|
||||||
|
.note = the next trait solver must be enabled globally for the effects feature to work correctly
|
||||||
|
.help = use `-Znext-solver` to enable
|
||||||
|
|
||||||
hir_analysis_empty_specialization = specialization impl does not specialize any associated items
|
hir_analysis_empty_specialization = specialization impl does not specialize any associated items
|
||||||
.note = impl is a specialization of this impl
|
.note = impl is a specialization of this impl
|
||||||
|
|
||||||
|
|
|
@ -1699,3 +1699,9 @@ pub struct InvalidReceiverTy<'tcx> {
|
||||||
pub span: Span,
|
pub span: Span,
|
||||||
pub receiver_ty: Ty<'tcx>,
|
pub receiver_ty: Ty<'tcx>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Diagnostic)]
|
||||||
|
#[diag(hir_analysis_effects_without_next_solver)]
|
||||||
|
#[note]
|
||||||
|
#[help]
|
||||||
|
pub struct EffectsWithoutNextSolver;
|
||||||
|
|
|
@ -151,6 +151,12 @@ pub fn provide(providers: &mut Providers) {
|
||||||
pub fn check_crate(tcx: TyCtxt<'_>) {
|
pub fn check_crate(tcx: TyCtxt<'_>) {
|
||||||
let _prof_timer = tcx.sess.timer("type_check_crate");
|
let _prof_timer = tcx.sess.timer("type_check_crate");
|
||||||
|
|
||||||
|
// FIXME(effects): remove once effects is implemented in old trait solver
|
||||||
|
// or if the next solver is stabilized.
|
||||||
|
if tcx.features().effects && !tcx.next_trait_solver_globally() {
|
||||||
|
tcx.dcx().emit_err(errors::EffectsWithoutNextSolver);
|
||||||
|
}
|
||||||
|
|
||||||
tcx.sess.time("coherence_checking", || {
|
tcx.sess.time("coherence_checking", || {
|
||||||
tcx.hir().par_for_each_module(|module| {
|
tcx.hir().par_for_each_module(|module| {
|
||||||
let _ = tcx.ensure().check_mod_type_wf(module);
|
let _ = tcx.ensure().check_mod_type_wf(module);
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
error: using `#![feature(effects)]` without enabling next trait solver globally
|
||||||
|
|
|
||||||
|
= note: the next trait solver must be enabled globally for the effects feature to work correctly
|
||||||
|
= help: use `-Znext-solver` to enable
|
||||||
|
|
||||||
|
error: aborting due to 1 previous error
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
// test that we error correctly when effects is used without the next-solver flag.
|
||||||
|
//@ revisions: stock coherence full
|
||||||
|
//@[coherence] compile-flags: -Znext-solver=coherence
|
||||||
|
//@[full] compile-flags: -Znext-solver
|
||||||
|
//@[full] check-pass
|
||||||
|
|
||||||
|
#![feature(effects)]
|
||||||
|
#![allow(incomplete_features)]
|
||||||
|
|
||||||
|
fn main() {}
|
|
@ -0,0 +1,7 @@
|
||||||
|
error: using `#![feature(effects)]` without enabling next trait solver globally
|
||||||
|
|
|
||||||
|
= note: the next trait solver must be enabled globally for the effects feature to work correctly
|
||||||
|
= help: use `-Znext-solver` to enable
|
||||||
|
|
||||||
|
error: aborting due to 1 previous error
|
||||||
|
|
Loading…
Reference in New Issue