1
Fork 0

Point at arguments or output when fn obligations come from them, or ident when they don't

This commit is contained in:
Esteban Küber 2020-01-18 14:57:56 -08:00
parent 994e5e7465
commit fca5c64abd
42 changed files with 261 additions and 392 deletions

View file

@ -219,9 +219,17 @@ fn check_associated_item(
ty::AssocKind::Method => { ty::AssocKind::Method => {
let sig = fcx.tcx.fn_sig(item.def_id); let sig = fcx.tcx.fn_sig(item.def_id);
let sig = fcx.normalize_associated_types_in(span, &sig); let sig = fcx.normalize_associated_types_in(span, &sig);
check_fn_or_method(tcx, fcx, span, sig, item.def_id, &mut implied_bounds); let hir_sig = sig_if_method.expect("bad signature for method");
let sig_if_method = sig_if_method.expect("bad signature for method"); check_fn_or_method(
check_method_receiver(fcx, sig_if_method, &item, self_ty); tcx,
fcx,
item.ident.span,
sig,
hir_sig,
item.def_id,
&mut implied_bounds,
);
check_method_receiver(fcx, hir_sig, &item, self_ty);
} }
ty::AssocKind::Type => { ty::AssocKind::Type => {
if item.defaultness.has_value() { if item.defaultness.has_value() {
@ -364,7 +372,11 @@ fn check_item_fn(tcx: TyCtxt<'_>, item: &hir::Item<'_>) {
let sig = fcx.tcx.fn_sig(def_id); let sig = fcx.tcx.fn_sig(def_id);
let sig = fcx.normalize_associated_types_in(item.span, &sig); let sig = fcx.normalize_associated_types_in(item.span, &sig);
let mut implied_bounds = vec![]; let mut implied_bounds = vec![];
check_fn_or_method(tcx, fcx, item.span, sig, def_id, &mut implied_bounds); let hir_sig = match &item.kind {
ItemKind::Fn(sig, ..) => sig,
_ => bug!("expected `ItemKind::Fn`, found `{:?}`", item.kind),
};
check_fn_or_method(tcx, fcx, item.ident.span, sig, hir_sig, def_id, &mut implied_bounds);
implied_bounds implied_bounds
}) })
} }
@ -609,18 +621,23 @@ fn check_fn_or_method<'fcx, 'tcx>(
fcx: &FnCtxt<'fcx, 'tcx>, fcx: &FnCtxt<'fcx, 'tcx>,
span: Span, span: Span,
sig: ty::PolyFnSig<'tcx>, sig: ty::PolyFnSig<'tcx>,
hir_sig: &hir::FnSig<'_>,
def_id: DefId, def_id: DefId,
implied_bounds: &mut Vec<Ty<'tcx>>, implied_bounds: &mut Vec<Ty<'tcx>>,
) { ) {
let sig = fcx.normalize_associated_types_in(span, &sig); let sig = fcx.normalize_associated_types_in(span, &sig);
let sig = fcx.tcx.liberate_late_bound_regions(def_id, &sig); let sig = fcx.tcx.liberate_late_bound_regions(def_id, &sig);
for input_ty in sig.inputs() { for (input_ty, span) in sig.inputs().iter().zip(hir_sig.decl.inputs.iter().map(|t| t.span)) {
fcx.register_wf_obligation(&input_ty, span, ObligationCauseCode::MiscObligation); fcx.register_wf_obligation(&input_ty, span, ObligationCauseCode::MiscObligation);
} }
implied_bounds.extend(sig.inputs()); implied_bounds.extend(sig.inputs());
fcx.register_wf_obligation(sig.output(), span, ObligationCauseCode::ReturnType); fcx.register_wf_obligation(
sig.output(),
hir_sig.decl.output.span(),
ObligationCauseCode::ReturnType,
);
// FIXME(#25759) return types should not be implied bounds // FIXME(#25759) return types should not be implied bounds
implied_bounds.push(sig.output()); implied_bounds.push(sig.output());

View file

@ -9,74 +9,47 @@ LL | impl Case1 for S1 {
error[E0277]: `<<T as Case1>::C as std::iter::Iterator>::Item` is not an iterator error[E0277]: `<<T as Case1>::C as std::iter::Iterator>::Item` is not an iterator
--> $DIR/bad-bounds-on-assoc-in-trait.rs:36:1 --> $DIR/bad-bounds-on-assoc-in-trait.rs:36:1
| |
LL | fn assume_case1<T: Case1>() { LL | fn assume_case1<T: Case1>() {
| ^ - help: consider further restricting the associated type: `where <<T as Case1>::C as std::iter::Iterator>::Item: std::iter::Iterator` | ^^^^^^^^^^^^ - help: consider further restricting the associated type: `where <<T as Case1>::C as std::iter::Iterator>::Item: std::iter::Iterator`
| _| | |
| | | `<<T as Case1>::C as std::iter::Iterator>::Item` is not an iterator
LL | |
LL | |
LL | |
... |
LL | | assert_c::<_, _, _, T::C>();
LL | | }
| |_^ `<<T as Case1>::C as std::iter::Iterator>::Item` is not an iterator
| |
= help: the trait `std::iter::Iterator` is not implemented for `<<T as Case1>::C as std::iter::Iterator>::Item` = help: the trait `std::iter::Iterator` is not implemented for `<<T as Case1>::C as std::iter::Iterator>::Item`
error[E0277]: `<<T as Case1>::C as std::iter::Iterator>::Item` cannot be sent between threads safely error[E0277]: `<<T as Case1>::C as std::iter::Iterator>::Item` cannot be sent between threads safely
--> $DIR/bad-bounds-on-assoc-in-trait.rs:36:1 --> $DIR/bad-bounds-on-assoc-in-trait.rs:36:1
| |
LL | trait Case1 { LL | trait Case1 {
| ----------- required by `Case1` | ----------- required by `Case1`
... ...
LL | fn assume_case1<T: Case1>() { LL | fn assume_case1<T: Case1>() {
| ^ - help: consider further restricting the associated type: `where <<T as Case1>::C as std::iter::Iterator>::Item: std::marker::Send` | ^^^^^^^^^^^^ - help: consider further restricting the associated type: `where <<T as Case1>::C as std::iter::Iterator>::Item: std::marker::Send`
| _| | |
| | | `<<T as Case1>::C as std::iter::Iterator>::Item` cannot be sent between threads safely
LL | |
LL | |
LL | |
... |
LL | | assert_c::<_, _, _, T::C>();
LL | | }
| |_^ `<<T as Case1>::C as std::iter::Iterator>::Item` cannot be sent between threads safely
| |
= help: the trait `std::marker::Send` is not implemented for `<<T as Case1>::C as std::iter::Iterator>::Item` = help: the trait `std::marker::Send` is not implemented for `<<T as Case1>::C as std::iter::Iterator>::Item`
error[E0277]: `<<T as Case1>::C as std::iter::Iterator>::Item` cannot be shared between threads safely error[E0277]: `<<T as Case1>::C as std::iter::Iterator>::Item` cannot be shared between threads safely
--> $DIR/bad-bounds-on-assoc-in-trait.rs:36:1 --> $DIR/bad-bounds-on-assoc-in-trait.rs:36:1
| |
LL | trait Case1 { LL | trait Case1 {
| ----------- required by `Case1` | ----------- required by `Case1`
... ...
LL | fn assume_case1<T: Case1>() { LL | fn assume_case1<T: Case1>() {
| ^ - help: consider further restricting the associated type: `where <<T as Case1>::C as std::iter::Iterator>::Item: std::marker::Sync` | ^^^^^^^^^^^^ - help: consider further restricting the associated type: `where <<T as Case1>::C as std::iter::Iterator>::Item: std::marker::Sync`
| _| | |
| | | `<<T as Case1>::C as std::iter::Iterator>::Item` cannot be shared between threads safely
LL | |
LL | |
LL | |
... |
LL | | assert_c::<_, _, _, T::C>();
LL | | }
| |_^ `<<T as Case1>::C as std::iter::Iterator>::Item` cannot be shared between threads safely
| |
= help: the trait `std::marker::Sync` is not implemented for `<<T as Case1>::C as std::iter::Iterator>::Item` = help: the trait `std::marker::Sync` is not implemented for `<<T as Case1>::C as std::iter::Iterator>::Item`
error[E0277]: `<_ as Lam<&'a u8>>::App` doesn't implement `std::fmt::Debug` error[E0277]: `<_ as Lam<&'a u8>>::App` doesn't implement `std::fmt::Debug`
--> $DIR/bad-bounds-on-assoc-in-trait.rs:36:1 --> $DIR/bad-bounds-on-assoc-in-trait.rs:36:1
| |
LL | trait Case1 { LL | trait Case1 {
| ----------- required by `Case1` | ----------- required by `Case1`
... ...
LL | / fn assume_case1<T: Case1>() { LL | fn assume_case1<T: Case1>() {
LL | | | ^^^^^^^^^^^^ `<_ as Lam<&'a u8>>::App` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
LL | |
LL | |
... |
LL | | assert_c::<_, _, _, T::C>();
LL | | }
| |_^ `<_ as Lam<&'a u8>>::App` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
| |
= help: the trait `for<'a> std::fmt::Debug` is not implemented for `<_ as Lam<&'a u8>>::App` = help: the trait `for<'a> std::fmt::Debug` is not implemented for `<_ as Lam<&'a u8>>::App`

View file

@ -1,17 +1,13 @@
error[E0277]: `F` cannot be sent between threads safely error[E0277]: `F` cannot be sent between threads safely
--> $DIR/closure-bounds-cant-promote-superkind-in-struct.rs:5:1 --> $DIR/closure-bounds-cant-promote-superkind-in-struct.rs:5:22
| |
LL | struct X<F> where F: FnOnce() + 'static + Send { LL | struct X<F> where F: FnOnce() + 'static + Send {
| ---------------------------------------------- required by `X` | ---------------------------------------------- required by `X`
... ...
LL | fn foo<F>(blk: F) -> X<F> where F: FnOnce() + 'static { LL | fn foo<F>(blk: F) -> X<F> where F: FnOnce() + 'static {
| ^ - help: consider further restricting type parameter `F`: `, F: std::marker::Send` | ^^^^ - help: consider further restricting type parameter `F`: `, F: std::marker::Send`
| _| | |
| | | `F` cannot be sent between threads safely
LL | |
LL | | return X { field: blk };
LL | | }
| |_^ `F` cannot be sent between threads safely
| |
= help: the trait `std::marker::Send` is not implemented for `F` = help: the trait `std::marker::Send` is not implemented for `F`

View file

@ -1,11 +1,11 @@
error[E0038]: the trait `Trait` cannot be made into an object error[E0038]: the trait `Trait` cannot be made into an object
--> $DIR/E0038.rs:5:1 --> $DIR/E0038.rs:5:16
| |
LL | fn foo(&self) -> Self; LL | fn foo(&self) -> Self;
| --- method `foo` references the `Self` type in its parameters or return type | --- method `foo` references the `Self` type in its parameters or return type
... ...
LL | fn call_foo(x: Box<dyn Trait>) { LL | fn call_foo(x: Box<dyn Trait>) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait` cannot be made into an object | ^^^^^^^^^^^^^^ the trait `Trait` cannot be made into an object
error: aborting due to previous error error: aborting due to previous error

View file

@ -1,37 +1,37 @@
error[E0038]: the trait `NonObjectSafe1` cannot be made into an object error[E0038]: the trait `NonObjectSafe1` cannot be made into an object
--> $DIR/feature-gate-object_safe_for_dispatch.rs:18:1 --> $DIR/feature-gate-object_safe_for_dispatch.rs:18:38
| |
LL | fn takes_non_object_safe_ref<T>(obj: &dyn NonObjectSafe1) { LL | fn takes_non_object_safe_ref<T>(obj: &dyn NonObjectSafe1) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `NonObjectSafe1` cannot be made into an object | ^^^^^^^^^^^^^^^^^^^ the trait `NonObjectSafe1` cannot be made into an object
| |
= note: the trait cannot require that `Self : Sized` = note: the trait cannot require that `Self : Sized`
error[E0038]: the trait `NonObjectSafe2` cannot be made into an object error[E0038]: the trait `NonObjectSafe2` cannot be made into an object
--> $DIR/feature-gate-object_safe_for_dispatch.rs:22:1 --> $DIR/feature-gate-object_safe_for_dispatch.rs:22:36
| |
LL | fn static_fn() {} LL | fn static_fn() {}
| --------- associated function `static_fn` has no `self` parameter | --------- associated function `static_fn` has no `self` parameter
... ...
LL | fn return_non_object_safe_ref() -> &'static dyn NonObjectSafe2 { LL | fn return_non_object_safe_ref() -> &'static dyn NonObjectSafe2 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `NonObjectSafe2` cannot be made into an object | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `NonObjectSafe2` cannot be made into an object
error[E0038]: the trait `NonObjectSafe3` cannot be made into an object error[E0038]: the trait `NonObjectSafe3` cannot be made into an object
--> $DIR/feature-gate-object_safe_for_dispatch.rs:27:1 --> $DIR/feature-gate-object_safe_for_dispatch.rs:27:35
| |
LL | fn foo<T>(&self); LL | fn foo<T>(&self);
| --- method `foo` has generic type parameters | --- method `foo` has generic type parameters
... ...
LL | fn takes_non_object_safe_box(obj: Box<dyn NonObjectSafe3>) { LL | fn takes_non_object_safe_box(obj: Box<dyn NonObjectSafe3>) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `NonObjectSafe3` cannot be made into an object | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `NonObjectSafe3` cannot be made into an object
error[E0038]: the trait `NonObjectSafe4` cannot be made into an object error[E0038]: the trait `NonObjectSafe4` cannot be made into an object
--> $DIR/feature-gate-object_safe_for_dispatch.rs:31:1 --> $DIR/feature-gate-object_safe_for_dispatch.rs:31:35
| |
LL | fn foo(&self, &Self); LL | fn foo(&self, &Self);
| --- method `foo` references the `Self` type in its parameters or return type | --- method `foo` references the `Self` type in its parameters or return type
... ...
LL | fn return_non_object_safe_rc() -> std::rc::Rc<dyn NonObjectSafe4> { LL | fn return_non_object_safe_rc() -> std::rc::Rc<dyn NonObjectSafe4> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `NonObjectSafe4` cannot be made into an object | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `NonObjectSafe4` cannot be made into an object
error[E0038]: the trait `NonObjectSafe1` cannot be made into an object error[E0038]: the trait `NonObjectSafe1` cannot be made into an object
--> $DIR/feature-gate-object_safe_for_dispatch.rs:38:6 --> $DIR/feature-gate-object_safe_for_dispatch.rs:38:6

View file

@ -25,16 +25,13 @@ LL | type Item<'a> where T: 'a = <std::slice::Iter<'a, T> as Iterator>::Item
= note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
error[E0271]: type mismatch resolving `for<'a> <<std::vec::Vec<T> as Iterable>::Iter<'a> as std::iter::Iterator>::Item == <std::vec::Vec<T> as Iterable>::Item<'a>` error[E0271]: type mismatch resolving `for<'a> <<std::vec::Vec<T> as Iterable>::Iter<'a> as std::iter::Iterator>::Item == <std::vec::Vec<T> as Iterable>::Item<'a>`
--> $DIR/iterable.rs:19:5 --> $DIR/iterable.rs:19:30
| |
LL | trait Iterable { LL | trait Iterable {
| -------------- required by `Iterable` | -------------- required by `Iterable`
... ...
LL | / fn iter<'a>(&'a self) -> Self::Iter<'a> { LL | fn iter<'a>(&'a self) -> Self::Iter<'a> {
LL | | | ^^^^^^^^^^^^^^ expected associated type, found reference
LL | | self.iter()
LL | | }
| |_____^ expected associated type, found reference
| |
= note: expected associated type `<std::vec::Vec<T> as Iterable>::Item<'_>` = note: expected associated type `<std::vec::Vec<T> as Iterable>::Item<'_>`
found reference `&T` found reference `&T`
@ -42,16 +39,13 @@ LL | | }
= note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
error[E0271]: type mismatch resolving `for<'a> <<[T] as Iterable>::Iter<'a> as std::iter::Iterator>::Item == <[T] as Iterable>::Item<'a>` error[E0271]: type mismatch resolving `for<'a> <<[T] as Iterable>::Iter<'a> as std::iter::Iterator>::Item == <[T] as Iterable>::Item<'a>`
--> $DIR/iterable.rs:31:5 --> $DIR/iterable.rs:31:30
| |
LL | trait Iterable { LL | trait Iterable {
| -------------- required by `Iterable` | -------------- required by `Iterable`
... ...
LL | / fn iter<'a>(&'a self) -> Self::Iter<'a> { LL | fn iter<'a>(&'a self) -> Self::Iter<'a> {
LL | | | ^^^^^^^^^^^^^^ expected associated type, found reference
LL | | self.iter()
LL | | }
| |_____^ expected associated type, found reference
| |
= note: expected associated type `<[T] as Iterable>::Item<'_>` = note: expected associated type `<[T] as Iterable>::Item<'_>`
found reference `&T` found reference `&T`

View file

@ -1,10 +1,8 @@
error[E0277]: the size for values of type `dyn for<'r> std::ops::Fn(&'r isize) -> isize` cannot be known at compilation time error[E0277]: the size for values of type `dyn for<'r> std::ops::Fn(&'r isize) -> isize` cannot be known at compilation time
--> $DIR/issue-18919.rs:3:1 --> $DIR/issue-18919.rs:3:15
| |
LL | / fn ho_func(f: Option<FuncType>) { LL | fn ho_func(f: Option<FuncType>) {
LL | | | ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
LL | | }
| |_^ doesn't have a size known at compile-time
| |
= help: the trait `std::marker::Sized` is not implemented for `dyn for<'r> std::ops::Fn(&'r isize) -> isize` = help: the trait `std::marker::Sized` is not implemented for `dyn for<'r> std::ops::Fn(&'r isize) -> isize`
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait> = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>

View file

@ -1,11 +1,11 @@
error[E0038]: the trait `Bar` cannot be made into an object error[E0038]: the trait `Bar` cannot be made into an object
--> $DIR/issue-18959.rs:11:1 --> $DIR/issue-18959.rs:11:11
| |
LL | pub trait Foo { fn foo<T>(&self, ext_thing: &T); } LL | pub trait Foo { fn foo<T>(&self, ext_thing: &T); }
| --- method `foo` has generic type parameters | --- method `foo` has generic type parameters
... ...
LL | fn foo(b: &dyn Bar) { LL | fn foo(b: &dyn Bar) {
| ^^^^^^^^^^^^^^^^^^^ the trait `Bar` cannot be made into an object | ^^^^^^^^ the trait `Bar` cannot be made into an object
error: aborting due to previous error error: aborting due to previous error

View file

@ -1,16 +1,14 @@
error[E0277]: the size for values of type `Self` cannot be known at compilation time error[E0277]: the size for values of type `Self` cannot be known at compilation time
--> $DIR/issue-20005.rs:8:5 --> $DIR/issue-20005.rs:8:8
| |
LL | trait From<Src> { LL | trait From<Src> {
| --------------- required by `From` | --------------- required by `From`
... ...
LL | / fn to<Dst>( LL | fn to<Dst>(
LL | | self | ^^ doesn't have a size known at compile-time
LL | | ) -> <Dst as From<Self>>::Result where Dst: From<Self> { LL | self
| | - help: consider further restricting `Self`: `, Self: std::marker::Sized` LL | ) -> <Dst as From<Self>>::Result where Dst: From<Self> {
LL | | From::from(self) | - help: consider further restricting `Self`: `, Self: std::marker::Sized`
LL | | }
| |_____^ doesn't have a size known at compile-time
| |
= help: the trait `std::marker::Sized` is not implemented for `Self` = help: the trait `std::marker::Sized` is not implemented for `Self`
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait> = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>

View file

@ -151,16 +151,13 @@ LL | | }
= note: required because of the requirements on the impl of `Foo` for `NoData<T>` = note: required because of the requirements on the impl of `Foo` for `NoData<T>`
error[E0275]: overflow evaluating the requirement `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>: Foo` error[E0275]: overflow evaluating the requirement `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>: Foo`
--> $DIR/issue-20413.rs:10:3 --> $DIR/issue-20413.rs:10:6
| |
LL | trait Foo { LL | trait Foo {
| --------- required by `Foo` | --------- required by `Foo`
... ...
LL | / fn answer(self) { LL | fn answer(self) {
LL | | | ^^^^^^
LL | | let val: NoData<T> = NoData;
LL | | }
| |___^
| |
= help: consider adding a `#![recursion_limit="256"]` attribute to your crate = help: consider adding a `#![recursion_limit="256"]` attribute to your crate
= note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` = note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`

View file

@ -1,8 +1,8 @@
error[E0277]: the size for values of type `[i32]` cannot be known at compilation time error[E0277]: the size for values of type `[i32]` cannot be known at compilation time
--> $DIR/issue-20433.rs:6:5 --> $DIR/issue-20433.rs:6:18
| |
LL | fn iceman(c: Vec<[i32]>) {} LL | fn iceman(c: Vec<[i32]>) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | ^^^^^^^^^^ doesn't have a size known at compile-time
| |
= help: the trait `std::marker::Sized` is not implemented for `[i32]` = help: the trait `std::marker::Sized` is not implemented for `[i32]`
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait> = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>

View file

@ -61,16 +61,10 @@ LL | | }
| |_____^ | |_____^
error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements
--> $DIR/issue-20831-debruijn.rs:28:5 --> $DIR/issue-20831-debruijn.rs:28:33
| |
LL | / fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) { LL | fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
LL | | // Not obvious, but there is an implicit lifetime here -------^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | |
LL | |
... |
LL | | self.sub = t;
LL | | }
| |_____^
| |
note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the method body at 28:5... note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the method body at 28:5...
--> $DIR/issue-20831-debruijn.rs:28:5 --> $DIR/issue-20831-debruijn.rs:28:5
@ -89,30 +83,18 @@ note: ...but the lifetime must also be valid for the lifetime `'a` as defined on
LL | impl<'a> Publisher<'a> for MyStruct<'a> { LL | impl<'a> Publisher<'a> for MyStruct<'a> {
| ^^ | ^^
note: ...so that the types are compatible note: ...so that the types are compatible
--> $DIR/issue-20831-debruijn.rs:28:5 --> $DIR/issue-20831-debruijn.rs:28:33
| |
LL | / fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) { LL | fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
LL | | // Not obvious, but there is an implicit lifetime here -------^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | |
LL | |
... |
LL | | self.sub = t;
LL | | }
| |_____^
= note: expected `Publisher<'_>` = note: expected `Publisher<'_>`
found `Publisher<'_>` found `Publisher<'_>`
error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements
--> $DIR/issue-20831-debruijn.rs:28:5 --> $DIR/issue-20831-debruijn.rs:28:33
| |
LL | / fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) { LL | fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
LL | | // Not obvious, but there is an implicit lifetime here -------^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | |
LL | |
... |
LL | | self.sub = t;
LL | | }
| |_____^
| |
note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the method body at 28:5... note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the method body at 28:5...
--> $DIR/issue-20831-debruijn.rs:28:5 --> $DIR/issue-20831-debruijn.rs:28:5
@ -131,16 +113,10 @@ note: ...but the lifetime must also be valid for the lifetime `'a` as defined on
LL | impl<'a> Publisher<'a> for MyStruct<'a> { LL | impl<'a> Publisher<'a> for MyStruct<'a> {
| ^^ | ^^
note: ...so that the types are compatible note: ...so that the types are compatible
--> $DIR/issue-20831-debruijn.rs:28:5 --> $DIR/issue-20831-debruijn.rs:28:33
| |
LL | / fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) { LL | fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
LL | | // Not obvious, but there is an implicit lifetime here -------^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | |
LL | |
... |
LL | | self.sub = t;
LL | | }
| |_____^
= note: expected `Publisher<'_>` = note: expected `Publisher<'_>`
found `Publisher<'_>` found `Publisher<'_>`

View file

@ -1,17 +1,11 @@
error[E0283]: type annotations needed error[E0283]: type annotations needed
--> $DIR/issue-21974.rs:10:1 --> $DIR/issue-21974.rs:10:4
| |
LL | trait Foo { LL | trait Foo {
| --------- required by `Foo` | --------- required by `Foo`
... ...
LL | / fn foo<'a,'b,T>(x: &'a T, y: &'b T) LL | fn foo<'a,'b,T>(x: &'a T, y: &'b T)
LL | | where &'a T : Foo, | ^^^ cannot infer type for reference `&'a T`
LL | | &'b T : Foo
LL | | {
LL | | x.foo();
LL | | y.foo();
LL | | }
| |_^ cannot infer type for reference `&'a T`
| |
= note: cannot resolve `&'a T: Foo` = note: cannot resolve `&'a T: Foo`

View file

@ -1,8 +1,8 @@
error[E0277]: the size for values of type `(dyn std::ops::Fn() + 'static)` cannot be known at compilation time error[E0277]: the size for values of type `(dyn std::ops::Fn() + 'static)` cannot be known at compilation time
--> $DIR/issue-23281.rs:4:5 --> $DIR/issue-23281.rs:4:27
| |
LL | pub fn function(funs: Vec<dyn Fn() -> ()>) {} LL | pub fn function(funs: Vec<dyn Fn() -> ()>) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
| |
= help: the trait `std::marker::Sized` is not implemented for `(dyn std::ops::Fn() + 'static)` = help: the trait `std::marker::Sized` is not implemented for `(dyn std::ops::Fn() + 'static)`
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait> = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>

View file

@ -1,11 +1,11 @@
error[E0271]: type mismatch resolving `<<T as Trait>::A as MultiDispatch<i32>>::O == T` error[E0271]: type mismatch resolving `<<T as Trait>::A as MultiDispatch<i32>>::O == T`
--> $DIR/issue-24204.rs:14:1 --> $DIR/issue-24204.rs:14:4
| |
LL | trait Trait: Sized { LL | trait Trait: Sized {
| ------------------ required by `Trait` | ------------------ required by `Trait`
... ...
LL | fn test<T: Trait<B=i32>>(b: i32) -> T where T::A: MultiDispatch<i32> { T::new(b) } LL | fn test<T: Trait<B=i32>>(b: i32) -> T where T::A: MultiDispatch<i32> { T::new(b) }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected type parameter `T`, found associated type | ^^^^ expected type parameter `T`, found associated type
| |
= note: expected type parameter `T` = note: expected type parameter `T`
found associated type `<<T as Trait>::A as MultiDispatch<i32>>::O` found associated type `<<T as Trait>::A as MultiDispatch<i32>>::O`

View file

@ -1,8 +1,8 @@
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/issue-27942.rs:5:5 --> $DIR/issue-27942.rs:5:25
| |
LL | fn select(&self) -> BufferViewHandle<R>; LL | fn select(&self) -> BufferViewHandle<R>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch | ^^^^^^^^^^^^^^^^^^^ lifetime mismatch
| |
= note: expected type `Resources<'_>` = note: expected type `Resources<'_>`
found type `Resources<'a>` found type `Resources<'a>`
@ -18,10 +18,10 @@ LL | pub trait Buffer<'a, R: Resources<'a>> {
| ^^ | ^^
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/issue-27942.rs:5:5 --> $DIR/issue-27942.rs:5:25
| |
LL | fn select(&self) -> BufferViewHandle<R>; LL | fn select(&self) -> BufferViewHandle<R>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch | ^^^^^^^^^^^^^^^^^^^ lifetime mismatch
| |
= note: expected type `Resources<'_>` = note: expected type `Resources<'_>`
found type `Resources<'a>` found type `Resources<'a>`

View file

@ -13,87 +13,69 @@ LL | foo: &'static T
| ^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^
error[E0309]: the parameter type `K` may not live long enough error[E0309]: the parameter type `K` may not live long enough
--> $DIR/lifetime-doesnt-live-long-enough.rs:24:5 --> $DIR/lifetime-doesnt-live-long-enough.rs:24:8
| |
LL | trait X<K>: Sized { LL | trait X<K>: Sized {
| - help: consider adding an explicit lifetime bound `K: 'a`... | - help: consider adding an explicit lifetime bound `K: 'a`...
LL | fn foo<'a, L: X<&'a Nested<K>>>(); LL | fn foo<'a, L: X<&'a Nested<K>>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^
| |
note: ...so that the reference type `&'a Nested<K>` does not outlive the data it points at note: ...so that the reference type `&'a Nested<K>` does not outlive the data it points at
--> $DIR/lifetime-doesnt-live-long-enough.rs:24:5 --> $DIR/lifetime-doesnt-live-long-enough.rs:24:8
| |
LL | fn foo<'a, L: X<&'a Nested<K>>>(); LL | fn foo<'a, L: X<&'a Nested<K>>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^
error[E0309]: the parameter type `Self` may not live long enough error[E0309]: the parameter type `Self` may not live long enough
--> $DIR/lifetime-doesnt-live-long-enough.rs:28:5 --> $DIR/lifetime-doesnt-live-long-enough.rs:28:8
| |
LL | fn bar<'a, L: X<&'a Nested<Self>>>(); LL | fn bar<'a, L: X<&'a Nested<Self>>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^
| |
= help: consider adding an explicit lifetime bound `Self: 'a`... = help: consider adding an explicit lifetime bound `Self: 'a`...
note: ...so that the reference type `&'a Nested<Self>` does not outlive the data it points at note: ...so that the reference type `&'a Nested<Self>` does not outlive the data it points at
--> $DIR/lifetime-doesnt-live-long-enough.rs:28:5 --> $DIR/lifetime-doesnt-live-long-enough.rs:28:8
| |
LL | fn bar<'a, L: X<&'a Nested<Self>>>(); LL | fn bar<'a, L: X<&'a Nested<Self>>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^
error[E0309]: the parameter type `L` may not live long enough error[E0309]: the parameter type `L` may not live long enough
--> $DIR/lifetime-doesnt-live-long-enough.rs:32:5 --> $DIR/lifetime-doesnt-live-long-enough.rs:32:8
| |
LL | fn baz<'a, L, M: X<&'a Nested<L>>>() { LL | fn baz<'a, L, M: X<&'a Nested<L>>>() {
| ^ - help: consider adding an explicit lifetime bound `L: 'a`... | ^^^ - help: consider adding an explicit lifetime bound `L: 'a`...
| _____|
| |
LL | |
LL | | }
| |_____^
| |
note: ...so that the reference type `&'a Nested<L>` does not outlive the data it points at note: ...so that the reference type `&'a Nested<L>` does not outlive the data it points at
--> $DIR/lifetime-doesnt-live-long-enough.rs:32:5 --> $DIR/lifetime-doesnt-live-long-enough.rs:32:8
| |
LL | / fn baz<'a, L, M: X<&'a Nested<L>>>() { LL | fn baz<'a, L, M: X<&'a Nested<L>>>() {
LL | | | ^^^
LL | | }
| |_____^
error[E0309]: the parameter type `K` may not live long enough error[E0309]: the parameter type `K` may not live long enough
--> $DIR/lifetime-doesnt-live-long-enough.rs:41:5 --> $DIR/lifetime-doesnt-live-long-enough.rs:41:8
| |
LL | impl<K> Nested<K> { LL | impl<K> Nested<K> {
| - help: consider adding an explicit lifetime bound `K: 'a`... | - help: consider adding an explicit lifetime bound `K: 'a`...
LL | / fn generic_in_parent<'a, L: X<&'a Nested<K>>>() { LL | fn generic_in_parent<'a, L: X<&'a Nested<K>>>() {
LL | | | ^^^^^^^^^^^^^^^^^
LL | | }
| |_____^
| |
note: ...so that the reference type `&'a Nested<K>` does not outlive the data it points at note: ...so that the reference type `&'a Nested<K>` does not outlive the data it points at
--> $DIR/lifetime-doesnt-live-long-enough.rs:41:5 --> $DIR/lifetime-doesnt-live-long-enough.rs:41:8
| |
LL | / fn generic_in_parent<'a, L: X<&'a Nested<K>>>() { LL | fn generic_in_parent<'a, L: X<&'a Nested<K>>>() {
LL | | | ^^^^^^^^^^^^^^^^^
LL | | }
| |_____^
error[E0309]: the parameter type `M` may not live long enough error[E0309]: the parameter type `M` may not live long enough
--> $DIR/lifetime-doesnt-live-long-enough.rs:44:5 --> $DIR/lifetime-doesnt-live-long-enough.rs:44:8
| |
LL | fn generic_in_child<'a, 'b, L: X<&'a Nested<M>>, M: 'b>() { LL | fn generic_in_child<'a, 'b, L: X<&'a Nested<M>>, M: 'b>() {
| ^ -- help: consider adding an explicit lifetime bound `M: 'a`... | ^^^^^^^^^^^^^^^^ -- help: consider adding an explicit lifetime bound `M: 'a`...
| _____|
| |
LL | |
LL | | }
| |_____^
| |
note: ...so that the reference type `&'a Nested<M>` does not outlive the data it points at note: ...so that the reference type `&'a Nested<M>` does not outlive the data it points at
--> $DIR/lifetime-doesnt-live-long-enough.rs:44:5 --> $DIR/lifetime-doesnt-live-long-enough.rs:44:8
| |
LL | / fn generic_in_child<'a, 'b, L: X<&'a Nested<M>>, M: 'b>() { LL | fn generic_in_child<'a, 'b, L: X<&'a Nested<M>>, M: 'b>() {
LL | | | ^^^^^^^^^^^^^^^^
LL | | }
| |_____^
error: aborting due to 6 previous errors error: aborting due to 6 previous errors

View file

@ -1,11 +1,11 @@
error[E0038]: the trait `Bar` cannot be made into an object error[E0038]: the trait `Bar` cannot be made into an object
--> $DIR/object-safety-associated-consts.rs:12:1 --> $DIR/object-safety-associated-consts.rs:12:30
| |
LL | const X: usize; LL | const X: usize;
| - the trait cannot contain associated consts like `X` | - the trait cannot contain associated consts like `X`
... ...
LL | fn make_bar<T:Bar>(t: &T) -> &dyn Bar { LL | fn make_bar<T:Bar>(t: &T) -> &dyn Bar {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Bar` cannot be made into an object | ^^^^^^^^ the trait `Bar` cannot be made into an object
error: aborting due to previous error error: aborting due to previous error

View file

@ -1,20 +1,20 @@
error[E0038]: the trait `Bar` cannot be made into an object error[E0038]: the trait `Bar` cannot be made into an object
--> $DIR/object-safety-generics.rs:18:1 --> $DIR/object-safety-generics.rs:18:30
| |
LL | fn bar<T>(&self, t: T); LL | fn bar<T>(&self, t: T);
| --- method `bar` has generic type parameters | --- method `bar` has generic type parameters
... ...
LL | fn make_bar<T:Bar>(t: &T) -> &dyn Bar { LL | fn make_bar<T:Bar>(t: &T) -> &dyn Bar {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Bar` cannot be made into an object | ^^^^^^^^ the trait `Bar` cannot be made into an object
error[E0038]: the trait `Bar` cannot be made into an object error[E0038]: the trait `Bar` cannot be made into an object
--> $DIR/object-safety-generics.rs:24:1 --> $DIR/object-safety-generics.rs:24:39
| |
LL | fn bar<T>(&self, t: T); LL | fn bar<T>(&self, t: T);
| --- method `bar` has generic type parameters | --- method `bar` has generic type parameters
... ...
LL | fn make_bar_explicit<T:Bar>(t: &T) -> &dyn Bar { LL | fn make_bar_explicit<T:Bar>(t: &T) -> &dyn Bar {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Bar` cannot be made into an object | ^^^^^^^^ the trait `Bar` cannot be made into an object
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -1,20 +1,20 @@
error[E0038]: the trait `Bar` cannot be made into an object error[E0038]: the trait `Bar` cannot be made into an object
--> $DIR/object-safety-mentions-Self.rs:22:1 --> $DIR/object-safety-mentions-Self.rs:22:30
| |
LL | fn bar(&self, x: &Self); LL | fn bar(&self, x: &Self);
| --- method `bar` references the `Self` type in its parameters or return type | --- method `bar` references the `Self` type in its parameters or return type
... ...
LL | fn make_bar<T:Bar>(t: &T) -> &dyn Bar { LL | fn make_bar<T:Bar>(t: &T) -> &dyn Bar {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Bar` cannot be made into an object | ^^^^^^^^ the trait `Bar` cannot be made into an object
error[E0038]: the trait `Baz` cannot be made into an object error[E0038]: the trait `Baz` cannot be made into an object
--> $DIR/object-safety-mentions-Self.rs:28:1 --> $DIR/object-safety-mentions-Self.rs:28:30
| |
LL | fn baz(&self) -> Self; LL | fn baz(&self) -> Self;
| --- method `baz` references the `Self` type in its parameters or return type | --- method `baz` references the `Self` type in its parameters or return type
... ...
LL | fn make_baz<T:Baz>(t: &T) -> &dyn Baz { LL | fn make_baz<T:Baz>(t: &T) -> &dyn Baz {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Baz` cannot be made into an object | ^^^^^^^^ the trait `Baz` cannot be made into an object
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -1,11 +1,11 @@
error[E0038]: the trait `Foo` cannot be made into an object error[E0038]: the trait `Foo` cannot be made into an object
--> $DIR/object-safety-no-static.rs:12:1 --> $DIR/object-safety-no-static.rs:12:18
| |
LL | fn foo() {} LL | fn foo() {}
| --- associated function `foo` has no `self` parameter | --- associated function `foo` has no `self` parameter
... ...
LL | fn diverges() -> Box<dyn Foo> { LL | fn diverges() -> Box<dyn Foo> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Foo` cannot be made into an object | ^^^^^^^^^^^^ the trait `Foo` cannot be made into an object
error: aborting due to previous error error: aborting due to previous error

View file

@ -1,8 +1,8 @@
error[E0038]: the trait `Bar` cannot be made into an object error[E0038]: the trait `Bar` cannot be made into an object
--> $DIR/object-safety-sized-2.rs:14:1 --> $DIR/object-safety-sized-2.rs:14:30
| |
LL | fn make_bar<T:Bar>(t: &T) -> &dyn Bar { LL | fn make_bar<T:Bar>(t: &T) -> &dyn Bar {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Bar` cannot be made into an object | ^^^^^^^^ the trait `Bar` cannot be made into an object
| |
= note: the trait cannot require that `Self : Sized` = note: the trait cannot require that `Self : Sized`

View file

@ -1,8 +1,8 @@
error[E0038]: the trait `Bar` cannot be made into an object error[E0038]: the trait `Bar` cannot be made into an object
--> $DIR/object-safety-sized.rs:12:1 --> $DIR/object-safety-sized.rs:12:30
| |
LL | fn make_bar<T:Bar>(t: &T) -> &dyn Bar { LL | fn make_bar<T:Bar>(t: &T) -> &dyn Bar {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Bar` cannot be made into an object | ^^^^^^^^ the trait `Bar` cannot be made into an object
| |
= note: the trait cannot require that `Self : Sized` = note: the trait cannot require that `Self : Sized`

View file

@ -1,12 +1,8 @@
error[E0491]: in type `&'a &'b usize`, reference has a longer lifetime than the data it references error[E0491]: in type `&'a &'b usize`, reference has a longer lifetime than the data it references
--> $DIR/regions-free-region-ordering-callee-4.rs:5:1 --> $DIR/regions-free-region-ordering-callee-4.rs:5:4
| |
LL | / fn ordering4<'a, 'b, F>(a: &'a usize, b: &'b usize, x: F) where F: FnOnce(&'a &'b usize) { LL | fn ordering4<'a, 'b, F>(a: &'a usize, b: &'b usize, x: F) where F: FnOnce(&'a &'b usize) {
LL | | | ^^^^^^^^^
LL | | // Do not infer ordering from closure argument types.
LL | | let z: Option<&'a &'b usize> = None;
LL | | }
| |_^
| |
note: the pointer is valid for the lifetime `'a` as defined on the function body at 5:14 note: the pointer is valid for the lifetime `'a` as defined on the function body at 5:14
--> $DIR/regions-free-region-ordering-callee-4.rs:5:14 --> $DIR/regions-free-region-ordering-callee-4.rs:5:14

View file

@ -1,11 +1,8 @@
error[E0491]: in type `&'x (dyn for<'z> Trait1<<T as Trait2<'y, 'z>>::Foo> + 'x)`, reference has a longer lifetime than the data it references error[E0491]: in type `&'x (dyn for<'z> Trait1<<T as Trait2<'y, 'z>>::Foo> + 'x)`, reference has a longer lifetime than the data it references
--> $DIR/regions-implied-bounds-projection-gap-hr-1.rs:21:1 --> $DIR/regions-implied-bounds-projection-gap-hr-1.rs:21:25
| |
LL | / fn callee<'x, 'y, T>(t: &'x dyn for<'z> Trait1< <T as Trait2<'y, 'z>>::Foo >) LL | fn callee<'x, 'y, T>(t: &'x dyn for<'z> Trait1< <T as Trait2<'y, 'z>>::Foo >)
LL | | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | | {
LL | | }
| |_^
| |
note: the pointer is valid for the lifetime `'x` as defined on the function body at 21:11 note: the pointer is valid for the lifetime `'x` as defined on the function body at 21:11
--> $DIR/regions-implied-bounds-projection-gap-hr-1.rs:21:11 --> $DIR/regions-implied-bounds-projection-gap-hr-1.rs:21:11

View file

@ -67,15 +67,10 @@ LL | | }
found `Project<'_, '_>` found `Project<'_, '_>`
error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements
--> $DIR/regions-normalize-in-where-clause-list.rs:22:1 --> $DIR/regions-normalize-in-where-clause-list.rs:22:4
| |
LL | / fn bar<'a, 'b>() LL | fn bar<'a, 'b>()
LL | | | ^^^
LL | |
LL | | where <() as Project<'a, 'b>>::Item : Eq
LL | | {
LL | | }
| |_^
| |
note: first, the lifetime cannot outlive the lifetime `'a` as defined on the function body at 22:8... note: first, the lifetime cannot outlive the lifetime `'a` as defined on the function body at 22:8...
--> $DIR/regions-normalize-in-where-clause-list.rs:22:8 --> $DIR/regions-normalize-in-where-clause-list.rs:22:8
@ -88,15 +83,10 @@ note: ...but the lifetime must also be valid for the lifetime `'b` as defined on
LL | fn bar<'a, 'b>() LL | fn bar<'a, 'b>()
| ^^ | ^^
note: ...so that the types are compatible note: ...so that the types are compatible
--> $DIR/regions-normalize-in-where-clause-list.rs:22:1 --> $DIR/regions-normalize-in-where-clause-list.rs:22:4
| |
LL | / fn bar<'a, 'b>() LL | fn bar<'a, 'b>()
LL | | | ^^^
LL | |
LL | | where <() as Project<'a, 'b>>::Item : Eq
LL | | {
LL | | }
| |_^
= note: expected `Project<'a, 'b>` = note: expected `Project<'a, 'b>`
found `Project<'_, '_>` found `Project<'_, '_>`

View file

@ -1,8 +1,8 @@
error[E0038]: the trait `issue_3907::Foo` cannot be made into an object error[E0038]: the trait `issue_3907::Foo` cannot be made into an object
--> $DIR/issue-3907-2.rs:11:1 --> $DIR/issue-3907-2.rs:11:12
| |
LL | fn bar(_x: Foo) {} LL | fn bar(_x: Foo) {}
| ^^^^^^^^^^^^^^^ the trait `issue_3907::Foo` cannot be made into an object | ^^^ the trait `issue_3907::Foo` cannot be made into an object
| |
= note: associated function `bar` has no `self` parameter = note: associated function `bar` has no `self` parameter

View file

@ -1,20 +1,20 @@
error[E0277]: the trait bound `u32: Trait` is not satisfied error[E0277]: the trait bound `u32: Trait` is not satisfied
--> $DIR/trait-bounds-on-structs-and-enums-in-fns.rs:13:1 --> $DIR/trait-bounds-on-structs-and-enums-in-fns.rs:13:15
| |
LL | struct Foo<T:Trait> { LL | struct Foo<T:Trait> {
| ------------------- required by `Foo` | ------------------- required by `Foo`
... ...
LL | fn explode(x: Foo<u32>) {} LL | fn explode(x: Foo<u32>) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `u32` | ^^^^^^^^ the trait `Trait` is not implemented for `u32`
error[E0277]: the trait bound `f32: Trait` is not satisfied error[E0277]: the trait bound `f32: Trait` is not satisfied
--> $DIR/trait-bounds-on-structs-and-enums-in-fns.rs:16:1 --> $DIR/trait-bounds-on-structs-and-enums-in-fns.rs:16:14
| |
LL | enum Bar<T:Trait> { LL | enum Bar<T:Trait> {
| ----------------- required by `Bar` | ----------------- required by `Bar`
... ...
LL | fn kaboom(y: Bar<f32>) {} LL | fn kaboom(y: Bar<f32>) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `f32` | ^^^^^^^^ the trait `Trait` is not implemented for `f32`
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -1,16 +1,16 @@
error[E0277]: the trait bound `usize: trait_bounds_on_structs_and_enums_xc::Trait` is not satisfied error[E0277]: the trait bound `usize: trait_bounds_on_structs_and_enums_xc::Trait` is not satisfied
--> $DIR/trait-bounds-on-structs-and-enums-xc.rs:7:1 --> $DIR/trait-bounds-on-structs-and-enums-xc.rs:7:15
| |
LL | fn explode(x: Foo<usize>) {} LL | fn explode(x: Foo<usize>) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `trait_bounds_on_structs_and_enums_xc::Trait` is not implemented for `usize` | ^^^^^^^^^^ the trait `trait_bounds_on_structs_and_enums_xc::Trait` is not implemented for `usize`
| |
= note: required by `trait_bounds_on_structs_and_enums_xc::Foo` = note: required by `trait_bounds_on_structs_and_enums_xc::Foo`
error[E0277]: the trait bound `f32: trait_bounds_on_structs_and_enums_xc::Trait` is not satisfied error[E0277]: the trait bound `f32: trait_bounds_on_structs_and_enums_xc::Trait` is not satisfied
--> $DIR/trait-bounds-on-structs-and-enums-xc.rs:10:1 --> $DIR/trait-bounds-on-structs-and-enums-xc.rs:10:14
| |
LL | fn kaboom(y: Bar<f32>) {} LL | fn kaboom(y: Bar<f32>) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `trait_bounds_on_structs_and_enums_xc::Trait` is not implemented for `f32` | ^^^^^^^^ the trait `trait_bounds_on_structs_and_enums_xc::Trait` is not implemented for `f32`
| |
= note: required by `trait_bounds_on_structs_and_enums_xc::Bar` = note: required by `trait_bounds_on_structs_and_enums_xc::Bar`

View file

@ -1,10 +1,8 @@
error: non-defining opaque type use in defining scope error: non-defining opaque type use in defining scope
--> $DIR/generic_duplicate_lifetime_param.rs:7:1 --> $DIR/generic_duplicate_lifetime_param.rs:7:4
| |
LL | / fn one<'a>(t: &'a ()) -> Two<'a, 'a> { LL | fn one<'a>(t: &'a ()) -> Two<'a, 'a> {
LL | | t | ^^^
LL | | }
| |_^
| |
note: lifetime used multiple times note: lifetime used multiple times
--> $DIR/generic_duplicate_lifetime_param.rs:5:10 --> $DIR/generic_duplicate_lifetime_param.rs:5:10

View file

@ -1,17 +1,11 @@
error[E0283]: type annotations needed error[E0283]: type annotations needed
--> $DIR/issue-40294.rs:5:1 --> $DIR/issue-40294.rs:5:4
| |
LL | trait Foo: Sized { LL | trait Foo: Sized {
| ---------------- required by `Foo` | ---------------- required by `Foo`
... ...
LL | / fn foo<'a,'b,T>(x: &'a T, y: &'b T) LL | fn foo<'a,'b,T>(x: &'a T, y: &'b T)
LL | | where &'a T : Foo, | ^^^ cannot infer type for reference `&'a T`
LL | | &'b T : Foo
LL | | {
LL | | x.foo();
LL | | y.foo();
LL | | }
| |_^ cannot infer type for reference `&'a T`
| |
= note: cannot resolve `&'a T: Foo` = note: cannot resolve `&'a T: Foo`

View file

@ -1,32 +1,29 @@
error[E0277]: the trait bound `U: std::marker::Copy` is not satisfied error[E0277]: the trait bound `U: std::marker::Copy` is not satisfied
--> $DIR/wf-fn-where-clause.rs:8:1 --> $DIR/wf-fn-where-clause.rs:8:4
| |
LL | trait ExtraCopy<T:Copy> { } LL | trait ExtraCopy<T:Copy> { }
| ----------------------- required by `ExtraCopy` | ----------------------- required by `ExtraCopy`
LL | LL |
LL | fn foo<T,U>() where T: ExtraCopy<U> LL | fn foo<T,U>() where T: ExtraCopy<U>
| ^ - help: consider further restricting type parameter `U`: `, U: std::marker::Copy` | ^^^ - help: consider further restricting type parameter `U`: `, U: std::marker::Copy`
| _| | |
| | | the trait `std::marker::Copy` is not implemented for `U`
LL | | {
LL | | }
| |_^ the trait `std::marker::Copy` is not implemented for `U`
error[E0277]: the size for values of type `(dyn std::marker::Copy + 'static)` cannot be known at compilation time error[E0277]: the size for values of type `(dyn std::marker::Copy + 'static)` cannot be known at compilation time
--> $DIR/wf-fn-where-clause.rs:12:1 --> $DIR/wf-fn-where-clause.rs:12:4
| |
LL | fn bar() where Vec<dyn Copy>:, {} LL | fn bar() where Vec<dyn Copy>:, {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | ^^^ doesn't have a size known at compile-time
| |
= help: the trait `std::marker::Sized` is not implemented for `(dyn std::marker::Copy + 'static)` = help: the trait `std::marker::Sized` is not implemented for `(dyn std::marker::Copy + 'static)`
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait> = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
= note: required by `std::vec::Vec` = note: required by `std::vec::Vec`
error[E0038]: the trait `std::marker::Copy` cannot be made into an object error[E0038]: the trait `std::marker::Copy` cannot be made into an object
--> $DIR/wf-fn-where-clause.rs:12:1 --> $DIR/wf-fn-where-clause.rs:12:4
| |
LL | fn bar() where Vec<dyn Copy>:, {} LL | fn bar() where Vec<dyn Copy>:, {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` cannot be made into an object | ^^^ the trait `std::marker::Copy` cannot be made into an object
| |
= note: the trait cannot require that `Self : Sized` = note: the trait cannot require that `Self : Sized`

View file

@ -1,16 +1,13 @@
error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied
--> $DIR/wf-in-fn-arg.rs:10:1 --> $DIR/wf-in-fn-arg.rs:10:14
| |
LL | struct MustBeCopy<T:Copy> { LL | struct MustBeCopy<T:Copy> {
| ------------------------- required by `MustBeCopy` | ------------------------- required by `MustBeCopy`
... ...
LL | fn bar<T>(_: &MustBeCopy<T>) LL | fn bar<T>(_: &MustBeCopy<T>)
| ^ - help: consider restricting this bound: `T: std::marker::Copy` | - ^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `T`
| _| | |
| | | help: consider restricting this bound: `T: std::marker::Copy`
LL | | {
LL | | }
| |_^ the trait `std::marker::Copy` is not implemented for `T`
error: aborting due to previous error error: aborting due to previous error

View file

@ -1,16 +1,13 @@
error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied
--> $DIR/wf-in-fn-ret.rs:10:1 --> $DIR/wf-in-fn-ret.rs:10:16
| |
LL | struct MustBeCopy<T:Copy> { LL | struct MustBeCopy<T:Copy> {
| ------------------------- required by `MustBeCopy` | ------------------------- required by `MustBeCopy`
... ...
LL | fn bar<T>() -> MustBeCopy<T> LL | fn bar<T>() -> MustBeCopy<T>
| ^ - help: consider restricting this bound: `T: std::marker::Copy` | - ^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `T`
| _| | |
| | | help: consider restricting this bound: `T: std::marker::Copy`
LL | | {
LL | | }
| |_^ the trait `std::marker::Copy` is not implemented for `T`
error: aborting due to previous error error: aborting due to previous error

View file

@ -1,15 +1,13 @@
error[E0277]: the trait bound `U: std::marker::Copy` is not satisfied error[E0277]: the trait bound `U: std::marker::Copy` is not satisfied
--> $DIR/wf-in-fn-where-clause.rs:9:1 --> $DIR/wf-in-fn-where-clause.rs:9:4
| |
LL | trait MustBeCopy<T:Copy> { LL | trait MustBeCopy<T:Copy> {
| ------------------------ required by `MustBeCopy` | ------------------------ required by `MustBeCopy`
... ...
LL | / fn bar<T,U>() LL | fn bar<T,U>()
LL | | where T: MustBeCopy<U> | ^^^ the trait `std::marker::Copy` is not implemented for `U`
| | - help: consider further restricting type parameter `U`: `, U: std::marker::Copy` LL | where T: MustBeCopy<U>
LL | | { | - help: consider further restricting type parameter `U`: `, U: std::marker::Copy`
LL | | }
| |_^ the trait `std::marker::Copy` is not implemented for `U`
error: aborting due to previous error error: aborting due to previous error

View file

@ -1,14 +1,13 @@
error[E0277]: the trait bound `U: std::marker::Copy` is not satisfied error[E0277]: the trait bound `U: std::marker::Copy` is not satisfied
--> $DIR/wf-inherent-impl-method-where-clause.rs:12:5 --> $DIR/wf-inherent-impl-method-where-clause.rs:12:8
| |
LL | trait ExtraCopy<T:Copy> { } LL | trait ExtraCopy<T:Copy> { }
| ----------------------- required by `ExtraCopy` | ----------------------- required by `ExtraCopy`
... ...
LL | impl<T,U> Foo<T,U> { LL | impl<T,U> Foo<T,U> {
| - help: consider restricting this bound: `U: std::marker::Copy` | - help: consider restricting this bound: `U: std::marker::Copy`
LL | / fn foo(self) where T: ExtraCopy<U> LL | fn foo(self) where T: ExtraCopy<U>
LL | | {} | ^^^ the trait `std::marker::Copy` is not implemented for `U`
| |______^ the trait `std::marker::Copy` is not implemented for `U`
error: aborting due to previous error error: aborting due to previous error

View file

@ -1,18 +1,13 @@
error[E0277]: the trait bound `Self: std::cmp::Eq` is not satisfied error[E0277]: the trait bound `Self: std::cmp::Eq` is not satisfied
--> $DIR/wf-trait-default-fn-arg.rs:11:5 --> $DIR/wf-trait-default-fn-arg.rs:11:22
| |
LL | struct Bar<T:Eq+?Sized> { value: Box<T> } LL | struct Bar<T:Eq+?Sized> { value: Box<T> }
| ----------------------- required by `Bar` | ----------------------- required by `Bar`
... ...
LL | fn bar(&self, x: &Bar<Self>) { LL | fn bar(&self, x: &Bar<Self>) {
| ^ - help: consider further restricting `Self`: `where Self: std::cmp::Eq` | ^^^^^^^^^^ - help: consider further restricting `Self`: `where Self: std::cmp::Eq`
| _____| | |
| | | the trait `std::cmp::Eq` is not implemented for `Self`
LL | |
LL | | //
LL | | // Here, Eq ought to be implemented.
LL | | }
| |_____^ the trait `std::cmp::Eq` is not implemented for `Self`
error: aborting due to previous error error: aborting due to previous error

View file

@ -1,19 +1,13 @@
error[E0277]: the trait bound `Self: std::cmp::Eq` is not satisfied error[E0277]: the trait bound `Self: std::cmp::Eq` is not satisfied
--> $DIR/wf-trait-default-fn-ret.rs:11:5 --> $DIR/wf-trait-default-fn-ret.rs:11:22
| |
LL | struct Bar<T:Eq+?Sized> { value: Box<T> } LL | struct Bar<T:Eq+?Sized> { value: Box<T> }
| ----------------------- required by `Bar` | ----------------------- required by `Bar`
... ...
LL | fn bar(&self) -> Bar<Self> { LL | fn bar(&self) -> Bar<Self> {
| ^ - help: consider further restricting `Self`: `where Self: std::cmp::Eq` | ^^^^^^^^^- help: consider further restricting `Self`: `where Self: std::cmp::Eq`
| _____| | |
| | | the trait `std::cmp::Eq` is not implemented for `Self`
LL | |
LL | | //
LL | | // Here, Eq ought to be implemented.
LL | | loop { }
LL | | }
| |_____^ the trait `std::cmp::Eq` is not implemented for `Self`
error: aborting due to previous error error: aborting due to previous error

View file

@ -1,18 +1,13 @@
error[E0277]: the trait bound `Self: std::cmp::Eq` is not satisfied error[E0277]: the trait bound `Self: std::cmp::Eq` is not satisfied
--> $DIR/wf-trait-default-fn-where-clause.rs:11:5 --> $DIR/wf-trait-default-fn-where-clause.rs:11:8
| |
LL | trait Bar<T:Eq+?Sized> { } LL | trait Bar<T:Eq+?Sized> { }
| ---------------------- required by `Bar` | ---------------------- required by `Bar`
... ...
LL | fn bar<A>(&self) where A: Bar<Self> { LL | fn bar<A>(&self) where A: Bar<Self> {
| ^ - help: consider further restricting `Self`: `, Self: std::cmp::Eq` | ^^^ - help: consider further restricting `Self`: `, Self: std::cmp::Eq`
| _____| | |
| | | the trait `std::cmp::Eq` is not implemented for `Self`
LL | |
LL | | //
LL | | // Here, Eq ought to be implemented.
LL | | }
| |_____^ the trait `std::cmp::Eq` is not implemented for `Self`
error: aborting due to previous error error: aborting due to previous error

View file

@ -1,14 +1,13 @@
error[E0277]: the trait bound `Self: std::cmp::Eq` is not satisfied error[E0277]: the trait bound `Self: std::cmp::Eq` is not satisfied
--> $DIR/wf-trait-fn-arg.rs:10:5 --> $DIR/wf-trait-fn-arg.rs:10:22
| |
LL | struct Bar<T:Eq+?Sized> { value: Box<T> } LL | struct Bar<T:Eq+?Sized> { value: Box<T> }
| ----------------------- required by `Bar` | ----------------------- required by `Bar`
... ...
LL | fn bar(&self, x: &Bar<Self>); LL | fn bar(&self, x: &Bar<Self>);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^- | ^^^^^^^^^^ - help: consider further restricting `Self`: `where Self: std::cmp::Eq`
| | | | |
| | help: consider further restricting `Self`: `where Self: std::cmp::Eq` | the trait `std::cmp::Eq` is not implemented for `Self`
| the trait `std::cmp::Eq` is not implemented for `Self`
error: aborting due to previous error error: aborting due to previous error

View file

@ -1,14 +1,13 @@
error[E0277]: the trait bound `Self: std::cmp::Eq` is not satisfied error[E0277]: the trait bound `Self: std::cmp::Eq` is not satisfied
--> $DIR/wf-trait-fn-ret.rs:10:5 --> $DIR/wf-trait-fn-ret.rs:10:22
| |
LL | struct Bar<T:Eq+?Sized> { value: Box<T> } LL | struct Bar<T:Eq+?Sized> { value: Box<T> }
| ----------------------- required by `Bar` | ----------------------- required by `Bar`
... ...
LL | fn bar(&self) -> &Bar<Self>; LL | fn bar(&self) -> &Bar<Self>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^- | ^^^^^^^^^^- help: consider further restricting `Self`: `where Self: std::cmp::Eq`
| | | | |
| | help: consider further restricting `Self`: `where Self: std::cmp::Eq` | the trait `std::cmp::Eq` is not implemented for `Self`
| the trait `std::cmp::Eq` is not implemented for `Self`
error: aborting due to previous error error: aborting due to previous error

View file

@ -1,14 +1,13 @@
error[E0277]: the trait bound `Self: std::cmp::Eq` is not satisfied error[E0277]: the trait bound `Self: std::cmp::Eq` is not satisfied
--> $DIR/wf-trait-fn-where-clause.rs:10:5 --> $DIR/wf-trait-fn-where-clause.rs:10:8
| |
LL | struct Bar<T:Eq+?Sized> { value: Box<T> } LL | struct Bar<T:Eq+?Sized> { value: Box<T> }
| ----------------------- required by `Bar` | ----------------------- required by `Bar`
... ...
LL | fn bar(&self) where Self: Sized, Bar<Self>: Copy; LL | fn bar(&self) where Self: Sized, Bar<Self>: Copy;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- | ^^^ - help: consider further restricting `Self`: `, Self: std::cmp::Eq`
| | | | |
| | help: consider further restricting `Self`: `, Self: std::cmp::Eq` | the trait `std::cmp::Eq` is not implemented for `Self`
| the trait `std::cmp::Eq` is not implemented for `Self`
error: aborting due to previous error error: aborting due to previous error