diff --git a/compiler/rustc_trait_selection/src/traits/fulfill.rs b/compiler/rustc_trait_selection/src/traits/fulfill.rs index d840677f1ca8b..0a64e9752ede6 100644 --- a/compiler/rustc_trait_selection/src/traits/fulfill.rs +++ b/compiler/rustc_trait_selection/src/traits/fulfill.rs @@ -288,7 +288,8 @@ impl<'a, 'b, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'b, 'tcx> { let infcx = self.selcx.infcx(); - if obligation.predicate.has_projections() { + // Normalizing WellFormed predicates is not sound, see #100041 + if obligation.predicate.has_projections() && obligation.predicate.allow_normalization() { let mut obligations = Vec::new(); let predicate = crate::traits::project::try_normalize_with_depth_to( self.selcx, diff --git a/compiler/rustc_typeck/src/check/wfcheck.rs b/compiler/rustc_typeck/src/check/wfcheck.rs index ce42647c837a5..b55151ab3fbf0 100644 --- a/compiler/rustc_typeck/src/check/wfcheck.rs +++ b/compiler/rustc_typeck/src/check/wfcheck.rs @@ -991,7 +991,6 @@ fn check_associated_item( match item.kind { ty::AssocKind::Const => { let ty = tcx.type_of(item.def_id); - let ty = wfcx.normalize(span, Some(WellFormedLoc::Ty(item_id)), ty); wfcx.register_wf_obligation(span, loc, ty.into()); } ty::AssocKind::Fn => { @@ -1012,7 +1011,6 @@ fn check_associated_item( } if item.defaultness(tcx).has_value() { let ty = tcx.type_of(item.def_id); - let ty = wfcx.normalize(span, Some(WellFormedLoc::Ty(item_id)), ty); wfcx.register_wf_obligation(span, loc, ty.into()); } } @@ -1188,6 +1186,8 @@ fn check_item_type(tcx: TyCtxt<'_>, item_id: LocalDefId, ty_span: Span, allow_fo enter_wf_checking_ctxt(tcx, ty_span, item_id, |wfcx| { let ty = tcx.type_of(item_id); + wfcx.register_wf_obligation(ty_span, Some(WellFormedLoc::Ty(item_id)), ty.into()); + let item_ty = wfcx.normalize(ty_span, Some(WellFormedLoc::Ty(item_id)), ty); let mut forbid_unsized = true; @@ -1197,8 +1197,6 @@ fn check_item_type(tcx: TyCtxt<'_>, item_id: LocalDefId, ty_span: Span, allow_fo forbid_unsized = false; } } - - wfcx.register_wf_obligation(ty_span, Some(WellFormedLoc::Ty(item_id)), item_ty.into()); if forbid_unsized { wfcx.register_bound( traits::ObligationCause::new(ty_span, wfcx.body_id, traits::WellFormed(None)), @@ -1262,7 +1260,6 @@ fn check_impl<'tcx>( } None => { let self_ty = tcx.type_of(item.def_id); - let self_ty = wfcx.normalize(item.span, None, self_ty); wfcx.register_wf_obligation( ast_self_ty.span, Some(WellFormedLoc::Ty(item.hir_id().expect_owner())), @@ -1475,35 +1472,6 @@ fn check_fn_or_method<'tcx>( let tcx = wfcx.tcx(); let sig = tcx.liberate_late_bound_regions(def_id.to_def_id(), sig); - // Normalize the input and output types one at a time, using a different - // `WellFormedLoc` for each. We cannot call `normalize_associated_types` - // on the entire `FnSig`, since this would use the same `WellFormedLoc` - // for each type, preventing the HIR wf check from generating - // a nice error message. - let ty::FnSig { mut inputs_and_output, c_variadic, unsafety, abi } = sig; - inputs_and_output = tcx.mk_type_list(inputs_and_output.iter().enumerate().map(|(i, ty)| { - wfcx.normalize( - span, - Some(WellFormedLoc::Param { - function: def_id, - // Note that the `param_idx` of the output type is - // one greater than the index of the last input type. - param_idx: i.try_into().unwrap(), - }), - ty, - ) - })); - // Manually call `normalize_associated_types_in` on the other types - // in `FnSig`. This ensures that if the types of these fields - // ever change to include projections, we will start normalizing - // them automatically. - let sig = ty::FnSig { - inputs_and_output, - c_variadic: wfcx.normalize(span, None, c_variadic), - unsafety: wfcx.normalize(span, None, unsafety), - abi: wfcx.normalize(span, None, abi), - }; - for (i, (&input_ty, ty)) in iter::zip(sig.inputs(), hir_decl.inputs).enumerate() { wfcx.register_wf_obligation( ty.span, @@ -1886,7 +1854,6 @@ impl<'a, 'tcx> WfCheckingCtxt<'a, 'tcx> { .map(|field| { let def_id = self.tcx().hir().local_def_id(field.hir_id); let field_ty = self.tcx().type_of(def_id); - let field_ty = self.normalize(field.ty.span, None, field_ty); debug!("non_enum_variant: type of field {:?} is {:?}", field, field_ty); AdtField { ty: field_ty, span: field.ty.span, def_id } }) diff --git a/src/test/ui/associated-types/defaults-cyclic-fail-1.rs b/src/test/ui/associated-types/defaults-cyclic-fail-1.rs index 61ef013236e8d..2f21e4e49ad74 100644 --- a/src/test/ui/associated-types/defaults-cyclic-fail-1.rs +++ b/src/test/ui/associated-types/defaults-cyclic-fail-1.rs @@ -24,9 +24,7 @@ impl Tr for u32 { // ...but not in an impl that redefines one of the types. impl Tr for bool { type A = Box; - //~^ ERROR overflow evaluating the requirement `::B == _` } -// (the error is shown twice for some reason) impl Tr for usize { type B = &'static Self::A; diff --git a/src/test/ui/associated-types/defaults-cyclic-fail-1.stderr b/src/test/ui/associated-types/defaults-cyclic-fail-1.stderr index 008eddcb29dbc..f120652cee3f7 100644 --- a/src/test/ui/associated-types/defaults-cyclic-fail-1.stderr +++ b/src/test/ui/associated-types/defaults-cyclic-fail-1.stderr @@ -1,15 +1,9 @@ -error[E0275]: overflow evaluating the requirement `::B == _` - --> $DIR/defaults-cyclic-fail-1.rs:26:14 - | -LL | type A = Box; - | ^^^^^^^^^^^^ - error[E0275]: overflow evaluating the requirement `::A == _` - --> $DIR/defaults-cyclic-fail-1.rs:32:14 + --> $DIR/defaults-cyclic-fail-1.rs:30:14 | LL | type B = &'static Self::A; | ^^^^^^^^^^^^^^^^ -error: aborting due to 2 previous errors +error: aborting due to previous error For more information about this error, try `rustc --explain E0275`. diff --git a/src/test/ui/associated-types/defaults-cyclic-fail-2.rs b/src/test/ui/associated-types/defaults-cyclic-fail-2.rs index e91c9f2d29a82..e717f726faf5c 100644 --- a/src/test/ui/associated-types/defaults-cyclic-fail-2.rs +++ b/src/test/ui/associated-types/defaults-cyclic-fail-2.rs @@ -25,9 +25,7 @@ impl Tr for u32 { impl Tr for bool { type A = Box; - //~^ ERROR overflow evaluating the requirement `::B == _` } -// (the error is shown twice for some reason) impl Tr for usize { type B = &'static Self::A; diff --git a/src/test/ui/associated-types/defaults-cyclic-fail-2.stderr b/src/test/ui/associated-types/defaults-cyclic-fail-2.stderr index d0fbab077153f..f3d4afac4ce7e 100644 --- a/src/test/ui/associated-types/defaults-cyclic-fail-2.stderr +++ b/src/test/ui/associated-types/defaults-cyclic-fail-2.stderr @@ -1,15 +1,9 @@ -error[E0275]: overflow evaluating the requirement `::B == _` - --> $DIR/defaults-cyclic-fail-2.rs:27:14 - | -LL | type A = Box; - | ^^^^^^^^^^^^ - error[E0275]: overflow evaluating the requirement `::A == _` - --> $DIR/defaults-cyclic-fail-2.rs:33:14 + --> $DIR/defaults-cyclic-fail-2.rs:31:14 | LL | type B = &'static Self::A; | ^^^^^^^^^^^^^^^^ -error: aborting due to 2 previous errors +error: aborting due to previous error For more information about this error, try `rustc --explain E0275`. diff --git a/src/test/ui/associated-types/issue-100041.rs b/src/test/ui/associated-types/issue-100041.rs new file mode 100644 index 0000000000000..dc79603479aa6 --- /dev/null +++ b/src/test/ui/associated-types/issue-100041.rs @@ -0,0 +1,23 @@ +trait Wf { + type Ty; +} + +impl Wf for T { + type Ty = (); +} + +const _: as Wf>::Ty = (); +//~^ ERROR the size for values of type `str` cannot be known at compilation time + +struct Foo { + x: as Wf>::Ty, + //~^ ERROR the size for values of type `str` cannot be known at compilation time +} + +fn foo(x: as Wf>::Ty) {} +//~^ ERROR the size for values of type `str` cannot be known at compilation time + +fn bar() -> as Wf>::Ty {} +//~^ ERROR the size for values of type `str` cannot be known at compilation time + +fn main() {} diff --git a/src/test/ui/associated-types/issue-100041.stderr b/src/test/ui/associated-types/issue-100041.stderr new file mode 100644 index 0000000000000..f48d9a0d947c6 --- /dev/null +++ b/src/test/ui/associated-types/issue-100041.stderr @@ -0,0 +1,55 @@ +error[E0277]: the size for values of type `str` cannot be known at compilation time + --> $DIR/issue-100041.rs:9:11 + | +LL | const _: as Wf>::Ty = (); + | ^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `str` +note: required by a bound in `Vec` + --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL + | +LL | pub struct Vec { + | ^ required by this bound in `Vec` + +error[E0277]: the size for values of type `str` cannot be known at compilation time + --> $DIR/issue-100041.rs:13:9 + | +LL | x: as Wf>::Ty, + | ^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `str` +note: required by a bound in `Vec` + --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL + | +LL | pub struct Vec { + | ^ required by this bound in `Vec` + +error[E0277]: the size for values of type `str` cannot be known at compilation time + --> $DIR/issue-100041.rs:17:12 + | +LL | fn foo(x: as Wf>::Ty) {} + | ^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `str` +note: required by a bound in `Vec` + --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL + | +LL | pub struct Vec { + | ^ required by this bound in `Vec` + +error[E0277]: the size for values of type `str` cannot be known at compilation time + --> $DIR/issue-100041.rs:20:13 + | +LL | fn bar() -> as Wf>::Ty {} + | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `str` +note: required by a bound in `Vec` + --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL + | +LL | pub struct Vec { + | ^ required by this bound in `Vec` + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/associated-types/issue-59324.rs b/src/test/ui/associated-types/issue-59324.rs index 9e68e9e77515b..21c12651f6e28 100644 --- a/src/test/ui/associated-types/issue-59324.rs +++ b/src/test/ui/associated-types/issue-59324.rs @@ -22,5 +22,6 @@ pub trait ThriftService: fn with_factory(factory: dyn ThriftService<()>) {} //~^ ERROR the trait bound `(): Foo` is not satisfied +//~| ERROR the trait bound `(): NotFoo` is not satisfied fn main() {} diff --git a/src/test/ui/associated-types/issue-59324.stderr b/src/test/ui/associated-types/issue-59324.stderr index 62cf1f37a7713..2078250f4048f 100644 --- a/src/test/ui/associated-types/issue-59324.stderr +++ b/src/test/ui/associated-types/issue-59324.stderr @@ -50,6 +50,18 @@ error[E0277]: the trait bound `(): Foo` is not satisfied LL | fn with_factory(factory: dyn ThriftService<()>) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `()` +error[E0277]: the trait bound `(): NotFoo` is not satisfied + --> $DIR/issue-59324.rs:23:29 + | +LL | fn with_factory(factory: dyn ThriftService<()>) {} + | ^^^^^^^^^^^^^^^^^^^^^ the trait `NotFoo` is not implemented for `()` + | +note: required by a bound in `Foo` + --> $DIR/issue-59324.rs:3:16 + | +LL | pub trait Foo: NotFoo { + | ^^^^^^ required by this bound in `Foo` + error[E0277]: the trait bound `Bug: Foo` is not satisfied --> $DIR/issue-59324.rs:16:5 | @@ -65,6 +77,6 @@ help: consider further restricting this bound LL | pub trait ThriftService: | +++++ -error: aborting due to 5 previous errors +error: aborting due to 6 previous errors For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/consts/const-size_of-cycle.stderr b/src/test/ui/consts/const-size_of-cycle.stderr index 46f02ce8a4533..53d4b375812a1 100644 --- a/src/test/ui/consts/const-size_of-cycle.stderr +++ b/src/test/ui/consts/const-size_of-cycle.stderr @@ -1,10 +1,13 @@ -error[E0391]: cycle detected when evaluating type-level constant +error[E0391]: cycle detected when const-evaluating + checking `Foo::bytes::{constant#0}` --> $DIR/const-size_of-cycle.rs:4:17 | LL | bytes: [u8; std::mem::size_of::()] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | -note: ...which requires const-evaluating + checking `Foo::bytes::{constant#0}`... + = note: ...which requires computing layout of `Foo`... + = note: ...which requires computing layout of `[u8; _]`... + = note: ...which requires normalizing `[u8; _]`... +note: ...which requires evaluating type-level constant... --> $DIR/const-size_of-cycle.rs:4:17 | LL | bytes: [u8; std::mem::size_of::()] @@ -14,15 +17,12 @@ note: ...which requires const-evaluating + checking `Foo::bytes::{constant#0}`.. | LL | bytes: [u8; std::mem::size_of::()] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: ...which requires computing layout of `Foo`... - = note: ...which requires computing layout of `[u8; _]`... - = note: ...which requires normalizing `[u8; _]`... - = note: ...which again requires evaluating type-level constant, completing the cycle -note: cycle used when checking that `Foo` is well-formed - --> $DIR/const-size_of-cycle.rs:3:1 + = note: ...which again requires const-evaluating + checking `Foo::bytes::{constant#0}`, completing the cycle +note: cycle used when evaluating type-level constant + --> $DIR/const-size_of-cycle.rs:4:17 | -LL | struct Foo { - | ^^^^^^^^^^ +LL | bytes: [u8; std::mem::size_of::()] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/consts/issue-44415.rs b/src/test/ui/consts/issue-44415.rs index d93b451be453a..570249e583e1e 100644 --- a/src/test/ui/consts/issue-44415.rs +++ b/src/test/ui/consts/issue-44415.rs @@ -4,7 +4,7 @@ use std::intrinsics; struct Foo { bytes: [u8; unsafe { intrinsics::size_of::() }], - //~^ ERROR cycle detected when evaluating type-level constant + //~^ ERROR cycle detected when const-evaluating + checking `Foo::bytes::{constant#0}` x: usize, } diff --git a/src/test/ui/consts/issue-44415.stderr b/src/test/ui/consts/issue-44415.stderr index 57f94f8c6ab52..9d5520bcafccc 100644 --- a/src/test/ui/consts/issue-44415.stderr +++ b/src/test/ui/consts/issue-44415.stderr @@ -1,10 +1,13 @@ -error[E0391]: cycle detected when evaluating type-level constant +error[E0391]: cycle detected when const-evaluating + checking `Foo::bytes::{constant#0}` --> $DIR/issue-44415.rs:6:17 | LL | bytes: [u8; unsafe { intrinsics::size_of::() }], | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | -note: ...which requires const-evaluating + checking `Foo::bytes::{constant#0}`... + = note: ...which requires computing layout of `Foo`... + = note: ...which requires computing layout of `[u8; _]`... + = note: ...which requires normalizing `[u8; _]`... +note: ...which requires evaluating type-level constant... --> $DIR/issue-44415.rs:6:17 | LL | bytes: [u8; unsafe { intrinsics::size_of::() }], @@ -14,15 +17,12 @@ note: ...which requires const-evaluating + checking `Foo::bytes::{constant#0}`.. | LL | bytes: [u8; unsafe { intrinsics::size_of::() }], | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: ...which requires computing layout of `Foo`... - = note: ...which requires computing layout of `[u8; _]`... - = note: ...which requires normalizing `[u8; _]`... - = note: ...which again requires evaluating type-level constant, completing the cycle -note: cycle used when checking that `Foo` is well-formed - --> $DIR/issue-44415.rs:5:1 + = note: ...which again requires const-evaluating + checking `Foo::bytes::{constant#0}`, completing the cycle +note: cycle used when evaluating type-level constant + --> $DIR/issue-44415.rs:6:17 | -LL | struct Foo { - | ^^^^^^^^^^ +LL | bytes: [u8; unsafe { intrinsics::size_of::() }], + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/fn/implied-bounds-unnorm-associated-type-2.rs b/src/test/ui/fn/implied-bounds-unnorm-associated-type-2.rs index 5d924555625cd..68d330902c286 100644 --- a/src/test/ui/fn/implied-bounds-unnorm-associated-type-2.rs +++ b/src/test/ui/fn/implied-bounds-unnorm-associated-type-2.rs @@ -9,6 +9,7 @@ impl Trait for T { } fn f<'a, 'b>(_: <&'a &'b () as Trait>::Type) +//~^ ERROR in type `&'a &'b ()`, reference has a longer lifetime than the data it references where 'a: 'a, 'b: 'b, @@ -17,7 +18,6 @@ where fn g<'a, 'b>() { f::<'a, 'b>(()); - //~^ ERROR lifetime may not live long enough } fn main() {} diff --git a/src/test/ui/fn/implied-bounds-unnorm-associated-type-2.stderr b/src/test/ui/fn/implied-bounds-unnorm-associated-type-2.stderr index 0c3df04eabcd2..11d5de45734d5 100644 --- a/src/test/ui/fn/implied-bounds-unnorm-associated-type-2.stderr +++ b/src/test/ui/fn/implied-bounds-unnorm-associated-type-2.stderr @@ -1,17 +1,20 @@ -error: lifetime may not live long enough - --> $DIR/implied-bounds-unnorm-associated-type-2.rs:19:5 +error[E0491]: in type `&'a &'b ()`, reference has a longer lifetime than the data it references + --> $DIR/implied-bounds-unnorm-associated-type-2.rs:11:17 | -LL | fn g<'a, 'b>() { - | -- -- lifetime `'b` defined here - | | - | lifetime `'a` defined here -LL | f::<'a, 'b>(()); - | ^^^^^^^^^^^^^^^ requires that `'b` must outlive `'a` +LL | fn f<'a, 'b>(_: <&'a &'b () as Trait>::Type) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: consider adding the following bound: `'b: 'a` - = note: requirement occurs because of a function pointer to `f` - = note: the function `f` is invariant over the parameter `'a` - = help: see for more information about variance +note: the pointer is valid for the lifetime `'a` as defined here + --> $DIR/implied-bounds-unnorm-associated-type-2.rs:11:6 + | +LL | fn f<'a, 'b>(_: <&'a &'b () as Trait>::Type) + | ^^ +note: but the referenced data is only valid for the lifetime `'b` as defined here + --> $DIR/implied-bounds-unnorm-associated-type-2.rs:11:10 + | +LL | fn f<'a, 'b>(_: <&'a &'b () as Trait>::Type) + | ^^ error: aborting due to previous error +For more information about this error, try `rustc --explain E0491`. diff --git a/src/test/ui/fn/implied-bounds-unnorm-associated-type.rs b/src/test/ui/fn/implied-bounds-unnorm-associated-type.rs index d58d25036c5bb..12d798f966fb2 100644 --- a/src/test/ui/fn/implied-bounds-unnorm-associated-type.rs +++ b/src/test/ui/fn/implied-bounds-unnorm-associated-type.rs @@ -11,6 +11,7 @@ impl Trait for T { } fn f<'a, 'b>(s: &'b str, _: <&'a &'b () as Trait>::Type) -> &'a str { + //~^ ERROR in type `&'a &'b ()`, reference has a longer lifetime than the data it references s } @@ -18,6 +19,5 @@ fn main() { let x = String::from("Hello World!"); let y = f(&x, ()); drop(x); - //~^ ERROR cannot move out of `x` because it is borrowed println!("{}", y); } diff --git a/src/test/ui/fn/implied-bounds-unnorm-associated-type.stderr b/src/test/ui/fn/implied-bounds-unnorm-associated-type.stderr index e35f46e4439a9..56d0ae422c8ab 100644 --- a/src/test/ui/fn/implied-bounds-unnorm-associated-type.stderr +++ b/src/test/ui/fn/implied-bounds-unnorm-associated-type.stderr @@ -1,14 +1,20 @@ -error[E0505]: cannot move out of `x` because it is borrowed - --> $DIR/implied-bounds-unnorm-associated-type.rs:20:10 - | -LL | let y = f(&x, ()); - | -- borrow of `x` occurs here -LL | drop(x); - | ^ move out of `x` occurs here -LL | -LL | println!("{}", y); - | - borrow later used here +error[E0491]: in type `&'a &'b ()`, reference has a longer lifetime than the data it references + --> $DIR/implied-bounds-unnorm-associated-type.rs:13:29 + | +LL | fn f<'a, 'b>(s: &'b str, _: <&'a &'b () as Trait>::Type) -> &'a str { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: the pointer is valid for the lifetime `'a` as defined here + --> $DIR/implied-bounds-unnorm-associated-type.rs:13:6 + | +LL | fn f<'a, 'b>(s: &'b str, _: <&'a &'b () as Trait>::Type) -> &'a str { + | ^^ +note: but the referenced data is only valid for the lifetime `'b` as defined here + --> $DIR/implied-bounds-unnorm-associated-type.rs:13:10 + | +LL | fn f<'a, 'b>(s: &'b str, _: <&'a &'b () as Trait>::Type) -> &'a str { + | ^^ error: aborting due to previous error -For more information about this error, try `rustc --explain E0505`. +For more information about this error, try `rustc --explain E0491`. diff --git a/src/test/ui/issues/issue-20831-debruijn.rs b/src/test/ui/issues/issue-20831-debruijn.rs index 20d980763ea9c..d88f8920643b6 100644 --- a/src/test/ui/issues/issue-20831-debruijn.rs +++ b/src/test/ui/issues/issue-20831-debruijn.rs @@ -28,6 +28,7 @@ impl<'a> Publisher<'a> for MyStruct<'a> { fn subscribe(&mut self, t : Box::Output> + 'a>) { // Not obvious, but there is an implicit lifetime here -------^ //~^^ ERROR cannot infer + //~| ERROR cannot infer // // The fact that `Publisher` is using an implicit lifetime is // what was causing the debruijn accounting to be off, so diff --git a/src/test/ui/issues/issue-20831-debruijn.stderr b/src/test/ui/issues/issue-20831-debruijn.stderr index ef62dece83640..9bc95f222a9bc 100644 --- a/src/test/ui/issues/issue-20831-debruijn.stderr +++ b/src/test/ui/issues/issue-20831-debruijn.stderr @@ -4,7 +4,7 @@ error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` d LL | / fn subscribe(&mut self, t : Box::Output> + 'a>) { LL | | // Not obvious, but there is an implicit lifetime here -------^ LL | | -LL | | // +LL | | ... | LL | | self.sub = t; LL | | } @@ -26,7 +26,7 @@ note: ...so that the types are compatible LL | / fn subscribe(&mut self, t : Box::Output> + 'a>) { LL | | // Not obvious, but there is an implicit lifetime here -------^ LL | | -LL | | // +LL | | ... | LL | | self.sub = t; LL | | } @@ -34,6 +34,30 @@ LL | | } = note: expected ` as Publisher<'_>>` found ` as Publisher<'_>>` -error: aborting due to previous error +error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements + --> $DIR/issue-20831-debruijn.rs:28:33 + | +LL | fn subscribe(&mut self, t : Box::Output> + 'a>) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: first, the lifetime cannot outlive the anonymous lifetime defined here... + --> $DIR/issue-20831-debruijn.rs:28:58 + | +LL | fn subscribe(&mut self, t : Box::Output> + 'a>) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +note: ...but the lifetime must also be valid for the lifetime `'a` as defined here... + --> $DIR/issue-20831-debruijn.rs:26:6 + | +LL | impl<'a> Publisher<'a> for MyStruct<'a> { + | ^^ +note: ...so that the types are compatible + --> $DIR/issue-20831-debruijn.rs:28:33 + | +LL | fn subscribe(&mut self, t : Box::Output> + 'a>) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: expected ` as Publisher<'_>>` + found ` as Publisher<'_>>` + +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/issues/issue-35570.rs b/src/test/ui/issues/issue-35570.rs index a2b0222d4f395..42bdb423f8f5c 100644 --- a/src/test/ui/issues/issue-35570.rs +++ b/src/test/ui/issues/issue-35570.rs @@ -7,7 +7,6 @@ trait Trait2<'a> { fn _ice(param: Box Trait1<<() as Trait2<'a>>::Ty>>) { //~^ ERROR the trait bound `for<'a> (): Trait2<'a>` is not satisfied - //~| ERROR the trait bound `for<'a> (): Trait2<'a>` is not satisfied let _e: (usize, usize) = unsafe{mem::transmute(param)}; } diff --git a/src/test/ui/issues/issue-35570.stderr b/src/test/ui/issues/issue-35570.stderr index ebc40f6786fd0..e6f00445318ae 100644 --- a/src/test/ui/issues/issue-35570.stderr +++ b/src/test/ui/issues/issue-35570.stderr @@ -3,17 +3,10 @@ error[E0277]: the trait bound `for<'a> (): Trait2<'a>` is not satisfied | LL | / fn _ice(param: Box Trait1<<() as Trait2<'a>>::Ty>>) { LL | | -LL | | LL | | let _e: (usize, usize) = unsafe{mem::transmute(param)}; LL | | } | |_^ the trait `for<'a> Trait2<'a>` is not implemented for `()` -error[E0277]: the trait bound `for<'a> (): Trait2<'a>` is not satisfied - --> $DIR/issue-35570.rs:8:40 - | -LL | fn _ice(param: Box Trait1<<() as Trait2<'a>>::Ty>>) { - | ^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'a> Trait2<'a>` is not implemented for `()` - -error: aborting due to 2 previous errors +error: aborting due to previous error For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/nll/normalization-bounds-error.rs b/src/test/ui/nll/normalization-bounds-error.rs index b6cfcd98732b4..5fd982f0dd986 100644 --- a/src/test/ui/nll/normalization-bounds-error.rs +++ b/src/test/ui/nll/normalization-bounds-error.rs @@ -11,5 +11,6 @@ impl<'a, 'd: 'a> Visitor<'d> for &'a () { fn visit_seq<'d, 'a: 'd>() -> <&'a () as Visitor<'d>>::Value {} //~^ ERROR +//~| ERROR cannot infer an appropriate lifetime for lifetime parameter `'d` due to conflicting requirements fn main() {} diff --git a/src/test/ui/nll/normalization-bounds-error.stderr b/src/test/ui/nll/normalization-bounds-error.stderr index 6abe53127c3fb..d13ad945b6139 100644 --- a/src/test/ui/nll/normalization-bounds-error.stderr +++ b/src/test/ui/nll/normalization-bounds-error.stderr @@ -22,6 +22,30 @@ LL | fn visit_seq<'d, 'a: 'd>() -> <&'a () as Visitor<'d>>::Value {} = note: expected `Visitor<'d>` found `Visitor<'_>` -error: aborting due to previous error +error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'d` due to conflicting requirements + --> $DIR/normalization-bounds-error.rs:12:31 + | +LL | fn visit_seq<'d, 'a: 'd>() -> <&'a () as Visitor<'d>>::Value {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: first, the lifetime cannot outlive the lifetime `'d` as defined here... + --> $DIR/normalization-bounds-error.rs:12:14 + | +LL | fn visit_seq<'d, 'a: 'd>() -> <&'a () as Visitor<'d>>::Value {} + | ^^ +note: ...but the lifetime must also be valid for the lifetime `'a` as defined here... + --> $DIR/normalization-bounds-error.rs:12:18 + | +LL | fn visit_seq<'d, 'a: 'd>() -> <&'a () as Visitor<'d>>::Value {} + | ^^ +note: ...so that the types are compatible + --> $DIR/normalization-bounds-error.rs:12:31 + | +LL | fn visit_seq<'d, 'a: 'd>() -> <&'a () as Visitor<'d>>::Value {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: expected `Visitor<'d>` + found `Visitor<'_>` + +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/regions/regions-implied-bounds-projection-gap-hr-1.rs b/src/test/ui/regions/regions-implied-bounds-projection-gap-hr-1.rs index 1106352037a08..1f4e01ff7309d 100644 --- a/src/test/ui/regions/regions-implied-bounds-projection-gap-hr-1.rs +++ b/src/test/ui/regions/regions-implied-bounds-projection-gap-hr-1.rs @@ -8,7 +8,7 @@ // regions as opaque entities, just like projections without escaping // regions. -trait Trait1 { } +trait Trait1 {} trait Trait2<'a, 'b> { type Foo; @@ -18,10 +18,10 @@ trait Trait2<'a, 'b> { // this argument `t` is not automatically considered well-formed, // since for it to be WF, we would need to know that `'y: 'x`, but we // do not infer that. -fn callee<'x, 'y, T>(t: &'x dyn for<'z> Trait1< >::Foo >) - //~^ ERROR the trait bound `for<'z> T: Trait2<'y, 'z>` is not satisfied - //~| ERROR the trait bound `for<'z> T: Trait2<'y, 'z>` is not satisfied +fn callee<'x, 'y, T>(t: &'x dyn for<'z> Trait1<>::Foo>) +//~^ ERROR the trait bound `for<'z> T: Trait2<'y, 'z>` is not satisfied +//~| ERROR the trait bound `for<'z> T: Trait2<'y, 'z>` is not satisfied { } -fn main() { } +fn main() {} diff --git a/src/test/ui/regions/regions-implied-bounds-projection-gap-hr-1.stderr b/src/test/ui/regions/regions-implied-bounds-projection-gap-hr-1.stderr index 66f592c34dd07..10811df2a05f4 100644 --- a/src/test/ui/regions/regions-implied-bounds-projection-gap-hr-1.stderr +++ b/src/test/ui/regions/regions-implied-bounds-projection-gap-hr-1.stderr @@ -1,7 +1,7 @@ error[E0277]: the trait bound `for<'z> T: Trait2<'y, 'z>` is not satisfied --> $DIR/regions-implied-bounds-projection-gap-hr-1.rs:21:1 | -LL | / fn callee<'x, 'y, T>(t: &'x dyn for<'z> Trait1< >::Foo >) +LL | / fn callee<'x, 'y, T>(t: &'x dyn for<'z> Trait1<>::Foo>) LL | | LL | | LL | | { @@ -10,18 +10,18 @@ LL | | } | help: consider restricting type parameter `T` | -LL | fn callee<'x, 'y, T: for<'z> Trait2<'y, 'z>>(t: &'x dyn for<'z> Trait1< >::Foo >) +LL | fn callee<'x, 'y, T: for<'z> Trait2<'y, 'z>>(t: &'x dyn for<'z> Trait1<>::Foo>) | ++++++++++++++++++++++++ error[E0277]: the trait bound `for<'z> T: Trait2<'y, 'z>` is not satisfied - --> $DIR/regions-implied-bounds-projection-gap-hr-1.rs:21:49 + --> $DIR/regions-implied-bounds-projection-gap-hr-1.rs:21:48 | -LL | fn callee<'x, 'y, T>(t: &'x dyn for<'z> Trait1< >::Foo >) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'z> Trait2<'y, 'z>` is not implemented for `T` +LL | fn callee<'x, 'y, T>(t: &'x dyn for<'z> Trait1<>::Foo>) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'z> Trait2<'y, 'z>` is not implemented for `T` | help: consider restricting type parameter `T` | -LL | fn callee<'x, 'y, T: for<'z> Trait2<'y, 'z>>(t: &'x dyn for<'z> Trait1< >::Foo >) +LL | fn callee<'x, 'y, T: for<'z> Trait2<'y, 'z>>(t: &'x dyn for<'z> Trait1<>::Foo>) | ++++++++++++++++++++++++ error: aborting due to 2 previous errors diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-enum-not-wf.rs b/src/test/ui/rfc-2093-infer-outlives/regions-enum-not-wf.rs index 8b491ee4e303f..5438b0539bfef 100644 --- a/src/test/ui/rfc-2093-infer-outlives/regions-enum-not-wf.rs +++ b/src/test/ui/rfc-2093-infer-outlives/regions-enum-not-wf.rs @@ -14,12 +14,16 @@ where type RequireOutlives<'a, T> = >::Out; enum Ref1<'a, T> { - Ref1Variant1(RequireOutlives<'a, T>), //~ ERROR the parameter type `T` may not live long enough + Ref1Variant1(RequireOutlives<'a, T>), + //~^ the parameter type `T` may not live long enough [E0309] + //~| the parameter type `T` may not live long enough [E0309] } enum Ref2<'a, T> { Ref2Variant1, - Ref2Variant2(isize, RequireOutlives<'a, T>), //~ ERROR the parameter type `T` may not live long enough + Ref2Variant2(isize, RequireOutlives<'a, T>), + //~^ the parameter type `T` may not live long enough [E0309] + //~| the parameter type `T` may not live long enough [E0309] } enum RefOk<'a, T: 'a> { @@ -32,6 +36,7 @@ enum RefIndirect<'a, T> { } enum RefDouble<'a, 'b, T> { + //~^ the parameter type `T` may not live long enough [E0309] RefDoubleVariant1(&'a RequireOutlives<'b, T>), //~^ the parameter type `T` may not live long enough [E0309] } diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-enum-not-wf.stderr b/src/test/ui/rfc-2093-infer-outlives/regions-enum-not-wf.stderr index 2c660b2850097..73c542da5d539 100644 --- a/src/test/ui/rfc-2093-infer-outlives/regions-enum-not-wf.stderr +++ b/src/test/ui/rfc-2093-infer-outlives/regions-enum-not-wf.stderr @@ -10,7 +10,18 @@ LL | enum Ref1<'a, T: 'a> { | ++++ error[E0309]: the parameter type `T` may not live long enough - --> $DIR/regions-enum-not-wf.rs:22:25 + --> $DIR/regions-enum-not-wf.rs:17:18 + | +LL | Ref1Variant1(RequireOutlives<'a, T>), + | ^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | enum Ref1<'a, T: 'a> { + | ++++ + +error[E0309]: the parameter type `T` may not live long enough + --> $DIR/regions-enum-not-wf.rs:24:25 | LL | Ref2Variant2(isize, RequireOutlives<'a, T>), | ^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds @@ -21,7 +32,33 @@ LL | enum Ref2<'a, T: 'a> { | ++++ error[E0309]: the parameter type `T` may not live long enough - --> $DIR/regions-enum-not-wf.rs:35:23 + --> $DIR/regions-enum-not-wf.rs:24:25 + | +LL | Ref2Variant2(isize, RequireOutlives<'a, T>), + | ^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | enum Ref2<'a, T: 'a> { + | ++++ + +error[E0309]: the parameter type `T` may not live long enough + --> $DIR/regions-enum-not-wf.rs:38:1 + | +LL | / enum RefDouble<'a, 'b, T> { +LL | | +LL | | RefDoubleVariant1(&'a RequireOutlives<'b, T>), +LL | | +LL | | } + | |_^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | enum RefDouble<'a, 'b, T: 'b> { + | ++++ + +error[E0309]: the parameter type `T` may not live long enough + --> $DIR/regions-enum-not-wf.rs:40:23 | LL | RefDoubleVariant1(&'a RequireOutlives<'b, T>), | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds @@ -31,6 +68,6 @@ help: consider adding an explicit lifetime bound... LL | enum RefDouble<'a, 'b, T: 'b> { | ++++ -error: aborting due to 3 previous errors +error: aborting due to 6 previous errors For more information about this error, try `rustc --explain E0309`. diff --git a/src/test/ui/traits/issue-82830.stderr b/src/test/ui/traits/issue-82830.stderr index 6a597a402156f..82a3b9bcb406d 100644 --- a/src/test/ui/traits/issue-82830.stderr +++ b/src/test/ui/traits/issue-82830.stderr @@ -4,11 +4,11 @@ error[E0275]: overflow evaluating the requirement `P: Sized` LL | t: MaybeBox

, | ^^^^^^^^^^^ | -note: required for `P` to implement `A>` - --> $DIR/issue-82830.rs:10:12 +note: required by a bound in `A` + --> $DIR/issue-82830.rs:1:9 | -LL | impl A for P { - | ^^^^^^^ ^ +LL | trait A { + | ^ required by this bound in `A` error: aborting due to previous error diff --git a/src/test/ui/unsized/unsized-enum2.stderr b/src/test/ui/unsized/unsized-enum2.stderr index 00b80327c9b77..9eef87bb79e01 100644 --- a/src/test/ui/unsized/unsized-enum2.stderr +++ b/src/test/ui/unsized/unsized-enum2.stderr @@ -242,78 +242,6 @@ help: the `Box` type always has a statically known size and allocates its conten LL | VP{u: isize, x: Box}, | ++++ + -error[E0277]: the size for values of type `[i8]` cannot be known at compilation time - --> $DIR/unsized-enum2.rs:63:8 - | -LL | VQ(<&'static [i8] as Deref>::Target), - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `[i8]` - = note: no field of an enum variant may have a dynamically sized type - = help: change the field's type to have a statically known size -help: borrowed types always have a statically known size - | -LL | VQ(&<&'static [i8] as Deref>::Target), - | + -help: the `Box` type always has a statically known size and allocates its contents in the heap - | -LL | VQ(Box<<&'static [i8] as Deref>::Target>), - | ++++ + - -error[E0277]: the size for values of type `[char]` cannot be known at compilation time - --> $DIR/unsized-enum2.rs:65:11 - | -LL | VR{x: <&'static [char] as Deref>::Target}, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `[char]` - = note: no field of an enum variant may have a dynamically sized type - = help: change the field's type to have a statically known size -help: borrowed types always have a statically known size - | -LL | VR{x: &<&'static [char] as Deref>::Target}, - | + -help: the `Box` type always has a statically known size and allocates its contents in the heap - | -LL | VR{x: Box<<&'static [char] as Deref>::Target>}, - | ++++ + - -error[E0277]: the size for values of type `[f64]` cannot be known at compilation time - --> $DIR/unsized-enum2.rs:67:15 - | -LL | VS(isize, <&'static [f64] as Deref>::Target), - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `[f64]` - = note: no field of an enum variant may have a dynamically sized type - = help: change the field's type to have a statically known size -help: borrowed types always have a statically known size - | -LL | VS(isize, &<&'static [f64] as Deref>::Target), - | + -help: the `Box` type always has a statically known size and allocates its contents in the heap - | -LL | VS(isize, Box<<&'static [f64] as Deref>::Target>), - | ++++ + - -error[E0277]: the size for values of type `[i32]` cannot be known at compilation time - --> $DIR/unsized-enum2.rs:69:21 - | -LL | VT{u: isize, x: <&'static [i32] as Deref>::Target}, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `[i32]` - = note: no field of an enum variant may have a dynamically sized type - = help: change the field's type to have a statically known size -help: borrowed types always have a statically known size - | -LL | VT{u: isize, x: &<&'static [i32] as Deref>::Target}, - | + -help: the `Box` type always has a statically known size and allocates its contents in the heap - | -LL | VT{u: isize, x: Box<<&'static [i32] as Deref>::Target>}, - | ++++ + - error[E0277]: the size for values of type `(dyn PathHelper1 + 'static)` cannot be known at compilation time --> $DIR/unsized-enum2.rs:43:8 | @@ -406,6 +334,78 @@ help: the `Box` type always has a statically known size and allocates its conten LL | VL{u: isize, x: Box}, | ++++ + +error[E0277]: the size for values of type `[i8]` cannot be known at compilation time + --> $DIR/unsized-enum2.rs:63:8 + | +LL | VQ(<&'static [i8] as Deref>::Target), + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `[i8]` + = note: no field of an enum variant may have a dynamically sized type + = help: change the field's type to have a statically known size +help: borrowed types always have a statically known size + | +LL | VQ(&<&'static [i8] as Deref>::Target), + | + +help: the `Box` type always has a statically known size and allocates its contents in the heap + | +LL | VQ(Box<<&'static [i8] as Deref>::Target>), + | ++++ + + +error[E0277]: the size for values of type `[char]` cannot be known at compilation time + --> $DIR/unsized-enum2.rs:65:11 + | +LL | VR{x: <&'static [char] as Deref>::Target}, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `[char]` + = note: no field of an enum variant may have a dynamically sized type + = help: change the field's type to have a statically known size +help: borrowed types always have a statically known size + | +LL | VR{x: &<&'static [char] as Deref>::Target}, + | + +help: the `Box` type always has a statically known size and allocates its contents in the heap + | +LL | VR{x: Box<<&'static [char] as Deref>::Target>}, + | ++++ + + +error[E0277]: the size for values of type `[f64]` cannot be known at compilation time + --> $DIR/unsized-enum2.rs:67:15 + | +LL | VS(isize, <&'static [f64] as Deref>::Target), + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `[f64]` + = note: no field of an enum variant may have a dynamically sized type + = help: change the field's type to have a statically known size +help: borrowed types always have a statically known size + | +LL | VS(isize, &<&'static [f64] as Deref>::Target), + | + +help: the `Box` type always has a statically known size and allocates its contents in the heap + | +LL | VS(isize, Box<<&'static [f64] as Deref>::Target>), + | ++++ + + +error[E0277]: the size for values of type `[i32]` cannot be known at compilation time + --> $DIR/unsized-enum2.rs:69:21 + | +LL | VT{u: isize, x: <&'static [i32] as Deref>::Target}, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `[i32]` + = note: no field of an enum variant may have a dynamically sized type + = help: change the field's type to have a statically known size +help: borrowed types always have a statically known size + | +LL | VT{u: isize, x: &<&'static [i32] as Deref>::Target}, + | + +help: the `Box` type always has a statically known size and allocates its contents in the heap + | +LL | VT{u: isize, x: Box<<&'static [i32] as Deref>::Target>}, + | ++++ + + error: aborting due to 20 previous errors For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/wf/hir-wf-check-erase-regions.rs b/src/test/ui/wf/hir-wf-check-erase-regions.rs index 2b4b480df0acf..ba46e7dbb012a 100644 --- a/src/test/ui/wf/hir-wf-check-erase-regions.rs +++ b/src/test/ui/wf/hir-wf-check-erase-regions.rs @@ -7,7 +7,7 @@ impl<'a, T, const N: usize> IntoIterator for &'a Table { type IntoIter = std::iter::Flatten>; //~ ERROR `&T` is not an iterator type Item = &'a T; - fn into_iter(self) -> Self::IntoIter { //~ ERROR `&T` is not an iterator + fn into_iter(self) -> Self::IntoIter { unimplemented!() } } diff --git a/src/test/ui/wf/hir-wf-check-erase-regions.stderr b/src/test/ui/wf/hir-wf-check-erase-regions.stderr index b04588c571615..594c37f483d98 100644 --- a/src/test/ui/wf/hir-wf-check-erase-regions.stderr +++ b/src/test/ui/wf/hir-wf-check-erase-regions.stderr @@ -13,21 +13,6 @@ note: required by a bound in `Flatten` LL | pub struct Flatten> { | ^^^^^^^^^^^^ required by this bound in `Flatten` -error[E0277]: `&T` is not an iterator - --> $DIR/hir-wf-check-erase-regions.rs:10:27 - | -LL | fn into_iter(self) -> Self::IntoIter { - | ^^^^^^^^^^^^^^ `&T` is not an iterator - | - = help: the trait `Iterator` is not implemented for `&T` - = help: the trait `Iterator` is implemented for `&mut I` - = note: required for `&T` to implement `IntoIterator` -note: required by a bound in `Flatten` - --> $SRC_DIR/core/src/iter/adapters/flatten.rs:LL:COL - | -LL | pub struct Flatten> { - | ^^^^^^^^^^^^ required by this bound in `Flatten` - -error: aborting due to 2 previous errors +error: aborting due to previous error For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/wf/wf-packed-on-proj-of-type-as-unimpl-trait.stderr b/src/test/ui/wf/wf-packed-on-proj-of-type-as-unimpl-trait.stderr index e460cdcd3f3e5..fb0f5345c1d44 100644 --- a/src/test/ui/wf/wf-packed-on-proj-of-type-as-unimpl-trait.stderr +++ b/src/test/ui/wf/wf-packed-on-proj-of-type-as-unimpl-trait.stderr @@ -1,8 +1,8 @@ error[E0277]: the trait bound `DefaultAllocator: Allocator` is not satisfied - --> $DIR/wf-packed-on-proj-of-type-as-unimpl-trait.rs:28:12 + --> $DIR/wf-packed-on-proj-of-type-as-unimpl-trait.rs:28:19 | LL | struct Foo(Matrix<::Buffer>); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Allocator` is not implemented for `DefaultAllocator` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Allocator` is not implemented for `DefaultAllocator` error: aborting due to previous error