Handle more cases
This commit is contained in:
parent
190589f8a7
commit
5b7ffd9333
35 changed files with 134 additions and 91 deletions
|
|
@ -969,7 +969,16 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
|||
trait_ref: &ty::PolyTraitRef<'_>,
|
||||
body_id: hir::HirId,
|
||||
) {
|
||||
let node = self.tcx.hir().find(self.tcx.hir().get_parent_item(body_id));
|
||||
let node = self.tcx.hir()
|
||||
.find(self.tcx.hir().get_parent_item(body_id))
|
||||
.or_else(|| self.tcx.hir().find(body_id));
|
||||
debug!(
|
||||
"suggest_restricting_param_bound node={:?} - trait_ref={:?} ty={:?} ({:?})",
|
||||
node,
|
||||
trait_ref,
|
||||
trait_ref.self_ty(),
|
||||
trait_ref.self_ty().kind,
|
||||
);
|
||||
if let ty::Param(param_ty) = &trait_ref.self_ty().kind {
|
||||
let restrict_msg = "consider further restricting this bound";
|
||||
let param_name = param_ty.name.as_str();
|
||||
|
|
|
|||
|
|
@ -2,20 +2,22 @@ error[E0277]: `T` cannot be sent between threads safely
|
|||
--> $DIR/builtin-superkinds-double-superkind.rs:6:24
|
||||
|
|
||||
LL | impl <T: Sync+'static> Foo for (T,) { }
|
||||
| ^^^ `T` cannot be sent between threads safely
|
||||
| -- ^^^ `T` cannot be sent between threads safely
|
||||
| |
|
||||
| help: consider further restricting this bound: `T: std::marker::Send +`
|
||||
|
|
||||
= help: within `(T,)`, the trait `std::marker::Send` is not implemented for `T`
|
||||
= help: consider adding a `where T: std::marker::Send` bound
|
||||
= note: required because it appears within the type `(T,)`
|
||||
|
||||
error[E0277]: `T` cannot be shared between threads safely
|
||||
--> $DIR/builtin-superkinds-double-superkind.rs:9:16
|
||||
|
|
||||
LL | impl <T: Send> Foo for (T,T) { }
|
||||
| ^^^ `T` cannot be shared between threads safely
|
||||
| -- ^^^ `T` cannot be shared between threads safely
|
||||
| |
|
||||
| help: consider further restricting this bound: `T: std::marker::Sync +`
|
||||
|
|
||||
= help: within `(T, T)`, the trait `std::marker::Sync` is not implemented for `T`
|
||||
= help: consider adding a `where T: std::marker::Sync` bound
|
||||
= note: required because it appears within the type `(T, T)`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
|
|
|||
|
|
@ -2,10 +2,11 @@ error[E0277]: `T` cannot be sent between threads safely
|
|||
--> $DIR/builtin-superkinds-in-metadata.rs:13:23
|
||||
|
|
||||
LL | impl <T:Sync+'static> RequiresRequiresShareAndSend for X<T> { }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `T` cannot be sent between threads safely
|
||||
| -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `T` cannot be sent between threads safely
|
||||
| |
|
||||
| help: consider further restricting this bound: `T: std::marker::Send +`
|
||||
|
|
||||
= help: within `X<T>`, the trait `std::marker::Send` is not implemented for `T`
|
||||
= help: consider adding a `where T: std::marker::Send` bound
|
||||
= note: required because it appears within the type `X<T>`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
|
|
|||
|
|
@ -2,10 +2,11 @@ error[E0277]: `T` cannot be sent between threads safely
|
|||
--> $DIR/builtin-superkinds-typaram-not-send.rs:5:24
|
||||
|
|
||||
LL | impl <T: Sync+'static> Foo for T { }
|
||||
| ^^^ `T` cannot be sent between threads safely
|
||||
| -- ^^^ `T` cannot be sent between threads safely
|
||||
| |
|
||||
| help: consider further restricting this bound: `T: std::marker::Send +`
|
||||
|
|
||||
= help: the trait `std::marker::Send` is not implemented for `T`
|
||||
= help: consider adding a `where T: std::marker::Send` bound
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,14 +4,16 @@ error[E0277]: `F` cannot be sent between threads safely
|
|||
LL | struct X<F> where F: FnOnce() + 'static + Send {
|
||||
| ---------------------------------------------- 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`
|
||||
| _|
|
||||
| |
|
||||
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: consider adding a `where F: std::marker::Send` bound
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ LL | pub struct Foo<T: Bound>(T);
|
|||
| ---------------------------- required by `Foo`
|
||||
...
|
||||
LL | impl<T> Trait2 for Foo<T> {}
|
||||
| ^^^^^^ the trait `Bound` is not implemented for `T`
|
||||
|
|
||||
= help: consider adding a `where T: Bound` bound
|
||||
| - ^^^^^^ the trait `Bound` is not implemented for `T`
|
||||
| |
|
||||
| help: consider restricting this bound: `T: Bound`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
error[E0277]: the size for values of type `T` cannot be known at compilation time
|
||||
--> $DIR/issue-27060-2.rs:3:5
|
||||
|
|
||||
LL | pub struct Bad<T: ?Sized> {
|
||||
| -- help: consider further restricting this bound: `T: std::marker::Sized +`
|
||||
LL | data: T,
|
||||
| ^^^^^^^ doesn't have a size known at compile-time
|
||||
|
|
||||
= help: the trait `std::marker::Sized` is not implemented for `T`
|
||||
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||
= help: consider adding a `where T: std::marker::Sized` bound
|
||||
= note: the last field of a packed struct may only have a dynamically sized type if it does not need drop to be run
|
||||
|
||||
error: aborting due to previous error
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@ error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied
|
|||
--> $DIR/issue-43784-associated-type.rs:13:9
|
||||
|
|
||||
LL | impl<T> Complete for T {
|
||||
| ^^^^^^^^ the trait `std::marker::Copy` is not implemented for `T`
|
||||
|
|
||||
= help: consider adding a `where T: std::marker::Copy` bound
|
||||
| - ^^^^^^^^ the trait `std::marker::Copy` is not implemented for `T`
|
||||
| |
|
||||
| help: consider restricting this bound: `T: std::marker::Copy`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@ error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied
|
|||
--> $DIR/issue-43784-supertrait.rs:8:9
|
||||
|
|
||||
LL | impl<T> Complete for T {}
|
||||
| ^^^^^^^^ the trait `std::marker::Copy` is not implemented for `T`
|
||||
|
|
||||
= help: consider adding a `where T: std::marker::Copy` bound
|
||||
| - ^^^^^^^^ the trait `std::marker::Copy` is not implemented for `T`
|
||||
| |
|
||||
| help: consider restricting this bound: `T: std::marker::Copy`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@ error[E0277]: the trait bound `U: std::cmp::Eq` is not satisfied
|
|||
--> $DIR/specialization-wfcheck.rs:7:17
|
||||
|
|
||||
LL | default impl<U> Foo<'static, U> for () {}
|
||||
| ^^^^^^^^^^^^^^^ the trait `std::cmp::Eq` is not implemented for `U`
|
||||
|
|
||||
= help: consider adding a `where U: std::cmp::Eq` bound
|
||||
| - ^^^^^^^^^^^^^^^ the trait `std::cmp::Eq` is not implemented for `U`
|
||||
| |
|
||||
| help: consider restricting this bound: `U: std::cmp::Eq`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ LL | struct Foo<T:Trait> {
|
|||
| ------------------- required by `Foo`
|
||||
...
|
||||
LL | impl<T> Foo<T> {
|
||||
| ^^^^^^ the trait `Trait` is not implemented for `T`
|
||||
|
|
||||
= help: consider adding a `where T: Trait` bound
|
||||
| - ^^^^^^ the trait `Trait` is not implemented for `T`
|
||||
| |
|
||||
| help: consider restricting this bound: `T: Trait`
|
||||
|
||||
error[E0277]: the trait bound `isize: Trait` is not satisfied
|
||||
--> $DIR/trait-bounds-on-structs-and-enums.rs:19:5
|
||||
|
|
@ -33,10 +33,10 @@ error[E0277]: the trait bound `U: Trait` is not satisfied
|
|||
LL | struct Foo<T:Trait> {
|
||||
| ------------------- required by `Foo`
|
||||
...
|
||||
LL | struct Badness<U> {
|
||||
| - help: consider restricting this bound: `U: Trait`
|
||||
LL | b: Foo<U>,
|
||||
| ^^^^^^^^^ the trait `Trait` is not implemented for `U`
|
||||
|
|
||||
= help: consider adding a `where U: Trait` bound
|
||||
|
||||
error[E0277]: the trait bound `V: Trait` is not satisfied
|
||||
--> $DIR/trait-bounds-on-structs-and-enums.rs:31:21
|
||||
|
|
@ -44,10 +44,10 @@ error[E0277]: the trait bound `V: Trait` is not satisfied
|
|||
LL | enum Bar<T:Trait> {
|
||||
| ----------------- required by `Bar`
|
||||
...
|
||||
LL | enum MoreBadness<V> {
|
||||
| - help: consider restricting this bound: `V: Trait`
|
||||
LL | EvenMoreBadness(Bar<V>),
|
||||
| ^^^^^^ the trait `Trait` is not implemented for `V`
|
||||
|
|
||||
= help: consider adding a `where V: Trait` bound
|
||||
|
||||
error[E0277]: the trait bound `i32: Trait` is not satisfied
|
||||
--> $DIR/trait-bounds-on-structs-and-enums.rs:35:5
|
||||
|
|
|
|||
|
|
@ -52,9 +52,10 @@ error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied
|
|||
LL | trait Super<T: Copy> { }
|
||||
| -------------------- required by `Super`
|
||||
LL | trait Base<T = String>: Super<T> { }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `T`
|
||||
|
|
||||
= help: consider adding a `where T: std::marker::Copy` bound
|
||||
| ^^^^^^^^^^^-^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| | |
|
||||
| | help: consider restricting this bound: `T: std::marker::Copy`
|
||||
| the trait `std::marker::Copy` is not implemented for `T`
|
||||
|
||||
error[E0277]: cannot add `u8` to `i32`
|
||||
--> $DIR/type-check-defaults.rs:24:66
|
||||
|
|
|
|||
|
|
@ -1,34 +1,37 @@
|
|||
error[E0277]: the size for values of type `T` cannot be known at compilation time
|
||||
--> $DIR/union-sized-field.rs:4:5
|
||||
|
|
||||
LL | union Foo<T: ?Sized> {
|
||||
| -- help: consider further restricting this bound: `T: std::marker::Sized +`
|
||||
LL | value: T,
|
||||
| ^^^^^^^^ doesn't have a size known at compile-time
|
||||
|
|
||||
= help: the trait `std::marker::Sized` is not implemented for `T`
|
||||
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||
= help: consider adding a `where T: std::marker::Sized` bound
|
||||
= note: no field of a union may have a dynamically sized type
|
||||
|
||||
error[E0277]: the size for values of type `T` cannot be known at compilation time
|
||||
--> $DIR/union-sized-field.rs:9:5
|
||||
|
|
||||
LL | struct Foo2<T: ?Sized> {
|
||||
| -- help: consider further restricting this bound: `T: std::marker::Sized +`
|
||||
LL | value: T,
|
||||
| ^^^^^^^^ doesn't have a size known at compile-time
|
||||
|
|
||||
= help: the trait `std::marker::Sized` is not implemented for `T`
|
||||
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||
= help: consider adding a `where T: std::marker::Sized` bound
|
||||
= note: only the last field of a struct may have a dynamically sized type
|
||||
|
||||
error[E0277]: the size for values of type `T` cannot be known at compilation time
|
||||
--> $DIR/union-sized-field.rs:15:11
|
||||
|
|
||||
LL | enum Foo3<T: ?Sized> {
|
||||
| -- help: consider further restricting this bound: `T: std::marker::Sized +`
|
||||
LL | Value(T),
|
||||
| ^ doesn't have a size known at compile-time
|
||||
|
|
||||
= help: the trait `std::marker::Sized` is not implemented for `T`
|
||||
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||
= help: consider adding a `where T: std::marker::Sized` bound
|
||||
= note: no field of an enum variant may have a dynamically sized type
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
|
|
|||
|
|
@ -1,45 +1,53 @@
|
|||
error[E0277]: the size for values of type `W` cannot be known at compilation time
|
||||
--> $DIR/unsized-enum2.rs:23:8
|
||||
|
|
||||
LL | enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
|
||||
| -- help: consider further restricting this bound: `W: std::marker::Sized +`
|
||||
LL | // parameter
|
||||
LL | VA(W),
|
||||
| ^ doesn't have a size known at compile-time
|
||||
|
|
||||
= help: the trait `std::marker::Sized` is not implemented for `W`
|
||||
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||
= help: consider adding a `where W: std::marker::Sized` bound
|
||||
= note: no field of an enum variant may have a dynamically sized type
|
||||
|
||||
error[E0277]: the size for values of type `X` cannot be known at compilation time
|
||||
--> $DIR/unsized-enum2.rs:25:8
|
||||
|
|
||||
LL | enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
|
||||
| -- help: consider further restricting this bound: `X: std::marker::Sized +`
|
||||
...
|
||||
LL | VB{x: X},
|
||||
| ^^^^ doesn't have a size known at compile-time
|
||||
|
|
||||
= help: the trait `std::marker::Sized` is not implemented for `X`
|
||||
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||
= help: consider adding a `where X: std::marker::Sized` bound
|
||||
= note: no field of an enum variant may have a dynamically sized type
|
||||
|
||||
error[E0277]: the size for values of type `Y` cannot be known at compilation time
|
||||
--> $DIR/unsized-enum2.rs:27:15
|
||||
|
|
||||
LL | enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
|
||||
| -- help: consider further restricting this bound: `Y: std::marker::Sized +`
|
||||
...
|
||||
LL | VC(isize, Y),
|
||||
| ^ doesn't have a size known at compile-time
|
||||
|
|
||||
= help: the trait `std::marker::Sized` is not implemented for `Y`
|
||||
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||
= help: consider adding a `where Y: std::marker::Sized` bound
|
||||
= note: no field of an enum variant may have a dynamically sized type
|
||||
|
||||
error[E0277]: the size for values of type `Z` cannot be known at compilation time
|
||||
--> $DIR/unsized-enum2.rs:29:18
|
||||
|
|
||||
LL | enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
|
||||
| -- help: consider further restricting this bound: `Z: std::marker::Sized +`
|
||||
...
|
||||
LL | VD{u: isize, x: Z},
|
||||
| ^^^^ doesn't have a size known at compile-time
|
||||
|
|
||||
= help: the trait `std::marker::Sized` is not implemented for `Z`
|
||||
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||
= help: consider adding a `where Z: std::marker::Sized` bound
|
||||
= note: no field of an enum variant may have a dynamically sized type
|
||||
|
||||
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
|
||||
|
|
|
|||
|
|
@ -5,11 +5,12 @@ LL | struct S5<Y>(Y);
|
|||
| ---------------- required by `S5`
|
||||
LL |
|
||||
LL | impl<X: ?Sized> S5<X> {
|
||||
| ^^^^^ doesn't have a size known at compile-time
|
||||
| -- ^^^^^ doesn't have a size known at compile-time
|
||||
| |
|
||||
| help: consider further restricting this bound: `X: std::marker::Sized +`
|
||||
|
|
||||
= help: the trait `std::marker::Sized` is not implemented for `X`
|
||||
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||
= help: consider adding a `where X: std::marker::Sized` bound
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -5,11 +5,12 @@ LL | struct S5<Y>(Y);
|
|||
| ---------------- required by `S5`
|
||||
LL |
|
||||
LL | impl<X: ?Sized> T3<X> for S5<X> {
|
||||
| ^^^^^ doesn't have a size known at compile-time
|
||||
| -- ^^^^^ doesn't have a size known at compile-time
|
||||
| |
|
||||
| help: consider further restricting this bound: `X: std::marker::Sized +`
|
||||
|
|
||||
= help: the trait `std::marker::Sized` is not implemented for `X`
|
||||
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||
= help: consider adding a `where X: std::marker::Sized` bound
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -2,11 +2,12 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
|
|||
--> $DIR/unsized-trait-impl-trait-arg.rs:8:17
|
||||
|
|
||||
LL | impl<X: ?Sized> T2<X> for S4<X> {
|
||||
| ^^^^^ doesn't have a size known at compile-time
|
||||
| -- ^^^^^ doesn't have a size known at compile-time
|
||||
| |
|
||||
| help: consider further restricting this bound: `X: std::marker::Sized +`
|
||||
|
|
||||
= help: the trait `std::marker::Sized` is not implemented for `X`
|
||||
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||
= help: consider adding a `where X: std::marker::Sized` bound
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -1,23 +1,26 @@
|
|||
error[E0277]: the size for values of type `X` cannot be known at compilation time
|
||||
--> $DIR/unsized5.rs:4:5
|
||||
|
|
||||
LL | struct S1<X: ?Sized> {
|
||||
| -- help: consider further restricting this bound: `X: std::marker::Sized +`
|
||||
LL | f1: X,
|
||||
| ^^^^^ doesn't have a size known at compile-time
|
||||
|
|
||||
= help: the trait `std::marker::Sized` is not implemented for `X`
|
||||
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||
= help: consider adding a `where X: std::marker::Sized` bound
|
||||
= note: only the last field of a struct may have a dynamically sized type
|
||||
|
||||
error[E0277]: the size for values of type `X` cannot be known at compilation time
|
||||
--> $DIR/unsized5.rs:10:5
|
||||
|
|
||||
LL | struct S2<X: ?Sized> {
|
||||
| -- help: consider further restricting this bound: `X: std::marker::Sized +`
|
||||
LL | f: isize,
|
||||
LL | g: X,
|
||||
| ^^^^ doesn't have a size known at compile-time
|
||||
|
|
||||
= help: the trait `std::marker::Sized` is not implemented for `X`
|
||||
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||
= help: consider adding a `where X: std::marker::Sized` bound
|
||||
= note: only the last field of a struct may have a dynamically sized type
|
||||
|
||||
error[E0277]: the size for values of type `str` cannot be known at compilation time
|
||||
|
|
@ -43,23 +46,25 @@ LL | f: [u8],
|
|||
error[E0277]: the size for values of type `X` cannot be known at compilation time
|
||||
--> $DIR/unsized5.rs:25:8
|
||||
|
|
||||
LL | enum E<X: ?Sized> {
|
||||
| -- help: consider further restricting this bound: `X: std::marker::Sized +`
|
||||
LL | V1(X, isize),
|
||||
| ^ doesn't have a size known at compile-time
|
||||
|
|
||||
= help: the trait `std::marker::Sized` is not implemented for `X`
|
||||
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||
= help: consider adding a `where X: std::marker::Sized` bound
|
||||
= note: no field of an enum variant may have a dynamically sized type
|
||||
|
||||
error[E0277]: the size for values of type `X` cannot be known at compilation time
|
||||
--> $DIR/unsized5.rs:29:8
|
||||
|
|
||||
LL | enum F<X: ?Sized> {
|
||||
| -- help: consider further restricting this bound: `X: std::marker::Sized +`
|
||||
LL | V2{f1: X, f: isize},
|
||||
| ^^^^^ doesn't have a size known at compile-time
|
||||
|
|
||||
= help: the trait `std::marker::Sized` is not implemented for `X`
|
||||
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||
= help: consider adding a `where X: std::marker::Sized` bound
|
||||
= note: no field of an enum variant may have a dynamically sized type
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
|
|
|||
|
|
@ -2,11 +2,12 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
|
|||
--> $DIR/unsized7.rs:12:21
|
||||
|
|
||||
LL | impl<X: ?Sized + T> T1<X> for S3<X> {
|
||||
| ^^^^^ doesn't have a size known at compile-time
|
||||
| -- ^^^^^ doesn't have a size known at compile-time
|
||||
| |
|
||||
| help: consider further restricting this bound: `X: std::marker::Sized +`
|
||||
|
|
||||
= help: the trait `std::marker::Sized` is not implemented for `X`
|
||||
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||
= help: consider adding a `where X: std::marker::Sized` bound
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -6,12 +6,11 @@ LL | trait ExtraCopy<T:Copy> { }
|
|||
LL |
|
||||
LL | / enum SomeEnum<T,U>
|
||||
LL | | where T: ExtraCopy<U>
|
||||
| | - help: consider further restricting type parameter `U`: `, U: std::marker::Copy`
|
||||
LL | | {
|
||||
LL | | SomeVariant(T,U)
|
||||
LL | | }
|
||||
| |_^ the trait `std::marker::Copy` is not implemented for `U`
|
||||
|
|
||||
= help: consider adding a `where U: std::marker::Copy` bound
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,11 @@ error[E0277]: the trait bound `A: std::marker::Copy` is not satisfied
|
|||
LL | struct IsCopy<T:Copy> {
|
||||
| --------------------- required by `IsCopy`
|
||||
...
|
||||
LL | enum AnotherEnum<A> {
|
||||
| - help: consider restricting this bound: `A: std::marker::Copy`
|
||||
LL | AnotherVariant {
|
||||
LL | f: IsCopy<A>
|
||||
| ^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `A`
|
||||
|
|
||||
= help: consider adding a `where A: std::marker::Copy` bound
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ error[E0277]: the trait bound `A: std::marker::Copy` is not satisfied
|
|||
LL | struct IsCopy<T:Copy> {
|
||||
| --------------------- required by `IsCopy`
|
||||
...
|
||||
LL | enum SomeEnum<A> {
|
||||
| - help: consider restricting this bound: `A: std::marker::Copy`
|
||||
LL | SomeVariant(IsCopy<A>)
|
||||
| ^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `A`
|
||||
|
|
||||
= help: consider adding a `where A: std::marker::Copy` bound
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,12 +4,13 @@ error[E0277]: the trait bound `U: std::marker::Copy` is not satisfied
|
|||
LL | trait ExtraCopy<T:Copy> { }
|
||||
| ----------------------- required by `ExtraCopy`
|
||||
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`
|
||||
| _|
|
||||
| |
|
||||
LL | | {
|
||||
LL | | }
|
||||
| |_^ the trait `std::marker::Copy` is not implemented for `U`
|
||||
|
|
||||
= help: consider adding a `where U: std::marker::Copy` bound
|
||||
|
||||
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
|
||||
|
|
|
|||
|
|
@ -4,12 +4,13 @@ error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied
|
|||
LL | struct MustBeCopy<T:Copy> {
|
||||
| ------------------------- required by `MustBeCopy`
|
||||
...
|
||||
LL | / fn bar<T>(_: &MustBeCopy<T>)
|
||||
LL | fn bar<T>(_: &MustBeCopy<T>)
|
||||
| ^ - help: consider restricting this bound: `T: std::marker::Copy`
|
||||
| _|
|
||||
| |
|
||||
LL | | {
|
||||
LL | | }
|
||||
| |_^ the trait `std::marker::Copy` is not implemented for `T`
|
||||
|
|
||||
= help: consider adding a `where T: std::marker::Copy` bound
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,12 +4,13 @@ error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied
|
|||
LL | struct MustBeCopy<T:Copy> {
|
||||
| ------------------------- required by `MustBeCopy`
|
||||
...
|
||||
LL | / fn bar<T>() -> MustBeCopy<T>
|
||||
LL | fn bar<T>() -> MustBeCopy<T>
|
||||
| ^ - help: consider restricting this bound: `T: std::marker::Copy`
|
||||
| _|
|
||||
| |
|
||||
LL | | {
|
||||
LL | | }
|
||||
| |_^ the trait `std::marker::Copy` is not implemented for `T`
|
||||
|
|
||||
= help: consider adding a `where T: std::marker::Copy` bound
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,11 @@ error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied
|
|||
LL | struct MustBeCopy<T:Copy> {
|
||||
| ------------------------- required by `MustBeCopy`
|
||||
...
|
||||
LL | struct Bar<T> {
|
||||
| - help: consider restricting this bound: `T: std::marker::Copy`
|
||||
LL | // needs T: Copy
|
||||
LL | x: fn(MustBeCopy<T>)
|
||||
| ^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `T`
|
||||
|
|
||||
= help: consider adding a `where T: std::marker::Copy` bound
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,11 @@ error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied
|
|||
LL | struct MustBeCopy<T:Copy> {
|
||||
| ------------------------- required by `MustBeCopy`
|
||||
...
|
||||
LL | struct Foo<T> {
|
||||
| - help: consider restricting this bound: `T: std::marker::Copy`
|
||||
LL | // needs T: 'static
|
||||
LL | x: fn() -> MustBeCopy<T>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `T`
|
||||
|
|
||||
= help: consider adding a `where T: std::marker::Copy` bound
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -6,11 +6,10 @@ LL | trait MustBeCopy<T:Copy> {
|
|||
...
|
||||
LL | / fn bar<T,U>()
|
||||
LL | | where T: MustBeCopy<U>
|
||||
| | - help: consider further restricting type parameter `U`: `, U: std::marker::Copy`
|
||||
LL | | {
|
||||
LL | | }
|
||||
| |_^ the trait `std::marker::Copy` is not implemented for `U`
|
||||
|
|
||||
= help: consider adding a `where U: std::marker::Copy` bound
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,11 @@ error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied
|
|||
LL | struct MustBeCopy<T:Copy> {
|
||||
| ------------------------- required by `MustBeCopy`
|
||||
...
|
||||
LL | struct Bar<T> {
|
||||
| - help: consider restricting this bound: `T: std::marker::Copy`
|
||||
LL | // needs T: Copy
|
||||
LL | x: dyn Object<MustBeCopy<T>>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `T`
|
||||
|
|
||||
= help: consider adding a `where T: std::marker::Copy` bound
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,12 +4,13 @@ error[E0277]: the trait bound `U: std::marker::Copy` is not satisfied
|
|||
LL | trait ExtraCopy<T:Copy> { }
|
||||
| ----------------------- required by `ExtraCopy`
|
||||
...
|
||||
LL | / impl<T,U> Foo<T,U> where T: ExtraCopy<U>
|
||||
LL | impl<T,U> Foo<T,U> where T: ExtraCopy<U>
|
||||
| ^ - help: consider further restricting type parameter `U`: `, U: std::marker::Copy`
|
||||
| _|
|
||||
| |
|
||||
LL | | {
|
||||
LL | | }
|
||||
| |_^ the trait `std::marker::Copy` is not implemented for `U`
|
||||
|
|
||||
= help: consider adding a `where U: std::marker::Copy` bound
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -6,12 +6,11 @@ LL | trait ExtraCopy<T:Copy> { }
|
|||
LL |
|
||||
LL | / struct SomeStruct<T,U>
|
||||
LL | | where T: ExtraCopy<U>
|
||||
| | - help: consider further restricting type parameter `U`: `, U: std::marker::Copy`
|
||||
LL | | {
|
||||
LL | | data: (T,U)
|
||||
LL | | }
|
||||
| |_^ the trait `std::marker::Copy` is not implemented for `U`
|
||||
|
|
||||
= help: consider adding a `where U: std::marker::Copy` bound
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ error[E0277]: the trait bound `A: std::marker::Copy` is not satisfied
|
|||
LL | struct IsCopy<T:Copy> {
|
||||
| --------------------- required by `IsCopy`
|
||||
...
|
||||
LL | struct SomeStruct<A> {
|
||||
| - help: consider restricting this bound: `A: std::marker::Copy`
|
||||
LL | data: IsCopy<A>
|
||||
| ^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `A`
|
||||
|
|
||||
= help: consider adding a `where A: std::marker::Copy` bound
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,12 +4,13 @@ error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied
|
|||
LL | trait ExtraCopy<T:Copy> { }
|
||||
| ----------------------- required by `ExtraCopy`
|
||||
LL |
|
||||
LL | / trait SomeTrait<T> {
|
||||
LL | trait SomeTrait<T> {
|
||||
| ^ - help: consider restricting this bound: `T: std::marker::Copy`
|
||||
| _|
|
||||
| |
|
||||
LL | | type Type1: ExtraCopy<T>;
|
||||
LL | | }
|
||||
| |_^ the trait `std::marker::Copy` is not implemented for `T`
|
||||
|
|
||||
= help: consider adding a `where T: std::marker::Copy` bound
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -6,11 +6,10 @@ LL | trait ExtraCopy<T:Copy> { }
|
|||
LL |
|
||||
LL | / trait SomeTrait<T,U>
|
||||
LL | | where T: ExtraCopy<U>
|
||||
| | - help: consider further restricting type parameter `U`: `, U: std::marker::Copy`
|
||||
LL | | {
|
||||
LL | | }
|
||||
| |_^ the trait `std::marker::Copy` is not implemented for `U`
|
||||
|
|
||||
= help: consider adding a `where U: std::marker::Copy` bound
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,11 +4,12 @@ error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied
|
|||
LL | trait ExtraCopy<T:Copy> { }
|
||||
| ----------------------- required by `ExtraCopy`
|
||||
LL |
|
||||
LL | / trait SomeTrait<T>: ExtraCopy<T> {
|
||||
LL | trait SomeTrait<T>: ExtraCopy<T> {
|
||||
| ^ - help: consider restricting this bound: `T: std::marker::Copy`
|
||||
| _|
|
||||
| |
|
||||
LL | | }
|
||||
| |_^ the trait `std::marker::Copy` is not implemented for `T`
|
||||
|
|
||||
= help: consider adding a `where T: std::marker::Copy` bound
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue