diff --git a/compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs b/compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs index c902e85c2673c..a5709089db689 100644 --- a/compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs +++ b/compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs @@ -168,13 +168,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { match hir_bound { hir::GenericBound::Trait(poly_trait_ref) => { let hir::TraitBoundModifiers { constness, polarity } = poly_trait_ref.modifiers; - // FIXME: We could pass these directly into `lower_poly_trait_ref` - // so that we could use these spans in diagnostics within that function... - let constness = match constness { - hir::BoundConstness::Never => None, - hir::BoundConstness::Always(_) => Some(ty::BoundConstness::Const), - hir::BoundConstness::Maybe(_) => Some(ty::BoundConstness::ConstIfConst), - }; let polarity = match polarity { rustc_ast::BoundPolarity::Positive => ty::PredicatePolarity::Positive, rustc_ast::BoundPolarity::Negative(_) => ty::PredicatePolarity::Negative, diff --git a/compiler/rustc_hir_analysis/src/hir_ty_lowering/dyn_compatibility.rs b/compiler/rustc_hir_analysis/src/hir_ty_lowering/dyn_compatibility.rs index 890e8fa99e65b..f2ee4b0ccd417 100644 --- a/compiler/rustc_hir_analysis/src/hir_ty_lowering/dyn_compatibility.rs +++ b/compiler/rustc_hir_analysis/src/hir_ty_lowering/dyn_compatibility.rs @@ -50,7 +50,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { } = self.lower_poly_trait_ref( &trait_bound.trait_ref, trait_bound.span, - None, + hir::BoundConstness::Never, ty::PredicatePolarity::Positive, dummy_self, &mut bounds, diff --git a/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs b/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs index 863c077a9e03c..4b7eb0b00bba2 100644 --- a/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs +++ b/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs @@ -658,7 +658,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { &self, trait_ref: &hir::TraitRef<'tcx>, span: Span, - constness: Option, + constness: hir::BoundConstness, polarity: ty::PredicatePolarity, self_ty: Ty<'tcx>, bounds: &mut Bounds<'tcx>, @@ -681,11 +681,11 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { Some(self_ty), ); - if let Some(constness) = constness + if let hir::BoundConstness::Always(span) | hir::BoundConstness::Maybe(span) = constness && !self.tcx().is_const_trait(trait_def_id) { self.dcx().emit_err(crate::errors::ConstBoundForNonConstTrait { - span: trait_ref.path.span, + span, modifier: constness.as_str(), }); } @@ -708,7 +708,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { bounds.push_trait_bound(tcx, poly_trait_ref, span, polarity); match constness { - Some(ty::BoundConstness::Const) => { + hir::BoundConstness::Always(span) => { if polarity == ty::PredicatePolarity::Positive { bounds.push_const_bound( tcx, @@ -718,13 +718,13 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { ); } } - Some(ty::BoundConstness::ConstIfConst) => { + hir::BoundConstness::Maybe(_) => { // We don't emit a const bound here, since that would mean that we // unconditionally need to prove a `HostEffect` predicate, even when // the predicates are being instantiated in a non-const context. This // is instead handled in the `const_conditions` query. } - None => {} + hir::BoundConstness::Never => {} } } // On the flip side, when filtering `ConstIfConst` bounds, we only need to convert @@ -734,12 +734,12 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { // here because we only call this on self bounds, and deal with the recursive case // in `lower_assoc_item_constraint`. PredicateFilter::ConstIfConst | PredicateFilter::SelfConstIfConst => match constness { - Some(ty::BoundConstness::ConstIfConst) => { + hir::BoundConstness::Maybe(span) => { if polarity == ty::PredicatePolarity::Positive { bounds.push_const_bound(tcx, poly_trait_ref, ty::HostPolarity::Maybe, span); } } - None | Some(ty::BoundConstness::Const) => {} + hir::BoundConstness::Always(_) | hir::BoundConstness::Never => {} }, } diff --git a/tests/ui/consts/const-block-const-bound.stderr b/tests/ui/consts/const-block-const-bound.stderr index 8cb91d78f6cac..5e24959146b83 100644 --- a/tests/ui/consts/const-block-const-bound.stderr +++ b/tests/ui/consts/const-block-const-bound.stderr @@ -1,14 +1,14 @@ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-block-const-bound.rs:8:22 + --> $DIR/const-block-const-bound.rs:8:15 | LL | const fn f(x: T) {} - | ^^^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-block-const-bound.rs:8:22 + --> $DIR/const-block-const-bound.rs:8:15 | LL | const fn f(x: T) {} - | ^^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/consts/fn_trait_refs.stderr b/tests/ui/consts/fn_trait_refs.stderr index 82b2b87c4a5ad..a686bc23c0f41 100644 --- a/tests/ui/consts/fn_trait_refs.stderr +++ b/tests/ui/consts/fn_trait_refs.stderr @@ -11,168 +11,168 @@ LL | #![feature(const_cmp)] | ^^^^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:13:15 + --> $DIR/fn_trait_refs.rs:13:8 | LL | T: ~const Fn<()> + ~const Destruct, - | ^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:13:31 + --> $DIR/fn_trait_refs.rs:13:24 | LL | T: ~const Fn<()> + ~const Destruct, - | ^^^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:13:15 + --> $DIR/fn_trait_refs.rs:13:8 | LL | T: ~const Fn<()> + ~const Destruct, - | ^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:13:15 + --> $DIR/fn_trait_refs.rs:13:8 | LL | T: ~const Fn<()> + ~const Destruct, - | ^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:13:31 + --> $DIR/fn_trait_refs.rs:13:24 | LL | T: ~const Fn<()> + ~const Destruct, - | ^^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:20:15 + --> $DIR/fn_trait_refs.rs:20:8 | LL | T: ~const FnMut<()> + ~const Destruct, - | ^^^^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:20:34 + --> $DIR/fn_trait_refs.rs:20:27 | LL | T: ~const FnMut<()> + ~const Destruct, - | ^^^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:20:15 + --> $DIR/fn_trait_refs.rs:20:8 | LL | T: ~const FnMut<()> + ~const Destruct, - | ^^^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:20:15 + --> $DIR/fn_trait_refs.rs:20:8 | LL | T: ~const FnMut<()> + ~const Destruct, - | ^^^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:20:34 + --> $DIR/fn_trait_refs.rs:20:27 | LL | T: ~const FnMut<()> + ~const Destruct, - | ^^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:27:15 + --> $DIR/fn_trait_refs.rs:27:8 | LL | T: ~const FnOnce<()>, - | ^^^^^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:27:15 + --> $DIR/fn_trait_refs.rs:27:8 | LL | T: ~const FnOnce<()>, - | ^^^^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:27:15 + --> $DIR/fn_trait_refs.rs:27:8 | LL | T: ~const FnOnce<()>, - | ^^^^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:34:15 + --> $DIR/fn_trait_refs.rs:34:8 | LL | T: ~const Fn<()> + ~const Destruct, - | ^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:34:31 + --> $DIR/fn_trait_refs.rs:34:24 | LL | T: ~const Fn<()> + ~const Destruct, - | ^^^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:34:15 + --> $DIR/fn_trait_refs.rs:34:8 | LL | T: ~const Fn<()> + ~const Destruct, - | ^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:34:15 + --> $DIR/fn_trait_refs.rs:34:8 | LL | T: ~const Fn<()> + ~const Destruct, - | ^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:34:31 + --> $DIR/fn_trait_refs.rs:34:24 | LL | T: ~const Fn<()> + ~const Destruct, - | ^^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:48:15 + --> $DIR/fn_trait_refs.rs:48:8 | LL | T: ~const FnMut<()> + ~const Destruct, - | ^^^^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:48:34 + --> $DIR/fn_trait_refs.rs:48:27 | LL | T: ~const FnMut<()> + ~const Destruct, - | ^^^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:48:15 + --> $DIR/fn_trait_refs.rs:48:8 | LL | T: ~const FnMut<()> + ~const Destruct, - | ^^^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:48:15 + --> $DIR/fn_trait_refs.rs:48:8 | LL | T: ~const FnMut<()> + ~const Destruct, - | ^^^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:48:34 + --> $DIR/fn_trait_refs.rs:48:27 | LL | T: ~const FnMut<()> + ~const Destruct, - | ^^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/consts/unstable-const-fn-in-libcore.stderr b/tests/ui/consts/unstable-const-fn-in-libcore.stderr index e546694070dd9..2bdec1bf41b72 100644 --- a/tests/ui/consts/unstable-const-fn-in-libcore.stderr +++ b/tests/ui/consts/unstable-const-fn-in-libcore.stderr @@ -1,14 +1,14 @@ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/unstable-const-fn-in-libcore.rs:19:39 + --> $DIR/unstable-const-fn-in-libcore.rs:19:32 | LL | const fn unwrap_or_else T>(self, f: F) -> T { - | ^^^^^^^^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/unstable-const-fn-in-libcore.rs:19:39 + --> $DIR/unstable-const-fn-in-libcore.rs:19:32 | LL | const fn unwrap_or_else T>(self, f: F) -> T { - | ^^^^^^^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/impl-trait/normalize-tait-in-const.stderr b/tests/ui/impl-trait/normalize-tait-in-const.stderr index b370a5d7eb116..f9142664f1b82 100644 --- a/tests/ui/impl-trait/normalize-tait-in-const.stderr +++ b/tests/ui/impl-trait/normalize-tait-in-const.stderr @@ -1,28 +1,28 @@ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/normalize-tait-in-const.rs:26:42 + --> $DIR/normalize-tait-in-const.rs:26:35 | LL | const fn with_positive ~const Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) { - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/normalize-tait-in-const.rs:26:69 + --> $DIR/normalize-tait-in-const.rs:26:62 | LL | const fn with_positive ~const Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) { - | ^^^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/normalize-tait-in-const.rs:26:42 + --> $DIR/normalize-tait-in-const.rs:26:35 | LL | const fn with_positive ~const Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) { - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/normalize-tait-in-const.rs:26:69 + --> $DIR/normalize-tait-in-const.rs:26:62 | LL | const fn with_positive ~const Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) { - | ^^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/specialization/const_trait_impl.stderr b/tests/ui/specialization/const_trait_impl.stderr index 746b08fa71058..40ac350980ef6 100644 --- a/tests/ui/specialization/const_trait_impl.stderr +++ b/tests/ui/specialization/const_trait_impl.stderr @@ -1,42 +1,42 @@ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const_trait_impl.rs:34:16 + --> $DIR/const_trait_impl.rs:34:9 | LL | impl const A for T { - | ^^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const_trait_impl.rs:40:16 + --> $DIR/const_trait_impl.rs:40:9 | LL | impl const A for T { - | ^^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const_trait_impl.rs:46:16 + --> $DIR/const_trait_impl.rs:46:9 | LL | impl const A for T { - | ^^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const_trait_impl.rs:40:16 + --> $DIR/const_trait_impl.rs:40:9 | LL | impl const A for T { - | ^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const_trait_impl.rs:34:16 + --> $DIR/const_trait_impl.rs:34:9 | LL | impl const A for T { - | ^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const_trait_impl.rs:46:16 + --> $DIR/const_trait_impl.rs:46:9 | LL | impl const A for T { - | ^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/traits/const-traits/assoc-type.stderr b/tests/ui/traits/const-traits/assoc-type.stderr index 5c77754200a6c..672eaf26f7275 100644 --- a/tests/ui/traits/const-traits/assoc-type.stderr +++ b/tests/ui/traits/const-traits/assoc-type.stderr @@ -17,7 +17,7 @@ note: required by a bound in `Foo::Bar` --> $DIR/assoc-type.rs:32:15 | LL | type Bar: ~const Add; - | ^^^^^^^^^^ required by this bound in `Foo::Bar` + | ^^^^^^ required by this bound in `Foo::Bar` error: aborting due to 1 previous error; 1 warning emitted diff --git a/tests/ui/traits/const-traits/call-generic-in-impl.stderr b/tests/ui/traits/const-traits/call-generic-in-impl.stderr index 971e77e372b81..52ee04425b2c7 100644 --- a/tests/ui/traits/const-traits/call-generic-in-impl.stderr +++ b/tests/ui/traits/const-traits/call-generic-in-impl.stderr @@ -1,14 +1,14 @@ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/call-generic-in-impl.rs:10:16 + --> $DIR/call-generic-in-impl.rs:10:9 | LL | impl const MyPartialEq for T { - | ^^^^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/call-generic-in-impl.rs:10:16 + --> $DIR/call-generic-in-impl.rs:10:9 | LL | impl const MyPartialEq for T { - | ^^^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/traits/const-traits/call-generic-method-chain.stderr b/tests/ui/traits/const-traits/call-generic-method-chain.stderr index aa90305c64826..6dbf3ad252657 100644 --- a/tests/ui/traits/const-traits/call-generic-method-chain.stderr +++ b/tests/ui/traits/const-traits/call-generic-method-chain.stderr @@ -17,30 +17,30 @@ LL | impl const PartialEq for S { = note: adding a non-const method body in the future would be a breaking change error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/call-generic-method-chain.rs:20:32 + --> $DIR/call-generic-method-chain.rs:20:25 | LL | const fn equals_self(t: &T) -> bool { - | ^^^^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/call-generic-method-chain.rs:20:32 + --> $DIR/call-generic-method-chain.rs:20:25 | LL | const fn equals_self(t: &T) -> bool { - | ^^^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/call-generic-method-chain.rs:24:40 + --> $DIR/call-generic-method-chain.rs:24:33 | LL | const fn equals_self_wrapper(t: &T) -> bool { - | ^^^^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/call-generic-method-chain.rs:24:40 + --> $DIR/call-generic-method-chain.rs:24:33 | LL | const fn equals_self_wrapper(t: &T) -> bool { - | ^^^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/traits/const-traits/call-generic-method-dup-bound.stderr b/tests/ui/traits/const-traits/call-generic-method-dup-bound.stderr index 029915b7646d8..08877daad79da 100644 --- a/tests/ui/traits/const-traits/call-generic-method-dup-bound.stderr +++ b/tests/ui/traits/const-traits/call-generic-method-dup-bound.stderr @@ -17,30 +17,30 @@ LL | impl const PartialEq for S { = note: adding a non-const method body in the future would be a breaking change error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/call-generic-method-dup-bound.rs:20:44 + --> $DIR/call-generic-method-dup-bound.rs:20:37 | LL | const fn equals_self(t: &T) -> bool { - | ^^^^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/call-generic-method-dup-bound.rs:20:44 + --> $DIR/call-generic-method-dup-bound.rs:20:37 | LL | const fn equals_self(t: &T) -> bool { - | ^^^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/call-generic-method-dup-bound.rs:27:37 + --> $DIR/call-generic-method-dup-bound.rs:27:30 | LL | const fn equals_self2(t: &T) -> bool { - | ^^^^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/call-generic-method-dup-bound.rs:27:37 + --> $DIR/call-generic-method-dup-bound.rs:27:30 | LL | const fn equals_self2(t: &T) -> bool { - | ^^^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/traits/const-traits/call-generic-method-pass.stderr b/tests/ui/traits/const-traits/call-generic-method-pass.stderr index 97ce7fe1c2a8a..ac08c057435e0 100644 --- a/tests/ui/traits/const-traits/call-generic-method-pass.stderr +++ b/tests/ui/traits/const-traits/call-generic-method-pass.stderr @@ -17,16 +17,16 @@ LL | impl const PartialEq for S { = note: adding a non-const method body in the future would be a breaking change error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/call-generic-method-pass.rs:20:32 + --> $DIR/call-generic-method-pass.rs:20:25 | LL | const fn equals_self(t: &T) -> bool { - | ^^^^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/call-generic-method-pass.rs:20:32 + --> $DIR/call-generic-method-pass.rs:20:25 | LL | const fn equals_self(t: &T) -> bool { - | ^^^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/traits/const-traits/const-bounds-non-const-trait.stderr b/tests/ui/traits/const-traits/const-bounds-non-const-trait.stderr index 6c3c11c6a4756..d27be2a324b8a 100644 --- a/tests/ui/traits/const-traits/const-bounds-non-const-trait.stderr +++ b/tests/ui/traits/const-traits/const-bounds-non-const-trait.stderr @@ -13,24 +13,24 @@ error: using `#![feature(effects)]` without enabling next trait solver globally = help: use `-Znext-solver` to enable error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-bounds-non-const-trait.rs:6:28 + --> $DIR/const-bounds-non-const-trait.rs:6:21 | LL | const fn perform() {} - | ^^^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-bounds-non-const-trait.rs:6:28 + --> $DIR/const-bounds-non-const-trait.rs:6:21 | LL | const fn perform() {} - | ^^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `const` can only be applied to `#[const_trait]` traits - --> $DIR/const-bounds-non-const-trait.rs:10:21 + --> $DIR/const-bounds-non-const-trait.rs:10:15 | LL | fn operate() {} - | ^^^^^^^^ + | ^^^^^ error: aborting due to 4 previous errors; 1 warning emitted diff --git a/tests/ui/traits/const-traits/const-closure-parse-not-item.stderr b/tests/ui/traits/const-traits/const-closure-parse-not-item.stderr index 12cc79f5961d3..25c81ff900f27 100644 --- a/tests/ui/traits/const-traits/const-closure-parse-not-item.stderr +++ b/tests/ui/traits/const-traits/const-closure-parse-not-item.stderr @@ -1,14 +1,14 @@ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-closure-parse-not-item.rs:7:32 + --> $DIR/const-closure-parse-not-item.rs:7:25 | LL | const fn test() -> impl ~const Fn() { - | ^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-closure-parse-not-item.rs:7:32 + --> $DIR/const-closure-parse-not-item.rs:7:25 | LL | const fn test() -> impl ~const Fn() { - | ^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/traits/const-traits/const-closure-trait-method-fail.stderr b/tests/ui/traits/const-traits/const-closure-trait-method-fail.stderr index f0f033bceef44..cb4c994bc2f2d 100644 --- a/tests/ui/traits/const-traits/const-closure-trait-method-fail.stderr +++ b/tests/ui/traits/const-traits/const-closure-trait-method-fail.stderr @@ -1,14 +1,14 @@ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-closure-trait-method-fail.rs:14:39 + --> $DIR/const-closure-trait-method-fail.rs:14:32 | LL | const fn need_const_closure i32>(x: T) -> i32 { - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-closure-trait-method-fail.rs:14:39 + --> $DIR/const-closure-trait-method-fail.rs:14:32 | LL | const fn need_const_closure i32>(x: T) -> i32 { - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/traits/const-traits/const-closure-trait-method.stderr b/tests/ui/traits/const-traits/const-closure-trait-method.stderr index 4c5a4d0cdf41b..43af435ae64d7 100644 --- a/tests/ui/traits/const-traits/const-closure-trait-method.stderr +++ b/tests/ui/traits/const-traits/const-closure-trait-method.stderr @@ -1,14 +1,14 @@ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-closure-trait-method.rs:14:39 + --> $DIR/const-closure-trait-method.rs:14:32 | LL | const fn need_const_closure i32>(x: T) -> i32 { - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-closure-trait-method.rs:14:39 + --> $DIR/const-closure-trait-method.rs:14:32 | LL | const fn need_const_closure i32>(x: T) -> i32 { - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/traits/const-traits/const-closures.stderr b/tests/ui/traits/const-traits/const-closures.stderr index a81804a50dc21..2e9e37ba3216d 100644 --- a/tests/ui/traits/const-traits/const-closures.stderr +++ b/tests/ui/traits/const-traits/const-closures.stderr @@ -1,56 +1,56 @@ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-closures.rs:8:19 + --> $DIR/const-closures.rs:8:12 | LL | F: ~const FnOnce() -> u8, - | ^^^^^^^^^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-closures.rs:9:19 + --> $DIR/const-closures.rs:9:12 | LL | F: ~const FnMut() -> u8, - | ^^^^^^^^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-closures.rs:10:19 + --> $DIR/const-closures.rs:10:12 | LL | F: ~const Fn() -> u8, - | ^^^^^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-closures.rs:8:19 + --> $DIR/const-closures.rs:8:12 | LL | F: ~const FnOnce() -> u8, - | ^^^^^^^^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-closures.rs:9:19 + --> $DIR/const-closures.rs:9:12 | LL | F: ~const FnMut() -> u8, - | ^^^^^^^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-closures.rs:10:19 + --> $DIR/const-closures.rs:10:12 | LL | F: ~const Fn() -> u8, - | ^^^^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-closures.rs:23:27 + --> $DIR/const-closures.rs:23:20 | LL | const fn answer u8>(f: &F) -> u8 { - | ^^^^^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-closures.rs:23:27 + --> $DIR/const-closures.rs:23:20 | LL | const fn answer u8>(f: &F) -> u8 { - | ^^^^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/traits/const-traits/const-drop-bound.stderr b/tests/ui/traits/const-traits/const-drop-bound.stderr index d94b0542324f6..3f71864543337 100644 --- a/tests/ui/traits/const-traits/const-drop-bound.stderr +++ b/tests/ui/traits/const-traits/const-drop-bound.stderr @@ -1,42 +1,42 @@ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-drop-bound.rs:9:68 + --> $DIR/const-drop-bound.rs:9:61 | LL | const fn foo(res: Result) -> Option where E: ~const Destruct { - | ^^^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-drop-bound.rs:9:68 + --> $DIR/const-drop-bound.rs:9:61 | LL | const fn foo(res: Result) -> Option where E: ~const Destruct { - | ^^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-drop-bound.rs:20:15 + --> $DIR/const-drop-bound.rs:20:8 | LL | T: ~const Destruct, - | ^^^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-drop-bound.rs:21:15 + --> $DIR/const-drop-bound.rs:21:8 | LL | E: ~const Destruct, - | ^^^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-drop-bound.rs:20:15 + --> $DIR/const-drop-bound.rs:20:8 | LL | T: ~const Destruct, - | ^^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-drop-bound.rs:21:15 + --> $DIR/const-drop-bound.rs:21:8 | LL | E: ~const Destruct, - | ^^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/traits/const-traits/const-drop-fail-2.stderr b/tests/ui/traits/const-traits/const-drop-fail-2.stderr index 27e8053c9690a..82d6412ded0c4 100644 --- a/tests/ui/traits/const-traits/const-drop-fail-2.stderr +++ b/tests/ui/traits/const-traits/const-drop-fail-2.stderr @@ -8,16 +8,16 @@ LL | impl const Drop for ConstDropImplWithNonConstBounds { = note: adding a non-const method body in the future would be a breaking change error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-drop-fail-2.rs:20:26 + --> $DIR/const-drop-fail-2.rs:20:19 | LL | const fn check(_: T) {} - | ^^^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-drop-fail-2.rs:20:26 + --> $DIR/const-drop-fail-2.rs:20:19 | LL | const fn check(_: T) {} - | ^^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/traits/const-traits/const-drop-fail.precise.stderr b/tests/ui/traits/const-traits/const-drop-fail.precise.stderr index bde13b4d6cfa8..859fdfae81aef 100644 --- a/tests/ui/traits/const-traits/const-drop-fail.precise.stderr +++ b/tests/ui/traits/const-traits/const-drop-fail.precise.stderr @@ -8,16 +8,16 @@ LL | impl const Drop for ConstImplWithDropGlue { = note: adding a non-const method body in the future would be a breaking change error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-drop-fail.rs:23:26 + --> $DIR/const-drop-fail.rs:23:19 | LL | const fn check(_: T) {} - | ^^^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-drop-fail.rs:23:26 + --> $DIR/const-drop-fail.rs:23:19 | LL | const fn check(_: T) {} - | ^^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/traits/const-traits/const-drop-fail.stock.stderr b/tests/ui/traits/const-traits/const-drop-fail.stock.stderr index 064ffacca4274..20dea28922b6a 100644 --- a/tests/ui/traits/const-traits/const-drop-fail.stock.stderr +++ b/tests/ui/traits/const-traits/const-drop-fail.stock.stderr @@ -8,16 +8,16 @@ LL | impl const Drop for ConstImplWithDropGlue { = note: adding a non-const method body in the future would be a breaking change error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-drop-fail.rs:23:26 + --> $DIR/const-drop-fail.rs:23:19 | LL | const fn check(_: T) {} - | ^^^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-drop-fail.rs:23:26 + --> $DIR/const-drop-fail.rs:23:19 | LL | const fn check(_: T) {} - | ^^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/traits/const-traits/const-drop.precise.stderr b/tests/ui/traits/const-traits/const-drop.precise.stderr index 7b6d185c7cc8b..2b8066e5ee7c8 100644 --- a/tests/ui/traits/const-traits/const-drop.precise.stderr +++ b/tests/ui/traits/const-traits/const-drop.precise.stderr @@ -35,16 +35,16 @@ LL | impl const Drop for ConstDropWithNonconstBound { = note: adding a non-const method body in the future would be a breaking change error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-drop.rs:18:22 + --> $DIR/const-drop.rs:18:15 | LL | const fn a(_: T) {} - | ^^^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-drop.rs:18:22 + --> $DIR/const-drop.rs:18:15 | LL | const fn a(_: T) {} - | ^^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/traits/const-traits/const-drop.stock.stderr b/tests/ui/traits/const-traits/const-drop.stock.stderr index b497c39b08aaf..54ed2930b90b4 100644 --- a/tests/ui/traits/const-traits/const-drop.stock.stderr +++ b/tests/ui/traits/const-traits/const-drop.stock.stderr @@ -35,16 +35,16 @@ LL | impl const Drop for ConstDropWithNonconstBound { = note: adding a non-const method body in the future would be a breaking change error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-drop.rs:18:22 + --> $DIR/const-drop.rs:18:15 | LL | const fn a(_: T) {} - | ^^^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/const-drop.rs:18:22 + --> $DIR/const-drop.rs:18:15 | LL | const fn a(_: T) {} - | ^^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/traits/const-traits/const_derives/derive-const-with-params.stderr b/tests/ui/traits/const-traits/const_derives/derive-const-with-params.stderr index 33e7e08bb2358..64285cff0a6eb 100644 --- a/tests/ui/traits/const-traits/const_derives/derive-const-with-params.stderr +++ b/tests/ui/traits/const-traits/const_derives/derive-const-with-params.stderr @@ -23,12 +23,6 @@ LL | #[derive_const(PartialEq)] = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info) error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/derive-const-with-params.rs:7:16 - | -LL | #[derive_const(PartialEq)] - | ^^^^^^^^^ - | - = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0015]: cannot call non-const operator in constant functions --> $DIR/derive-const-with-params.rs:8:23 diff --git a/tests/ui/traits/const-traits/effects/ice-112822-expected-type-for-param.stderr b/tests/ui/traits/const-traits/effects/ice-112822-expected-type-for-param.stderr index edfdf8b5f7813..5b0d5a8bb1d06 100644 --- a/tests/ui/traits/const-traits/effects/ice-112822-expected-type-for-param.stderr +++ b/tests/ui/traits/const-traits/effects/ice-112822-expected-type-for-param.stderr @@ -23,16 +23,16 @@ error: using `#![feature(effects)]` without enabling next trait solver globally = help: use `-Znext-solver` to enable error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/ice-112822-expected-type-for-param.rs:3:32 + --> $DIR/ice-112822-expected-type-for-param.rs:3:25 | LL | const fn test() -> impl ~const Fn() { - | ^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/ice-112822-expected-type-for-param.rs:3:32 + --> $DIR/ice-112822-expected-type-for-param.rs:3:25 | LL | const fn test() -> impl ~const Fn() { - | ^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/traits/const-traits/effects/spec-effectvar-ice.stderr b/tests/ui/traits/const-traits/effects/spec-effectvar-ice.stderr index d9655c4995fa3..0cb172a2d14b8 100644 --- a/tests/ui/traits/const-traits/effects/spec-effectvar-ice.stderr +++ b/tests/ui/traits/const-traits/effects/spec-effectvar-ice.stderr @@ -37,10 +37,10 @@ LL | impl const Foo for T where T: const Specialize {} = note: adding a non-const method body in the future would be a breaking change error: `const` can only be applied to `#[const_trait]` traits - --> $DIR/spec-effectvar-ice.rs:14:40 + --> $DIR/spec-effectvar-ice.rs:14:34 | LL | impl const Foo for T where T: const Specialize {} - | ^^^^^^^^^^ + | ^^^^^ error: specialization impl does not specialize any associated items --> $DIR/spec-effectvar-ice.rs:14:1 diff --git a/tests/ui/traits/const-traits/ice-123664-unexpected-bound-var.stderr b/tests/ui/traits/const-traits/ice-123664-unexpected-bound-var.stderr index 03f88be009364..dcb7dd7a142a5 100644 --- a/tests/ui/traits/const-traits/ice-123664-unexpected-bound-var.stderr +++ b/tests/ui/traits/const-traits/ice-123664-unexpected-bound-var.stderr @@ -4,16 +4,16 @@ error: using `#![feature(effects)]` without enabling next trait solver globally = help: use `-Znext-solver` to enable error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/ice-123664-unexpected-bound-var.rs:4:34 + --> $DIR/ice-123664-unexpected-bound-var.rs:4:27 | LL | const fn with_positive() {} - | ^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/ice-123664-unexpected-bound-var.rs:4:34 + --> $DIR/ice-123664-unexpected-bound-var.rs:4:27 | LL | const fn with_positive() {} - | ^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/traits/const-traits/issue-92111.stderr b/tests/ui/traits/const-traits/issue-92111.stderr index 805cc5370149b..51c6a22b43b3d 100644 --- a/tests/ui/traits/const-traits/issue-92111.stderr +++ b/tests/ui/traits/const-traits/issue-92111.stderr @@ -1,14 +1,14 @@ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/issue-92111.rs:20:22 + --> $DIR/issue-92111.rs:20:15 | LL | const fn a(t: T) {} - | ^^^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/issue-92111.rs:20:22 + --> $DIR/issue-92111.rs:20:15 | LL | const fn a(t: T) {} - | ^^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/traits/const-traits/item-bound-entailment-fails.stderr b/tests/ui/traits/const-traits/item-bound-entailment-fails.stderr index 3b3868c4bc845..054a8ac757794 100644 --- a/tests/ui/traits/const-traits/item-bound-entailment-fails.stderr +++ b/tests/ui/traits/const-traits/item-bound-entailment-fails.stderr @@ -17,7 +17,7 @@ note: required by a bound in `Foo::Assoc` --> $DIR/item-bound-entailment-fails.rs:6:20 | LL | type Assoc: ~const Bar - | ^^^^^^^^^^ required by this bound in `Foo::Assoc` + | ^^^^^^ required by this bound in `Foo::Assoc` error[E0277]: the trait bound `T: ~const Bar` is not satisfied --> $DIR/item-bound-entailment-fails.rs:25:21 @@ -29,7 +29,7 @@ note: required by a bound in `Foo::Assoc` --> $DIR/item-bound-entailment-fails.rs:6:20 | LL | type Assoc: ~const Bar - | ^^^^^^^^^^ required by this bound in `Foo::Assoc` + | ^^^^^^ required by this bound in `Foo::Assoc` error: aborting due to 2 previous errors; 1 warning emitted diff --git a/tests/ui/traits/const-traits/non-const-op-in-closure-in-const.stderr b/tests/ui/traits/const-traits/non-const-op-in-closure-in-const.stderr index 08a40fe65bfae..837effb7ca4cf 100644 --- a/tests/ui/traits/const-traits/non-const-op-in-closure-in-const.stderr +++ b/tests/ui/traits/const-traits/non-const-op-in-closure-in-const.stderr @@ -1,14 +1,14 @@ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/non-const-op-in-closure-in-const.rs:10:51 + --> $DIR/non-const-op-in-closure-in-const.rs:10:44 | LL | impl const Convert for A where B: ~const From { - | ^^^^^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/non-const-op-in-closure-in-const.rs:10:51 + --> $DIR/non-const-op-in-closure-in-const.rs:10:44 | LL | impl const Convert for A where B: ~const From { - | ^^^^^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/traits/const-traits/predicate-entailment-fails.stderr b/tests/ui/traits/const-traits/predicate-entailment-fails.stderr index 7cd48ef1d4883..c50009e9b8c49 100644 --- a/tests/ui/traits/const-traits/predicate-entailment-fails.stderr +++ b/tests/ui/traits/const-traits/predicate-entailment-fails.stderr @@ -14,7 +14,7 @@ LL | type Bar where T: ~const Bar; | ----------- definition of `Bar` from trait ... LL | type Bar = () where T: const Bar; - | ^^^^^^^^^ impl has extra requirement `T: const Bar` + | ^^^^^ impl has extra requirement `T: const Bar` error[E0276]: impl has stricter requirements than trait --> $DIR/predicate-entailment-fails.rs:18:26 @@ -23,7 +23,7 @@ LL | fn foo() where T: ~const Bar; | -------------------------------- definition of `foo` from trait ... LL | fn foo() where T: const Bar {} - | ^^^^^^^^^ impl has extra requirement `T: const Bar` + | ^^^^^ impl has extra requirement `T: const Bar` error[E0276]: impl has stricter requirements than trait --> $DIR/predicate-entailment-fails.rs:29:31 @@ -32,7 +32,7 @@ LL | type Bar where T: Bar; | ----------- definition of `Bar` from trait ... LL | type Bar = () where T: const Bar; - | ^^^^^^^^^ impl has extra requirement `T: const Bar` + | ^^^^^ impl has extra requirement `T: const Bar` error[E0276]: impl has stricter requirements than trait --> $DIR/predicate-entailment-fails.rs:32:26 @@ -41,7 +41,7 @@ LL | fn foo() where T: Bar; | ------------------------- definition of `foo` from trait ... LL | fn foo() where T: const Bar {} - | ^^^^^^^^^ impl has extra requirement `T: const Bar` + | ^^^^^ impl has extra requirement `T: const Bar` error[E0276]: impl has stricter requirements than trait --> $DIR/predicate-entailment-fails.rs:36:31 @@ -50,7 +50,7 @@ LL | type Bar where T: Bar; | ----------- definition of `Bar` from trait ... LL | type Bar = () where T: ~const Bar; - | ^^^^^^^^^^ impl has extra requirement `T: ~const Bar` + | ^^^^^^ impl has extra requirement `T: ~const Bar` error[E0276]: impl has stricter requirements than trait --> $DIR/predicate-entailment-fails.rs:39:26 @@ -59,7 +59,7 @@ LL | fn foo() where T: Bar; | ------------------------- definition of `foo` from trait ... LL | fn foo() where T: ~const Bar {} - | ^^^^^^^^^^ impl has extra requirement `T: ~const Bar` + | ^^^^^^ impl has extra requirement `T: ~const Bar` error: aborting due to 6 previous errors; 1 warning emitted diff --git a/tests/ui/traits/const-traits/super-traits-fail-2.nn.stderr b/tests/ui/traits/const-traits/super-traits-fail-2.nn.stderr index 6277966b08e9b..8de1bb07e908c 100644 --- a/tests/ui/traits/const-traits/super-traits-fail-2.nn.stderr +++ b/tests/ui/traits/const-traits/super-traits-fail-2.nn.stderr @@ -11,24 +11,24 @@ LL | trait Bar: ~const Foo {} | ^^^^^^^^^^^^^^^^^^^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-2.rs:12:19 + --> $DIR/super-traits-fail-2.rs:12:12 | LL | trait Bar: ~const Foo {} - | ^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-2.rs:12:19 + --> $DIR/super-traits-fail-2.rs:12:12 | LL | trait Bar: ~const Foo {} - | ^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-2.rs:12:19 + --> $DIR/super-traits-fail-2.rs:12:12 | LL | trait Bar: ~const Foo {} - | ^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/traits/const-traits/super-traits-fail-2.ny.stderr b/tests/ui/traits/const-traits/super-traits-fail-2.ny.stderr index 60660ecc2797d..82b306aeff6b1 100644 --- a/tests/ui/traits/const-traits/super-traits-fail-2.ny.stderr +++ b/tests/ui/traits/const-traits/super-traits-fail-2.ny.stderr @@ -1,38 +1,38 @@ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-2.rs:12:19 + --> $DIR/super-traits-fail-2.rs:12:12 | LL | trait Bar: ~const Foo {} - | ^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-2.rs:12:19 + --> $DIR/super-traits-fail-2.rs:12:12 | LL | trait Bar: ~const Foo {} - | ^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-2.rs:12:19 + --> $DIR/super-traits-fail-2.rs:12:12 | LL | trait Bar: ~const Foo {} - | ^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-2.rs:12:19 + --> $DIR/super-traits-fail-2.rs:12:12 | LL | trait Bar: ~const Foo {} - | ^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-2.rs:12:19 + --> $DIR/super-traits-fail-2.rs:12:12 | LL | trait Bar: ~const Foo {} - | ^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/traits/const-traits/super-traits-fail-3.nn.stderr b/tests/ui/traits/const-traits/super-traits-fail-3.nn.stderr index b39bf8d8e1588..1dd4a2ed5a5f7 100644 --- a/tests/ui/traits/const-traits/super-traits-fail-3.nn.stderr +++ b/tests/ui/traits/const-traits/super-traits-fail-3.nn.stderr @@ -11,38 +11,38 @@ LL | trait Bar: ~const Foo {} | ^^^^^^^^^^^^^^^^^^^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-3.rs:14:19 + --> $DIR/super-traits-fail-3.rs:14:12 | LL | trait Bar: ~const Foo {} - | ^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-3.rs:14:19 + --> $DIR/super-traits-fail-3.rs:14:12 | LL | trait Bar: ~const Foo {} - | ^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-3.rs:14:19 + --> $DIR/super-traits-fail-3.rs:14:12 | LL | trait Bar: ~const Foo {} - | ^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-3.rs:22:24 + --> $DIR/super-traits-fail-3.rs:22:17 | LL | const fn foo(x: &T) { - | ^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-3.rs:22:24 + --> $DIR/super-traits-fail-3.rs:22:17 | LL | const fn foo(x: &T) { - | ^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/traits/const-traits/super-traits-fail-3.ny.stderr b/tests/ui/traits/const-traits/super-traits-fail-3.ny.stderr index 187cd998d95a2..e619b8bd6babc 100644 --- a/tests/ui/traits/const-traits/super-traits-fail-3.ny.stderr +++ b/tests/ui/traits/const-traits/super-traits-fail-3.ny.stderr @@ -1,38 +1,38 @@ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-3.rs:14:19 + --> $DIR/super-traits-fail-3.rs:14:12 | LL | trait Bar: ~const Foo {} - | ^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-3.rs:14:19 + --> $DIR/super-traits-fail-3.rs:14:12 | LL | trait Bar: ~const Foo {} - | ^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-3.rs:14:19 + --> $DIR/super-traits-fail-3.rs:14:12 | LL | trait Bar: ~const Foo {} - | ^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-3.rs:14:19 + --> $DIR/super-traits-fail-3.rs:14:12 | LL | trait Bar: ~const Foo {} - | ^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-3.rs:14:19 + --> $DIR/super-traits-fail-3.rs:14:12 | LL | trait Bar: ~const Foo {} - | ^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/traits/const-traits/super-traits-fail-3.yn.stderr b/tests/ui/traits/const-traits/super-traits-fail-3.yn.stderr index b6747d10e83c9..0a36d40d93141 100644 --- a/tests/ui/traits/const-traits/super-traits-fail-3.yn.stderr +++ b/tests/ui/traits/const-traits/super-traits-fail-3.yn.stderr @@ -11,16 +11,16 @@ LL | trait Bar: ~const Foo {} | ^^^^^^^^^^^^^^^^^^^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-3.rs:22:24 + --> $DIR/super-traits-fail-3.rs:22:17 | LL | const fn foo(x: &T) { - | ^^^ + | ^^^^^^ error: `~const` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-3.rs:22:24 + --> $DIR/super-traits-fail-3.rs:22:17 | LL | const fn foo(x: &T) { - | ^^^ + | ^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` diff --git a/tests/ui/traits/const-traits/unsatisfied-const-trait-bound.stderr b/tests/ui/traits/const-traits/unsatisfied-const-trait-bound.stderr index e0cf062ad95e8..35f3019b6eee8 100644 --- a/tests/ui/traits/const-traits/unsatisfied-const-trait-bound.stderr +++ b/tests/ui/traits/const-traits/unsatisfied-const-trait-bound.stderr @@ -28,7 +28,7 @@ note: required by a bound in `require` --> $DIR/unsatisfied-const-trait-bound.rs:8:15 | LL | fn require() {} - | ^^^^^^^^^^^ required by this bound in `require` + | ^^^^^ required by this bound in `require` error: aborting due to 4 previous errors