Remove redundant explanatory note for type parameters

This commit is contained in:
Esteban Küber 2020-07-10 18:47:53 -07:00
parent d989796b47
commit c38b127d84
43 changed files with 6 additions and 98 deletions

View File

@ -376,7 +376,12 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
// If it has a custom `#[rustc_on_unimplemented]`
// error message, let's display it as the label!
err.span_label(span, s.as_str());
err.help(&explanation);
if !matches!(trait_ref.skip_binder().self_ty().kind, ty::Param(_)) {
// When the self type is a type param We don't need to "the trait
// `std::marker::Sized` is not implemented for `T`" as we will point
// at the type param with a label to suggest constraining it.
err.help(&explanation);
}
} else {
err.span_label(span, explanation);
}

View File

@ -21,7 +21,6 @@ LL | trait UncheckedCopy: Sized {
LL | + AddAssign<&'static str>
| ^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `Self += &'static str`
|
= help: the trait `std::ops::AddAssign<&'static str>` is not implemented for `Self`
help: consider further restricting `Self`
|
LL | trait UncheckedCopy: Sized + std::ops::AddAssign<&'static str> {
@ -50,7 +49,6 @@ LL | trait UncheckedCopy: Sized {
LL | + Display = Self;
| ^^^^^^^ `Self` cannot be formatted with the default formatter
|
= help: the trait `std::fmt::Display` is not implemented for `Self`
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
help: consider further restricting `Self`
|
@ -69,7 +67,6 @@ LL | + Display = Self;
LL | impl<T> UncheckedCopy for T {}
| ^^^^^^^^^^^^^ `T` cannot be formatted with the default formatter
|
= help: the trait `std::fmt::Display` is not implemented for `T`
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
help: consider restricting type parameter `T`
|
@ -105,7 +102,6 @@ LL | + AddAssign<&'static str>
LL | impl<T> UncheckedCopy for T {}
| ^^^^^^^^^^^^^ no implementation for `T += &'static str`
|
= help: the trait `std::ops::AddAssign<&'static str>` is not implemented for `T`
help: consider restricting type parameter `T`
|
LL | impl<T: std::ops::AddAssign<&'static str>> UncheckedCopy for T {}

View File

@ -21,7 +21,6 @@ LL | trait UncheckedCopy: Sized {
LL | + AddAssign<&'static str>
| ^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `Self += &'static str`
|
= help: the trait `std::ops::AddAssign<&'static str>` is not implemented for `Self`
help: consider further restricting `Self`
|
LL | trait UncheckedCopy: Sized + std::ops::AddAssign<&'static str> {
@ -50,7 +49,6 @@ LL | trait UncheckedCopy: Sized {
LL | + Display = Self;
| ^^^^^^^ `Self` cannot be formatted with the default formatter
|
= help: the trait `std::fmt::Display` is not implemented for `Self`
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
help: consider further restricting `Self`
|
@ -69,7 +67,6 @@ LL | + Display = Self;
LL | impl<T> UncheckedCopy for T {}
| ^^^^^^^^^^^^^ `T` cannot be formatted with the default formatter
|
= help: the trait `std::fmt::Display` is not implemented for `T`
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
help: consider restricting type parameter `T`
|
@ -105,7 +102,6 @@ LL | + AddAssign<&'static str>
LL | impl<T> UncheckedCopy for T {}
| ^^^^^^^^^^^^^ no implementation for `T += &'static str`
|
= help: the trait `std::ops::AddAssign<&'static str>` is not implemented for `T`
help: consider restricting type parameter `T`
|
LL | impl<T: std::ops::AddAssign<&'static str>> UncheckedCopy for T {}

View File

@ -6,7 +6,6 @@ LL | trait MyTrait {
LL | type This = Self;
| ^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `Self`
help: consider further restricting `Self`
|
LL | trait MyTrait: std::marker::Sized {

View File

@ -9,7 +9,6 @@ LL | trait ArithmeticOps: Add<Output=Self> + Sub<Output=Self> + Mul<Output=Self>
LL | pub trait Add<Rhs = Self> {
| --- required by this bound in `std::ops::Add`
|
= help: the trait `std::marker::Sized` is not implemented for `Self`
help: consider further restricting `Self`
|
LL | trait ArithmeticOps: Add<Output=Self> + Sub<Output=Self> + Mul<Output=Self> + Div<Output=Self> + std::marker::Sized {}

View File

@ -7,7 +7,6 @@ LL |
LL | async { (ty, ty1) }
| ------------------- this returned value is of type `impl std::future::Future`
|
= help: within `impl std::future::Future`, the trait `std::marker::Send` is not implemented for `U`
note: captured value is not `Send`
--> $DIR/issue-70818.rs:6:18
|

View File

@ -4,7 +4,6 @@ error[E0277]: `T` cannot be sent between threads safely
LL | 1.bar::<T>();
| ^^^ `T` cannot be sent between threads safely
|
= help: the trait `std::marker::Send` is not implemented for `T`
help: consider further restricting this bound
|
LL | fn foo<T:'static + std::marker::Send>() {

View File

@ -4,7 +4,6 @@ error[E0277]: `impl Sized` doesn't implement `std::fmt::Debug`
LL | println!("{:?}", t);
| ^ `impl Sized` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
|
= help: the trait `std::fmt::Debug` is not implemented for `impl Sized`
= note: required by `std::fmt::Debug::fmt`
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider further restricting this bound
@ -18,7 +17,6 @@ error[E0277]: `T` doesn't implement `std::fmt::Debug`
LL | println!("{:?}", t);
| ^ `T` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
|
= help: the trait `std::fmt::Debug` is not implemented for `T`
= note: required by `std::fmt::Debug::fmt`
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider restricting type parameter `T`
@ -32,7 +30,6 @@ error[E0277]: `T` doesn't implement `std::fmt::Debug`
LL | println!("{:?}", t);
| ^ `T` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
|
= help: the trait `std::fmt::Debug` is not implemented for `T`
= note: required by `std::fmt::Debug::fmt`
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider further restricting this bound
@ -46,7 +43,6 @@ error[E0277]: `Y` doesn't implement `std::fmt::Debug`
LL | println!("{:?} {:?}", x, y);
| ^ `Y` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
|
= help: the trait `std::fmt::Debug` is not implemented for `Y`
= note: required by `std::fmt::Debug::fmt`
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider further restricting type parameter `Y`
@ -60,7 +56,6 @@ error[E0277]: `X` doesn't implement `std::fmt::Debug`
LL | println!("{:?}", x);
| ^ `X` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
|
= help: the trait `std::fmt::Debug` is not implemented for `X`
= note: required by `std::fmt::Debug::fmt`
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider further restricting this bound
@ -74,7 +69,6 @@ error[E0277]: `X` doesn't implement `std::fmt::Debug`
LL | println!("{:?}", x);
| ^ `X` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
|
= help: the trait `std::fmt::Debug` is not implemented for `X`
= note: required by `std::fmt::Debug::fmt`
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider further restricting type parameter `X`

View File

@ -7,7 +7,6 @@ LL |
LL | impl <T: Sync+'static> Foo for (T,) { }
| ^^^ `T` cannot be sent between threads safely
|
= help: within `(T,)`, the trait `std::marker::Send` is not implemented for `T`
= note: required because it appears within the type `(T,)`
help: consider further restricting this bound
|
@ -23,7 +22,6 @@ LL | trait Foo : Send+Sync { }
LL | impl <T: Send> Foo for (T,T) { }
| ^^^ `T` cannot be shared between threads safely
|
= help: within `(T, T)`, the trait `std::marker::Sync` is not implemented for `T`
= note: required because it appears within the type `(T, T)`
help: consider further restricting this bound
|

View File

@ -9,7 +9,6 @@ LL | impl <T:Sync+'static> RequiresRequiresShareAndSend for X<T> { }
LL | pub trait RequiresRequiresShareAndSend : RequiresShare + Send { }
| ---- required by this bound in `trait_superkinds_in_metadata::RequiresRequiresShareAndSend`
|
= help: within `X<T>`, the trait `std::marker::Send` is not implemented for `T`
= note: required because it appears within the type `X<T>`
help: consider further restricting this bound
|

View File

@ -7,7 +7,6 @@ LL |
LL | impl <T: Sync+'static> Foo for T { }
| ^^^ `T` cannot be sent between threads safely
|
= help: the trait `std::marker::Send` is not implemented for `T`
help: consider further restricting this bound
|
LL | impl <T: Sync+'static + std::marker::Send> Foo for T { }

View File

@ -7,7 +7,6 @@ LL | struct X<F> where F: FnOnce() + 'static + Send {
LL | fn foo<F>(blk: F) -> X<F> where F: FnOnce() + 'static {
| ^^^^ `F` cannot be sent between threads safely
|
= help: the trait `std::marker::Send` is not implemented for `F`
help: consider further restricting this bound
|
LL | fn foo<F>(blk: F) -> X<F> where F: FnOnce() + 'static + std::marker::Send {

View File

@ -7,7 +7,6 @@ LL | fn take_const_owned<F>(_: F) where F: FnOnce() + Sync + Send {
LL | take_const_owned(f);
| ^ `F` cannot be shared between threads safely
|
= help: the trait `std::marker::Sync` is not implemented for `F`
help: consider further restricting this bound
|
LL | fn give_owned<F>(f: F) where F: FnOnce() + Send + std::marker::Sync {

View File

@ -6,7 +6,6 @@ LL | fn test1<T: ?Sized + Foo>(t: &T) {
LL | let u: &dyn Foo = t;
| ^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `T`
= note: required for the cast to the object type `dyn Foo`
error[E0277]: the size for values of type `T` cannot be known at compilation time
@ -17,7 +16,6 @@ LL | fn test2<T: ?Sized + Foo>(t: &T) {
LL | let v: &dyn Foo = t as &dyn Foo;
| ^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `T`
= note: required for the cast to the object type `dyn Foo`
error[E0277]: the size for values of type `str` cannot be known at compilation time

View File

@ -16,7 +16,6 @@ LL | type F<'a>: Fn() -> u32;
LL | type F<'a> = Self;
| ^^^^^^^^^^^^^^^^^^ expected an `Fn<()>` closure, found `T`
|
= help: the trait `std::ops::Fn<()>` is not implemented for `T`
= note: wrap the `T` in a closure with no arguments: `|| { /* code */ }
help: consider restricting type parameter `T`
|

View File

@ -16,7 +16,6 @@ LL | type F<'a>: Fn() -> u32;
LL | type F<'a> = Self;
| ^^^^^^^^^^^^^^^^^^ expected an `Fn<()>` closure, found `T`
|
= help: the trait `std::ops::Fn<()>` is not implemented for `T`
= note: wrap the `T` in a closure with no arguments: `|| { /* code */ }
help: consider restricting type parameter `T`
|

View File

@ -16,7 +16,6 @@ LL | type F<'a>: Fn() -> u32;
LL | type F<'a> = Self;
| ^^^^^^^^^^^^^^^^^^ expected an `Fn<()>` closure, found `T`
|
= help: the trait `std::ops::Fn<()>` is not implemented for `T`
= note: wrap the `T` in a closure with no arguments: `|| { /* code */ }
help: consider restricting type parameter `T`
|

View File

@ -16,7 +16,6 @@ LL | type F<'a>: Fn() -> u32;
LL | type F<'a> = Self;
| ^^^^^^^^^^^^^^^^^^ expected an `Fn<()>` closure, found `T`
|
= help: the trait `std::ops::Fn<()>` is not implemented for `T`
= note: wrap the `T` in a closure with no arguments: `|| { /* code */ }
help: consider restricting type parameter `T`
|

View File

@ -7,7 +7,6 @@ LL | trait From<Src> {
LL | ) -> <Dst as From<Self>>::Result where Dst: From<Self> {
| ^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `Self`
help: consider further restricting `Self`
|
LL | ) -> <Dst as From<Self>>::Result where Dst: From<Self>, Self: std::marker::Sized {

View File

@ -6,7 +6,6 @@ LL | pub struct Bad<T: ?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: the last field of a packed struct may only have a dynamically sized type if it does not need drop to be run
= help: change the field's type to have a statically known size
help: borrowed types always have a statically known size

View File

@ -4,7 +4,6 @@ error[E0277]: the size for values of type `Self` cannot be known at compilation
LL | fn foo(self) -> &'static i32 {
| ^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `Self`
= help: unsized locals are gated as an unstable feature
help: consider further restricting `Self`
|

View File

@ -4,7 +4,6 @@ error[E0277]: `T` cannot be sent between threads safely
LL | let a = &t as &dyn Gettable<T>;
| ^^ `T` cannot be sent between threads safely
|
= help: the trait `std::marker::Send` is not implemented for `T`
= note: required because of the requirements on the impl of `Gettable<T>` for `S<T>`
= note: required for the cast to the object type `dyn Gettable<T>`
help: consider restricting type parameter `T`
@ -31,7 +30,6 @@ error[E0277]: `T` cannot be sent between threads safely
LL | let a: &dyn Gettable<T> = &t;
| ^^ `T` cannot be sent between threads safely
|
= help: the trait `std::marker::Send` is not implemented for `T`
= note: required because of the requirements on the impl of `Gettable<T>` for `S<T>`
= note: required for the cast to the object type `dyn Gettable<T>`
help: consider restricting type parameter `T`

View File

@ -4,7 +4,6 @@ error[E0277]: `T` cannot be sent between threads safely
LL | let a = &t as &dyn Gettable<T>;
| ^^ `T` cannot be sent between threads safely
|
= help: the trait `std::marker::Send` is not implemented for `T`
= note: required because of the requirements on the impl of `Gettable<T>` for `S<T>`
= note: required for the cast to the object type `dyn Gettable<T>`
help: consider restricting type parameter `T`
@ -31,7 +30,6 @@ error[E0277]: `T` cannot be sent between threads safely
LL | let a: &dyn Gettable<T> = &t;
| ^^ `T` cannot be sent between threads safely
|
= help: the trait `std::marker::Send` is not implemented for `T`
= note: required because of the requirements on the impl of `Gettable<T>` for `S<T>`
= note: required for the cast to the object type `dyn Gettable<T>`
help: consider restricting type parameter `T`

View File

@ -9,7 +9,6 @@ LL | fn test<T>() {
LL | let _: [u8; sof::<T>()];
| ^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `T`
help: consider relaxing the implicit `Sized` restriction
|
LL | pub const fn sof<T: ?Sized>() -> usize {

View File

@ -7,7 +7,6 @@ LL | fn is_zen<T: Zen>(_: T) {}
LL | is_zen(x)
| ^ `T` cannot be shared between threads safely
|
= help: the trait `std::marker::Sync` is not implemented for `T`
= note: required because of the requirements on the impl of `Zen` for `&T`
= note: required because it appears within the type `std::marker::PhantomData<&T>`
= note: required because it appears within the type `Guard<'_, T>`
@ -25,7 +24,6 @@ LL | fn is_zen<T: Zen>(_: T) {}
LL | is_zen(x)
| ^ `T` cannot be shared between threads safely
|
= help: the trait `std::marker::Sync` is not implemented for `T`
= note: required because of the requirements on the impl of `Zen` for `&T`
= note: required because it appears within the type `std::marker::PhantomData<&T>`
= note: required because it appears within the type `Guard<'_, T>`

View File

@ -24,7 +24,6 @@ LL | type U<'a>: PartialEq<&'a Self>;
LL | default type U<'a> = &'a T;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `T == T`
|
= help: the trait `std::cmp::PartialEq` is not implemented for `T`
= note: required because of the requirements on the impl of `std::cmp::PartialEq` for `&'a T`
help: consider further restricting this bound
|

View File

@ -9,7 +9,6 @@ LL | struct Struct5<T: ?Sized>{
LL | _t: X<T>,
| ^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `T`
help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
--> $DIR/adt-param-with-implicit-sized-bound.rs:18:10
|
@ -27,7 +26,6 @@ LL | fn func1() -> Struct1<Self>;
LL | struct Struct1<T>{
| - required by this bound in `Struct1`
|
= help: the trait `std::marker::Sized` is not implemented for `Self`
help: consider further restricting `Self`
|
LL | fn func1() -> Struct1<Self> where Self: std::marker::Sized;
@ -46,7 +44,6 @@ LL | fn func2<'a>() -> Struct2<'a, Self>;
LL | struct Struct2<'a, T>{
| - required by this bound in `Struct2`
|
= help: the trait `std::marker::Sized` is not implemented for `Self`
help: consider further restricting `Self`
|
LL | fn func2<'a>() -> Struct2<'a, Self> where Self: std::marker::Sized;
@ -65,7 +62,6 @@ LL | fn func3() -> Struct3<Self>;
LL | struct Struct3<T>{
| - required by this bound in `Struct3`
|
= help: the trait `std::marker::Sized` is not implemented for `Self`
help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
--> $DIR/adt-param-with-implicit-sized-bound.rs:14:16
|
@ -87,7 +83,6 @@ LL | fn func4() -> Struct4<Self>;
LL | struct Struct4<T>{
| - required by this bound in `Struct4`
|
= help: the trait `std::marker::Sized` is not implemented for `Self`
help: consider further restricting `Self`
|
LL | fn func4() -> Struct4<Self> where Self: std::marker::Sized;

View File

@ -7,7 +7,6 @@ LL | fn is_send<T: Send>(val: T) {}
LL | is_send(val);
| ^^^ `impl Sync` cannot be sent between threads safely
|
= help: the trait `std::marker::Send` is not implemented for `impl Sync`
help: consider further restricting this bound
|
LL | fn use_impl_sync(val: impl Sync + std::marker::Send) {
@ -22,7 +21,6 @@ LL | fn is_send<T: Send>(val: T) {}
LL | is_send(val);
| ^^^ `S` cannot be sent between threads safely
|
= help: the trait `std::marker::Send` is not implemented for `S`
help: consider further restricting this bound
|
LL | fn use_where<S>(val: S) where S: Sync + std::marker::Send {
@ -37,7 +35,6 @@ LL | fn is_send<T: Send>(val: T) {}
LL | is_send(val);
| ^^^ `S` cannot be sent between threads safely
|
= help: the trait `std::marker::Send` is not implemented for `S`
help: consider further restricting this bound
|
LL | fn use_bound<S: Sync + std::marker::Send>(val: S) {
@ -52,7 +49,6 @@ LL | fn is_send<T: Send>(val: T) {}
LL | is_send(val);
| ^^^ `S` cannot be sent between threads safely
|
= help: the trait `std::marker::Send` is not implemented for `S`
help: consider further restricting this bound
|
LL | Sync + std::marker::Send
@ -67,7 +63,6 @@ LL | fn is_send<T: Send>(val: T) {}
LL | is_send(val);
| ^^^ `S` cannot be sent between threads safely
|
= help: the trait `std::marker::Send` is not implemented for `S`
help: consider further restricting this bound
|
LL | fn use_bound_and_where<S: Sync>(val: S) where S: std::fmt::Debug + std::marker::Send {
@ -82,7 +77,6 @@ LL | fn is_send<T: Send>(val: T) {}
LL | is_send(val);
| ^^^ `S` cannot be sent between threads safely
|
= help: the trait `std::marker::Send` is not implemented for `S`
help: consider restricting type parameter `S`
|
LL | fn use_unbound<S: std::marker::Send>(val: S) {

View File

@ -11,8 +11,6 @@ LL | mem::size_of::<U>();
|
LL | pub const fn size_of<T>() -> usize {
| - required by this bound in `std::mem::size_of`
|
= help: the trait `std::marker::Sized` is not implemented for `U`
error[E0277]: the size for values of type `U` cannot be known at compilation time
--> $DIR/trait-suggest-where-clause.rs:10:5
@ -28,7 +26,6 @@ LL | mem::size_of::<Misc<U>>();
LL | pub const fn size_of<T>() -> usize {
| - required by this bound in `std::mem::size_of`
|
= help: within `Misc<U>`, the trait `std::marker::Sized` is not implemented for `U`
= note: required because it appears within the type `Misc<U>`
error[E0277]: the trait bound `u64: std::convert::From<T>` is not satisfied

View File

@ -19,7 +19,6 @@ LL | type Underconstrained<T: std::fmt::Debug> = impl 'static;
LL | 5u32
| ---- this returned value is of type `u32`
|
= help: the trait `std::fmt::Debug` is not implemented for `U`
= note: the return type of a function must have a statically known size
help: consider restricting type parameter `U`
|
@ -35,7 +34,6 @@ LL | type Underconstrained2<T: std::fmt::Debug> = impl 'static;
LL | 5u32
| ---- this returned value is of type `u32`
|
= help: the trait `std::fmt::Debug` is not implemented for `V`
= note: the return type of a function must have a statically known size
help: consider restricting type parameter `V`
|

View File

@ -7,7 +7,6 @@ LL | is_send::<T>()
LL | fn is_send<T:Send>() {
| ---- required by this bound in `is_send`
|
= help: the trait `std::marker::Send` is not implemented for `T`
help: consider restricting type parameter `T`
|
LL | fn foo<T: std::marker::Send>() {

View File

@ -6,7 +6,6 @@ LL | union Foo<T: ?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: no field of a union 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
@ -26,7 +25,6 @@ LL | struct Foo2<T: ?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: only the last field of a struct 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
@ -46,7 +44,6 @@ LL | enum Foo3<T: ?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: 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

View File

@ -7,8 +7,6 @@ LL | fn foo<T: ?Sized>() { bar::<T>() }
| - ^ doesn't have a size known at compile-time
| |
| this type parameter needs to be `std::marker::Sized`
|
= help: the trait `std::marker::Sized` is not implemented for `T`
error: aborting due to previous error

View File

@ -9,7 +9,6 @@ LL | fn foo2<T: ?Sized>() { not_sized::<Foo<T>>() }
| |
| this type parameter needs to be `std::marker::Sized`
|
= help: the trait `std::marker::Sized` is not implemented for `T`
help: you could relax the implicit `Sized` bound on `U` if it were used through indirection like `&U` or `Box<U>`
--> $DIR/unsized-enum.rs:4:10
|

View File

@ -7,7 +7,6 @@ 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: 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
@ -28,7 +27,6 @@ LL | enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?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: 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
@ -49,7 +47,6 @@ LL | enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?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: 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
@ -70,7 +67,6 @@ LL | enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?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: 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

View File

@ -9,7 +9,6 @@ LL | impl<X: ?Sized> S5<X> {
| |
| this type parameter needs to be `std::marker::Sized`
|
= help: the trait `std::marker::Sized` is not implemented for `X`
help: you could relax the implicit `Sized` bound on `Y` if it were used through indirection like `&Y` or `Box<Y>`
--> $DIR/unsized-inherent-impl-self-type.rs:5:11
|

View File

@ -9,7 +9,6 @@ LL | fn foo2<T: ?Sized>() { not_sized::<Foo<T>>() }
| |
| this type parameter needs to be `std::marker::Sized`
|
= help: the trait `std::marker::Sized` is not implemented for `T`
help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
--> $DIR/unsized-struct.rs:4:12
|
@ -29,7 +28,6 @@ LL | fn bar2<T: ?Sized>() { is_sized::<Bar<T>>() }
| |
| this type parameter needs to be `std::marker::Sized`
|
= help: within `Bar<T>`, the trait `std::marker::Sized` is not implemented for `T`
= note: required because it appears within the type `Bar<T>`
error: aborting due to 2 previous errors

View File

@ -9,7 +9,6 @@ LL | impl<X: ?Sized> T3<X> for S5<X> {
| |
| this type parameter needs to be `std::marker::Sized`
|
= help: the trait `std::marker::Sized` is not implemented for `X`
help: you could relax the implicit `Sized` bound on `Y` if it were used through indirection like `&Y` or `Box<Y>`
--> $DIR/unsized-trait-impl-self-type.rs:8:11
|

View File

@ -9,7 +9,6 @@ LL | impl<X: ?Sized> T2<X> for S4<X> {
| |
| this type parameter needs to be `std::marker::Sized`
|
= help: the trait `std::marker::Sized` is not implemented for `X`
help: consider relaxing the implicit `Sized` restriction
|
LL | trait T2<Z: ?Sized> {

View File

@ -9,7 +9,6 @@ LL | f2::<X>(x);
LL | fn f2<X>(x: &X) {
| - required by this bound in `f2`
|
= help: the trait `std::marker::Sized` is not implemented for `X`
help: consider relaxing the implicit `Sized` restriction
|
LL | fn f2<X: ?Sized>(x: &X) {
@ -26,7 +25,6 @@ LL | f4::<X>(x);
LL | fn f4<X: T>(x: &X) {
| - required by this bound in `f4`
|
= help: the trait `std::marker::Sized` is not implemented for `X`
help: consider relaxing the implicit `Sized` restriction
|
LL | fn f4<X: T + ?Sized>(x: &X) {
@ -43,7 +41,6 @@ LL | fn f8<X: ?Sized>(x1: &S<X>, x2: &S<X>) {
LL | f5(x1);
| ^^ doesn't have a size known at compile-time
|
= help: within `S<X>`, the trait `std::marker::Sized` is not implemented for `X`
= note: required because it appears within the type `S<X>`
help: consider relaxing the implicit `Sized` restriction
|
@ -58,7 +55,6 @@ LL | fn f9<X: ?Sized>(x1: Box<S<X>>) {
LL | f5(&(*x1, 34));
| ^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: within `S<X>`, the trait `std::marker::Sized` is not implemented for `X`
= note: required because it appears within the type `S<X>`
= note: only the last element of a tuple may have a dynamically sized type
@ -70,7 +66,6 @@ LL | fn f10<X: ?Sized>(x1: Box<S<X>>) {
LL | f5(&(32, *x1));
| ^^^^^^^^^ doesn't have a size known at compile-time
|
= help: within `({integer}, S<X>)`, the trait `std::marker::Sized` is not implemented for `X`
= note: required because it appears within the type `S<X>`
= note: required because it appears within the type `({integer}, S<X>)`
= note: tuples must have a statically known size to be initialized
@ -86,7 +81,6 @@ LL | fn f10<X: ?Sized>(x1: Box<S<X>>) {
LL | f5(&(32, *x1));
| ^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: within `({integer}, S<X>)`, the trait `std::marker::Sized` is not implemented for `X`
= note: required because it appears within the type `S<X>`
= note: required because it appears within the type `({integer}, S<X>)`
help: consider relaxing the implicit `Sized` restriction

View File

@ -6,7 +6,6 @@ LL | struct S1<X: ?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: only the last field of a struct 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
@ -27,7 +26,6 @@ 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: only the last field of a struct 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
@ -83,7 +81,6 @@ LL | enum E<X: ?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: 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
@ -103,7 +100,6 @@ LL | enum F<X: ?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: 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

View File

@ -7,7 +7,6 @@ LL | fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
LL | let y: Y;
| ^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `Y`
= note: all local variables must have a statically known size
= help: unsized locals are gated as an unstable feature
@ -20,7 +19,6 @@ LL | let _: W; // <-- this is OK, no bindings created, no initializer.
LL | let _: (isize, (X, isize));
| ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `X`
= note: only the last element of a tuple may have a dynamically sized type
error[E0277]: the size for values of type `Z` cannot be known at compilation time
@ -32,7 +30,6 @@ LL | fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
LL | let y: (isize, (Z, usize));
| ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `Z`
= note: only the last element of a tuple may have a dynamically sized type
error[E0277]: the size for values of type `X` cannot be known at compilation time
@ -43,7 +40,6 @@ LL | fn f2<X: ?Sized, Y: ?Sized>(x: &X) {
LL | let y: X;
| ^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `X`
= note: all local variables must have a statically known size
= help: unsized locals are gated as an unstable feature
@ -56,7 +52,6 @@ LL | fn f2<X: ?Sized, Y: ?Sized>(x: &X) {
LL | let y: (isize, (Y, isize));
| ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `Y`
= note: only the last element of a tuple may have a dynamically sized type
error[E0277]: the size for values of type `X` cannot be known at compilation time
@ -67,7 +62,6 @@ LL | fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
LL | let y: X = *x1;
| ^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `X`
= note: all local variables must have a statically known size
= help: unsized locals are gated as an unstable feature
@ -80,7 +74,6 @@ LL | fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
LL | let y = *x2;
| ^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `X`
= note: all local variables must have a statically known size
= help: unsized locals are gated as an unstable feature
@ -93,7 +86,6 @@ LL | fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
LL | let (y, z) = (*x3, 4);
| ^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `X`
= note: all local variables must have a statically known size
= help: unsized locals are gated as an unstable feature
@ -105,7 +97,6 @@ LL | fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
LL | let y: X = *x1;
| ^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `X`
= note: all local variables must have a statically known size
= help: unsized locals are gated as an unstable feature
@ -118,7 +109,6 @@ LL | fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
LL | let y = *x2;
| ^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `X`
= note: all local variables must have a statically known size
= help: unsized locals are gated as an unstable feature
@ -131,7 +121,6 @@ LL | fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
LL | let (y, z) = (*x3, 4);
| ^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `X`
= note: all local variables must have a statically known size
= help: unsized locals are gated as an unstable feature
@ -143,7 +132,6 @@ LL | fn g1<X: ?Sized>(x: X) {}
| |
| this type parameter needs to be `std::marker::Sized`
|
= help: the trait `std::marker::Sized` is not implemented for `X`
= help: unsized locals are gated as an unstable feature
help: function arguments must have a statically known size, borrowed types always have a known size
|
@ -158,7 +146,6 @@ LL | fn g2<X: ?Sized + T>(x: X) {}
| |
| this type parameter needs to be `std::marker::Sized`
|
= help: the trait `std::marker::Sized` is not implemented for `X`
= help: unsized locals are gated as an unstable feature
help: function arguments must have a statically known size, borrowed types always have a known size
|

View File

@ -9,7 +9,6 @@ LL | impl<X: ?Sized + T> T1<X> for S3<X> {
| |
| this type parameter needs to be `std::marker::Sized`
|
= help: the trait `std::marker::Sized` is not implemented for `X`
help: consider relaxing the implicit `Sized` restriction
|
LL | trait T1<Z: T + ?Sized> {