1
Fork 0

Rollup merge of #83673 - hi-rustin:rustin-patch-suggestion, r=estebank

give full path of constraint in suggest_constraining_type_param

close https://github.com/rust-lang/rust/issues/83513
This commit is contained in:
Dylan DPC 2021-04-02 19:57:32 +02:00 committed by GitHub
commit 6cb74ad99f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
90 changed files with 249 additions and 247 deletions

View file

@ -28,6 +28,7 @@ use std::fmt;
use super::InferCtxtPrivExt; use super::InferCtxtPrivExt;
use crate::traits::query::evaluate_obligation::InferCtxtExt as _; use crate::traits::query::evaluate_obligation::InferCtxtExt as _;
use rustc_middle::ty::print::with_no_trimmed_paths;
#[derive(Debug)] #[derive(Debug)]
pub enum GeneratorInteriorOrUpvar { pub enum GeneratorInteriorOrUpvar {
@ -440,7 +441,8 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
{ {
// Missing generic type parameter bound. // Missing generic type parameter bound.
let param_name = self_ty.to_string(); let param_name = self_ty.to_string();
let constraint = trait_ref.print_only_trait_path().to_string(); let constraint =
with_no_trimmed_paths(|| trait_ref.print_only_trait_path().to_string());
if suggest_constraining_type_param( if suggest_constraining_type_param(
self.tcx, self.tcx,
generics, generics,

View file

@ -31,8 +31,8 @@ LL | type Bar: Clone = Vec<T>;
= note: required because of the requirements on the impl of `Clone` for `Vec<T>` = note: required because of the requirements on the impl of `Clone` for `Vec<T>`
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | trait Foo<T: Clone> { LL | trait Foo<T: std::clone::Clone> {
| ^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error[E0277]: the trait bound `(): Foo<Self>` is not satisfied error[E0277]: the trait bound `(): Foo<Self>` is not satisfied
--> $DIR/defaults-suitability.rs:34:5 --> $DIR/defaults-suitability.rs:34:5
@ -99,8 +99,8 @@ LL | type Baz = T;
| |
help: consider further restricting type parameter `T` help: consider further restricting type parameter `T`
| |
LL | Self::Baz: Clone, T: Clone LL | Self::Baz: Clone, T: std::clone::Clone
| ^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 8 previous errors error: aborting due to 8 previous errors

View file

@ -9,8 +9,8 @@ LL | copy::<dyn Setup<From=T>>(t)
| |
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | pub fn copy_any<T: Copy>(t: &T) -> T { LL | pub fn copy_any<T: std::marker::Copy>(t: &T) -> T {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -9,8 +9,8 @@ LL | type Assoc = T;
| |
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | impl<T: Copy> Complete for T { LL | impl<T: std::marker::Copy> Complete for T {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -11,8 +11,8 @@ LL | async { (ty, ty1) }
| ^^^ has type `U` which is not `Send` | ^^^ has type `U` which is not `Send`
help: consider restricting type parameter `U` help: consider restricting type parameter `U`
| |
LL | fn foo<T: Send, U: Send>(ty: T, ty1: U) -> impl Future<Output = (T, U)> + Send { LL | fn foo<T: Send, U: std::marker::Send>(ty: T, ty1: U) -> impl Future<Output = (T, U)> + Send {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -6,8 +6,8 @@ LL | 1.bar::<T>();
| |
help: consider further restricting this bound help: consider further restricting this bound
| |
LL | fn foo<T:'static + Send>() { LL | fn foo<T:'static + std::marker::Send>() {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -5,37 +5,37 @@ use std::fmt::Debug;
// Rustfix should add this, or use `std::fmt::Debug` instead. // Rustfix should add this, or use `std::fmt::Debug` instead.
#[allow(dead_code)] #[allow(dead_code)]
fn test_impl(t: impl Sized + Debug) { fn test_impl(t: impl Sized + std::fmt::Debug) {
println!("{:?}", t); println!("{:?}", t);
//~^ ERROR doesn't implement //~^ ERROR doesn't implement
} }
#[allow(dead_code)] #[allow(dead_code)]
fn test_no_bounds<T: Debug>(t: T) { fn test_no_bounds<T: std::fmt::Debug>(t: T) {
println!("{:?}", t); println!("{:?}", t);
//~^ ERROR doesn't implement //~^ ERROR doesn't implement
} }
#[allow(dead_code)] #[allow(dead_code)]
fn test_one_bound<T: Sized + Debug>(t: T) { fn test_one_bound<T: Sized + std::fmt::Debug>(t: T) {
println!("{:?}", t); println!("{:?}", t);
//~^ ERROR doesn't implement //~^ ERROR doesn't implement
} }
#[allow(dead_code)] #[allow(dead_code)]
fn test_no_bounds_where<X, Y>(x: X, y: Y) where X: std::fmt::Debug, Y: Debug { fn test_no_bounds_where<X, Y>(x: X, y: Y) where X: std::fmt::Debug, Y: std::fmt::Debug {
println!("{:?} {:?}", x, y); println!("{:?} {:?}", x, y);
//~^ ERROR doesn't implement //~^ ERROR doesn't implement
} }
#[allow(dead_code)] #[allow(dead_code)]
fn test_one_bound_where<X>(x: X) where X: Sized + Debug { fn test_one_bound_where<X>(x: X) where X: Sized + std::fmt::Debug {
println!("{:?}", x); println!("{:?}", x);
//~^ ERROR doesn't implement //~^ ERROR doesn't implement
} }
#[allow(dead_code)] #[allow(dead_code)]
fn test_many_bounds_where<X>(x: X) where X: Sized, X: Sized, X: Debug { fn test_many_bounds_where<X>(x: X) where X: Sized, X: Sized, X: std::fmt::Debug {
println!("{:?}", x); println!("{:?}", x);
//~^ ERROR doesn't implement //~^ ERROR doesn't implement
} }

View file

@ -8,8 +8,8 @@ LL | println!("{:?}", t);
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider further restricting this bound help: consider further restricting this bound
| |
LL | fn test_impl(t: impl Sized + Debug) { LL | fn test_impl(t: impl Sized + std::fmt::Debug) {
| ^^^^^^^ | ^^^^^^^^^^^^^^^^^
error[E0277]: `T` doesn't implement `Debug` error[E0277]: `T` doesn't implement `Debug`
--> $DIR/bound-suggestions.rs:15:22 --> $DIR/bound-suggestions.rs:15:22
@ -21,8 +21,8 @@ LL | println!("{:?}", t);
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | fn test_no_bounds<T: Debug>(t: T) { LL | fn test_no_bounds<T: std::fmt::Debug>(t: T) {
| ^^^^^^^ | ^^^^^^^^^^^^^^^^^
error[E0277]: `T` doesn't implement `Debug` error[E0277]: `T` doesn't implement `Debug`
--> $DIR/bound-suggestions.rs:21:22 --> $DIR/bound-suggestions.rs:21:22
@ -34,8 +34,8 @@ LL | println!("{:?}", t);
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider further restricting this bound help: consider further restricting this bound
| |
LL | fn test_one_bound<T: Sized + Debug>(t: T) { LL | fn test_one_bound<T: Sized + std::fmt::Debug>(t: T) {
| ^^^^^^^ | ^^^^^^^^^^^^^^^^^
error[E0277]: `Y` doesn't implement `Debug` error[E0277]: `Y` doesn't implement `Debug`
--> $DIR/bound-suggestions.rs:27:30 --> $DIR/bound-suggestions.rs:27:30
@ -47,8 +47,8 @@ LL | println!("{:?} {:?}", x, y);
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) = 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` help: consider further restricting type parameter `Y`
| |
LL | fn test_no_bounds_where<X, Y>(x: X, y: Y) where X: std::fmt::Debug, Y: Debug { LL | fn test_no_bounds_where<X, Y>(x: X, y: Y) where X: std::fmt::Debug, Y: std::fmt::Debug {
| ^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^
error[E0277]: `X` doesn't implement `Debug` error[E0277]: `X` doesn't implement `Debug`
--> $DIR/bound-suggestions.rs:33:22 --> $DIR/bound-suggestions.rs:33:22
@ -60,8 +60,8 @@ LL | println!("{:?}", x);
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider further restricting this bound help: consider further restricting this bound
| |
LL | fn test_one_bound_where<X>(x: X) where X: Sized + Debug { LL | fn test_one_bound_where<X>(x: X) where X: Sized + std::fmt::Debug {
| ^^^^^^^ | ^^^^^^^^^^^^^^^^^
error[E0277]: `X` doesn't implement `Debug` error[E0277]: `X` doesn't implement `Debug`
--> $DIR/bound-suggestions.rs:39:22 --> $DIR/bound-suggestions.rs:39:22
@ -73,8 +73,8 @@ LL | println!("{:?}", x);
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) = 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` help: consider further restricting type parameter `X`
| |
LL | fn test_many_bounds_where<X>(x: X) where X: Sized, X: Sized, X: Debug { LL | fn test_many_bounds_where<X>(x: X) where X: Sized, X: Sized, X: std::fmt::Debug {
| ^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^
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/bound-suggestions.rs:44:46 --> $DIR/bound-suggestions.rs:44:46

View file

@ -10,8 +10,8 @@ LL | impl <T: Sync+'static> Foo for (T,) { }
= note: required because it appears within the type `(T,)` = note: required because it appears within the type `(T,)`
help: consider further restricting this bound help: consider further restricting this bound
| |
LL | impl <T: Sync+'static + Send> Foo for (T,) { } LL | impl <T: Sync+'static + std::marker::Send> Foo for (T,) { }
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error[E0277]: `T` cannot be shared between threads safely error[E0277]: `T` cannot be shared between threads safely
--> $DIR/builtin-superkinds-double-superkind.rs:9:16 --> $DIR/builtin-superkinds-double-superkind.rs:9:16
@ -25,8 +25,8 @@ LL | impl <T: Send> Foo for (T,T) { }
= note: required because it appears within the type `(T, T)` = note: required because it appears within the type `(T, T)`
help: consider further restricting this bound help: consider further restricting this bound
| |
LL | impl <T: Send + Sync> Foo for (T,T) { } LL | impl <T: Send + std::marker::Sync> Foo for (T,T) { }
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -12,8 +12,8 @@ LL | pub trait RequiresRequiresShareAndSend : RequiresShare + Send { }
= note: required because it appears within the type `X<T>` = note: required because it appears within the type `X<T>`
help: consider further restricting this bound help: consider further restricting this bound
| |
LL | impl <T:Sync+'static + Send> RequiresRequiresShareAndSend for X<T> { } LL | impl <T:Sync+'static + std::marker::Send> RequiresRequiresShareAndSend for X<T> { }
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -9,8 +9,8 @@ LL | impl <T: Sync+'static> Foo for T { }
| |
help: consider further restricting this bound help: consider further restricting this bound
| |
LL | impl <T: Sync+'static + Send> Foo for T { } LL | impl <T: Sync+'static + std::marker::Send> Foo for T { }
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -9,8 +9,8 @@ LL | fn foo<F>(blk: F) -> X<F> where F: FnOnce() + 'static {
| |
help: consider further restricting this bound help: consider further restricting this bound
| |
LL | fn foo<F>(blk: F) -> X<F> where F: FnOnce() + 'static + Send { LL | fn foo<F>(blk: F) -> X<F> where F: FnOnce() + 'static + std::marker::Send {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -9,8 +9,8 @@ LL | take_const_owned(f);
| |
help: consider further restricting this bound help: consider further restricting this bound
| |
LL | fn give_owned<F>(f: F) where F: FnOnce() + Send + Sync { LL | fn give_owned<F>(f: F) where F: FnOnce() + Send + std::marker::Sync {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -2,7 +2,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim
--> $DIR/const-argument-if-length.rs:7:28 --> $DIR/const-argument-if-length.rs:7:28
| |
LL | pub const fn is_zst<T: ?Sized>() -> usize { LL | pub const fn is_zst<T: ?Sized>() -> usize {
| - this type parameter needs to be `Sized` | - this type parameter needs to be `std::marker::Sized`
LL | if std::mem::size_of::<T>() == 0 { LL | if std::mem::size_of::<T>() == 0 {
| ^ doesn't have a size known at compile-time | ^ doesn't have a size known at compile-time
| |
@ -15,7 +15,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim
--> $DIR/const-argument-if-length.rs:16:12 --> $DIR/const-argument-if-length.rs:16:12
| |
LL | pub struct AtLeastByte<T: ?Sized> { LL | pub struct AtLeastByte<T: ?Sized> {
| - this type parameter needs to be `Sized` | - this type parameter needs to be `std::marker::Sized`
LL | value: T, LL | value: T,
| ^ doesn't have a size known at compile-time | ^ doesn't have a size known at compile-time
| |

View file

@ -11,7 +11,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim
--> $DIR/const-argument-if-length.rs:16:12 --> $DIR/const-argument-if-length.rs:16:12
| |
LL | pub struct AtLeastByte<T: ?Sized> { LL | pub struct AtLeastByte<T: ?Sized> {
| - this type parameter needs to be `Sized` | - this type parameter needs to be `std::marker::Sized`
LL | value: T, LL | value: T,
| ^ doesn't have a size known at compile-time | ^ doesn't have a size known at compile-time
| |

View file

@ -16,8 +16,8 @@ LL | [x; { N }]
= note: the `Copy` trait is required because the repeated element will be copied = note: the `Copy` trait is required because the repeated element will be copied
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | fn g<T: Copy, const N: usize>(x: T) -> [T; N] { LL | fn g<T: std::marker::Copy, const N: usize>(x: T) -> [T; N] {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error; 1 warning emitted error: aborting due to previous error; 1 warning emitted

View file

@ -7,8 +7,8 @@ LL | [x; { N }]
= note: the `Copy` trait is required because the repeated element will be copied = note: the `Copy` trait is required because the repeated element will be copied
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | fn g<T: Copy, const N: usize>(x: T) -> [T; N] { LL | fn g<T: std::marker::Copy, const N: usize>(x: T) -> [T; N] {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -16,8 +16,8 @@ LL | [x; N]
= note: the `Copy` trait is required because the repeated element will be copied = note: the `Copy` trait is required because the repeated element will be copied
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | fn g<T: Copy, const N: usize>(x: T) -> [T; N] { LL | fn g<T: std::marker::Copy, const N: usize>(x: T) -> [T; N] {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error; 1 warning emitted error: aborting due to previous error; 1 warning emitted

View file

@ -7,8 +7,8 @@ LL | [x; N]
= note: the `Copy` trait is required because the repeated element will be copied = note: the `Copy` trait is required because the repeated element will be copied
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | fn g<T: Copy, const N: usize>(x: T) -> [T; N] { LL | fn g<T: std::marker::Copy, const N: usize>(x: T) -> [T; N] {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -2,7 +2,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim
--> $DIR/dst-object-from-unsized-type.rs:8:23 --> $DIR/dst-object-from-unsized-type.rs:8:23
| |
LL | fn test1<T: ?Sized + Foo>(t: &T) { LL | fn test1<T: ?Sized + Foo>(t: &T) {
| - this type parameter needs to be `Sized` | - this type parameter needs to be `std::marker::Sized`
LL | let u: &dyn Foo = t; LL | let u: &dyn Foo = t;
| ^ doesn't have a size known at compile-time | ^ doesn't have a size known at compile-time
| |
@ -12,7 +12,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim
--> $DIR/dst-object-from-unsized-type.rs:13:23 --> $DIR/dst-object-from-unsized-type.rs:13:23
| |
LL | fn test2<T: ?Sized + Foo>(t: &T) { LL | fn test2<T: ?Sized + Foo>(t: &T) {
| - this type parameter needs to be `Sized` | - this type parameter needs to be `std::marker::Sized`
LL | let v: &dyn Foo = t as &dyn Foo; LL | let v: &dyn Foo = t as &dyn Foo;
| ^ doesn't have a size known at compile-time | ^ doesn't have a size known at compile-time
| |

View file

@ -69,8 +69,8 @@ LL | type Pointer2<U32> = Box<U32>;
| |
help: consider restricting type parameter `U32` help: consider restricting type parameter `U32`
| |
LL | type Pointer2<U32: Clone> = Box<U32>; LL | type Pointer2<U32: std::clone::Clone> = Box<U32>;
| ^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to 8 previous errors error: aborting due to 8 previous errors

View file

@ -51,8 +51,8 @@ LL | type C where Self: Copy = String;
= note: the requirement `Fooy<T>: Copy` appears on the associated impl type but not on the corresponding associated trait type = note: the requirement `Fooy<T>: Copy` appears on the associated impl type but not on the corresponding associated trait type
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | impl<T: Copy> Foo for Fooy<T> { LL | impl<T: std::marker::Copy> Foo for Fooy<T> {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to 4 previous errors error: aborting due to 4 previous errors

View file

@ -18,8 +18,8 @@ LL | type Item<'a> = T;
| |
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | impl<T: Copy> UnsafeCopy for T { LL | impl<T: std::marker::Copy> UnsafeCopy for T {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error; 1 warning emitted error: aborting due to previous error; 1 warning emitted

View file

@ -19,8 +19,8 @@ LL | type F<'a> = Self;
= note: wrap the `T` in a closure with no arguments: `|| { /* code */ }` = note: wrap the `T` in a closure with no arguments: `|| { /* code */ }`
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | impl<T: Fn<()>> Fun for T { LL | impl<T: std::ops::Fn<()>> Fun for T {
| ^^^^^^^^ | ^^^^^^^^^^^^^^^^^^
error: aborting due to previous error; 1 warning emitted error: aborting due to previous error; 1 warning emitted

View file

@ -19,8 +19,8 @@ LL | type F<'a> = Self;
= note: wrap the `T` in a closure with no arguments: `|| { /* code */ }` = note: wrap the `T` in a closure with no arguments: `|| { /* code */ }`
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | impl<T: Fn<()>> Fun for T { LL | impl<T: std::ops::Fn<()>> Fun for T {
| ^^^^^^^^ | ^^^^^^^^^^^^^^^^^^
error: aborting due to previous error; 1 warning emitted error: aborting due to previous error; 1 warning emitted

View file

@ -19,8 +19,8 @@ LL | type F<'a> = Self;
= note: wrap the `T` in a closure with no arguments: `|| { /* code */ }` = note: wrap the `T` in a closure with no arguments: `|| { /* code */ }`
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | impl<T: Fn<()>> Fun for T { LL | impl<T: std::ops::Fn<()>> Fun for T {
| ^^^^^^^^ | ^^^^^^^^^^^^^^^^^^
error: aborting due to previous error; 1 warning emitted error: aborting due to previous error; 1 warning emitted

View file

@ -19,8 +19,8 @@ LL | type F<'a> = Self;
= note: wrap the `T` in a closure with no arguments: `|| { /* code */ }` = note: wrap the `T` in a closure with no arguments: `|| { /* code */ }`
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | impl<T: Fn<()>> Fun for T { LL | impl<T: std::ops::Fn<()>> Fun for T {
| ^^^^^^^^ | ^^^^^^^^^^^^^^^^^^
error: aborting due to previous error; 1 warning emitted error: aborting due to previous error; 1 warning emitted

View file

@ -19,8 +19,8 @@ LL | type Copy<T>: Copy = Box<T>;
= note: required because of the requirements on the impl of `Clone` for `Box<T>` = note: required because of the requirements on the impl of `Clone` for `Box<T>`
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | type Copy<T: Clone>: Copy = Box<T>; LL | type Copy<T: std::clone::Clone>: Copy = Box<T>;
| ^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -25,8 +25,8 @@ LL | type E = impl Copy;
= note: required because it appears within the type `(S, T)` = note: required because it appears within the type `(S, T)`
help: consider further restricting this bound help: consider further restricting this bound
| |
LL | impl<S: Default + Copy> Bar for S { LL | impl<S: Default + std::marker::Copy> Bar for S {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error[E0277]: the trait bound `T: Copy` is not satisfied in `(S, T)` error[E0277]: the trait bound `T: Copy` is not satisfied in `(S, T)`
--> $DIR/issue-55872-1.rs:14:14 --> $DIR/issue-55872-1.rs:14:14
@ -37,8 +37,8 @@ LL | type E = impl Copy;
= note: required because it appears within the type `(S, T)` = note: required because it appears within the type `(S, T)`
help: consider further restricting this bound help: consider further restricting this bound
| |
LL | fn foo<T: Default + Copy>() -> Self::E { LL | fn foo<T: Default + std::marker::Copy>() -> Self::E {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
--> $DIR/issue-55872-1.rs:18:37 --> $DIR/issue-55872-1.rs:18:37

View file

@ -16,8 +16,8 @@ LL | type E = impl Copy;
= note: required because it appears within the type `(S, T)` = note: required because it appears within the type `(S, T)`
help: consider further restricting this bound help: consider further restricting this bound
| |
LL | impl<S: Default + Copy> Bar for S { LL | impl<S: Default + std::marker::Copy> Bar for S {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error[E0277]: the trait bound `T: Copy` is not satisfied in `(S, T)` error[E0277]: the trait bound `T: Copy` is not satisfied in `(S, T)`
--> $DIR/issue-55872-1.rs:14:14 --> $DIR/issue-55872-1.rs:14:14
@ -28,8 +28,8 @@ LL | type E = impl Copy;
= note: required because it appears within the type `(S, T)` = note: required because it appears within the type `(S, T)`
help: consider further restricting this bound help: consider further restricting this bound
| |
LL | fn foo<T: Default + Copy>() -> Self::E { LL | fn foo<T: Default + std::marker::Copy>() -> Self::E {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
--> $DIR/issue-55872-1.rs:18:37 --> $DIR/issue-55872-1.rs:18:37

View file

@ -2,7 +2,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim
--> $DIR/issue-27060-2.rs:3:11 --> $DIR/issue-27060-2.rs:3:11
| |
LL | pub struct Bad<T: ?Sized> { LL | pub struct Bad<T: ?Sized> {
| - this type parameter needs to be `Sized` | - this type parameter needs to be `std::marker::Sized`
LL | data: T, LL | data: T,
| ^ doesn't have a size known at compile-time | ^ doesn't have a size known at compile-time
| |

View file

@ -9,8 +9,8 @@ LL | impl<T> Complete for T {}
| |
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | impl<T: Copy> Complete for T {} LL | impl<T: std::marker::Copy> Complete for T {}
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -8,8 +8,8 @@ LL | let a = &t as &dyn Gettable<T>;
= note: required for the cast to the object type `dyn Gettable<T>` = note: required for the cast to the object type `dyn Gettable<T>`
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | fn f<T: Send>(val: T) { LL | fn f<T: std::marker::Send>(val: T) {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error[E0277]: the trait bound `T: Copy` is not satisfied error[E0277]: the trait bound `T: Copy` is not satisfied
--> $DIR/kindck-impl-type-params.rs:18:13 --> $DIR/kindck-impl-type-params.rs:18:13
@ -21,8 +21,8 @@ LL | let a = &t as &dyn Gettable<T>;
= note: required for the cast to the object type `dyn Gettable<T>` = note: required for the cast to the object type `dyn Gettable<T>`
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | fn f<T: Copy>(val: T) { LL | fn f<T: std::marker::Copy>(val: T) {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error[E0277]: `T` cannot be sent between threads safely error[E0277]: `T` cannot be sent between threads safely
--> $DIR/kindck-impl-type-params.rs:25:31 --> $DIR/kindck-impl-type-params.rs:25:31
@ -34,8 +34,8 @@ LL | let a: &dyn Gettable<T> = &t;
= note: required for the cast to the object type `dyn Gettable<T>` = note: required for the cast to the object type `dyn Gettable<T>`
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | fn g<T: Send>(val: T) { LL | fn g<T: std::marker::Send>(val: T) {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error[E0277]: the trait bound `T: Copy` is not satisfied error[E0277]: the trait bound `T: Copy` is not satisfied
--> $DIR/kindck-impl-type-params.rs:25:31 --> $DIR/kindck-impl-type-params.rs:25:31
@ -47,8 +47,8 @@ LL | let a: &dyn Gettable<T> = &t;
= note: required for the cast to the object type `dyn Gettable<T>` = note: required for the cast to the object type `dyn Gettable<T>`
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | fn g<T: Copy>(val: T) { LL | fn g<T: std::marker::Copy>(val: T) {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error[E0277]: the trait bound `String: Copy` is not satisfied error[E0277]: the trait bound `String: Copy` is not satisfied
--> $DIR/kindck-impl-type-params.rs:38:13 --> $DIR/kindck-impl-type-params.rs:38:13

View file

@ -8,8 +8,8 @@ LL | let a = &t as &dyn Gettable<T>;
= note: required for the cast to the object type `dyn Gettable<T>` = note: required for the cast to the object type `dyn Gettable<T>`
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | fn f<T: Send>(val: T) { LL | fn f<T: std::marker::Send>(val: T) {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error[E0277]: the trait bound `T: Copy` is not satisfied error[E0277]: the trait bound `T: Copy` is not satisfied
--> $DIR/kindck-impl-type-params.rs:18:13 --> $DIR/kindck-impl-type-params.rs:18:13
@ -21,8 +21,8 @@ LL | let a = &t as &dyn Gettable<T>;
= note: required for the cast to the object type `dyn Gettable<T>` = note: required for the cast to the object type `dyn Gettable<T>`
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | fn f<T: Copy>(val: T) { LL | fn f<T: std::marker::Copy>(val: T) {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error[E0277]: `T` cannot be sent between threads safely error[E0277]: `T` cannot be sent between threads safely
--> $DIR/kindck-impl-type-params.rs:25:31 --> $DIR/kindck-impl-type-params.rs:25:31
@ -34,8 +34,8 @@ LL | let a: &dyn Gettable<T> = &t;
= note: required for the cast to the object type `dyn Gettable<T>` = note: required for the cast to the object type `dyn Gettable<T>`
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | fn g<T: Send>(val: T) { LL | fn g<T: std::marker::Send>(val: T) {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error[E0277]: the trait bound `T: Copy` is not satisfied error[E0277]: the trait bound `T: Copy` is not satisfied
--> $DIR/kindck-impl-type-params.rs:25:31 --> $DIR/kindck-impl-type-params.rs:25:31
@ -47,8 +47,8 @@ LL | let a: &dyn Gettable<T> = &t;
= note: required for the cast to the object type `dyn Gettable<T>` = note: required for the cast to the object type `dyn Gettable<T>`
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | fn g<T: Copy>(val: T) { LL | fn g<T: std::marker::Copy>(val: T) {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error[E0477]: the type `&'a isize` does not fulfill the required lifetime error[E0477]: the type `&'a isize` does not fulfill the required lifetime
--> $DIR/kindck-impl-type-params.rs:32:13 --> $DIR/kindck-impl-type-params.rs:32:13

View file

@ -12,8 +12,8 @@ LL | is_zen(x)
= note: required because it appears within the type `Guard<'_, T>` = note: required because it appears within the type `Guard<'_, T>`
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | fn not_sync<T: Sync>(x: Guard<T>) { LL | fn not_sync<T: std::marker::Sync>(x: Guard<T>) {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error[E0277]: `T` cannot be shared between threads safely error[E0277]: `T` cannot be shared between threads safely
--> $DIR/phantom-auto-trait.rs:26:12 --> $DIR/phantom-auto-trait.rs:26:12
@ -30,8 +30,8 @@ LL | is_zen(x)
= note: required because it appears within the type `Nested<Guard<'_, T>>` = note: required because it appears within the type `Nested<Guard<'_, T>>`
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | fn nested_not_sync<T: Sync>(x: Nested<Guard<T>>) { LL | fn nested_not_sync<T: std::marker::Sync>(x: Nested<Guard<T>>) {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -28,8 +28,8 @@ LL | default type U<'a> = &'a T;
= note: required because of the requirements on the impl of `PartialEq` for `&'a T` = note: required because of the requirements on the impl of `PartialEq` for `&'a T`
help: consider further restricting this bound help: consider further restricting this bound
| |
LL | impl<T: 'static + PartialEq> X for T { LL | impl<T: 'static + std::cmp::PartialEq> X for T {
| ^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error; 2 warnings emitted error: aborting due to previous error; 2 warnings emitted

View file

@ -19,8 +19,8 @@ LL | default impl<U> Foo<'static, U> for () {}
| |
help: consider restricting type parameter `U` help: consider restricting type parameter `U`
| |
LL | default impl<U: Eq> Foo<'static, U> for () {} LL | default impl<U: std::cmp::Eq> Foo<'static, U> for () {}
| ^^^^ | ^^^^^^^^^^^^^^
error: aborting due to previous error; 1 warning emitted error: aborting due to previous error; 1 warning emitted

View file

@ -5,7 +5,7 @@ LL | struct X<T>(T);
| - required by this bound in `X` | - required by this bound in `X`
... ...
LL | struct Struct5<T: ?Sized>{ LL | struct Struct5<T: ?Sized>{
| - this type parameter needs to be `Sized` | - this type parameter needs to be `std::marker::Sized`
LL | _t: X<T>, LL | _t: X<T>,
| ^^^^ doesn't have a size known at compile-time | ^^^^ doesn't have a size known at compile-time
| |

View file

@ -9,8 +9,8 @@ LL | is_send(val);
| |
help: consider further restricting this bound help: consider further restricting this bound
| |
LL | fn use_impl_sync(val: impl Sync + Send) { LL | fn use_impl_sync(val: impl Sync + std::marker::Send) {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error[E0277]: `S` cannot be sent between threads safely error[E0277]: `S` cannot be sent between threads safely
--> $DIR/restrict-type-argument.rs:8:13 --> $DIR/restrict-type-argument.rs:8:13
@ -23,8 +23,8 @@ LL | is_send(val);
| |
help: consider further restricting this bound help: consider further restricting this bound
| |
LL | fn use_where<S>(val: S) where S: Sync + Send { LL | fn use_where<S>(val: S) where S: Sync + std::marker::Send {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error[E0277]: `S` cannot be sent between threads safely error[E0277]: `S` cannot be sent between threads safely
--> $DIR/restrict-type-argument.rs:12:13 --> $DIR/restrict-type-argument.rs:12:13
@ -37,8 +37,8 @@ LL | is_send(val);
| |
help: consider further restricting this bound help: consider further restricting this bound
| |
LL | fn use_bound<S: Sync + Send>(val: S) { LL | fn use_bound<S: Sync + std::marker::Send>(val: S) {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error[E0277]: `S` cannot be sent between threads safely error[E0277]: `S` cannot be sent between threads safely
--> $DIR/restrict-type-argument.rs:20:13 --> $DIR/restrict-type-argument.rs:20:13
@ -51,8 +51,8 @@ LL | is_send(val);
| |
help: consider further restricting this bound help: consider further restricting this bound
| |
LL | Sync + Send LL | Sync + std::marker::Send
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error[E0277]: `S` cannot be sent between threads safely error[E0277]: `S` cannot be sent between threads safely
--> $DIR/restrict-type-argument.rs:24:13 --> $DIR/restrict-type-argument.rs:24:13
@ -65,8 +65,8 @@ LL | is_send(val);
| |
help: consider further restricting this bound help: consider further restricting this bound
| |
LL | fn use_bound_and_where<S: Sync>(val: S) where S: std::fmt::Debug + Send { LL | fn use_bound_and_where<S: Sync>(val: S) where S: std::fmt::Debug + std::marker::Send {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error[E0277]: `S` cannot be sent between threads safely error[E0277]: `S` cannot be sent between threads safely
--> $DIR/restrict-type-argument.rs:28:13 --> $DIR/restrict-type-argument.rs:28:13
@ -79,8 +79,8 @@ LL | is_send(val);
| |
help: consider restricting type parameter `S` help: consider restricting type parameter `S`
| |
LL | fn use_unbound<S: Send>(val: S) { LL | fn use_unbound<S: std::marker::Send>(val: S) {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to 6 previous errors error: aborting due to 6 previous errors

View file

@ -10,7 +10,7 @@ struct ConstrainedStruct<X: Copy> {
} }
#[allow(dead_code)] #[allow(dead_code)]
trait InsufficientlyConstrainedGeneric<X=()> where X: Copy { trait InsufficientlyConstrainedGeneric<X=()> where X: std::marker::Copy {
fn return_the_constrained_type(&self, x: X) -> ConstrainedStruct<X> { fn return_the_constrained_type(&self, x: X) -> ConstrainedStruct<X> {
//~^ ERROR the trait bound `X: Copy` is not satisfied //~^ ERROR the trait bound `X: Copy` is not satisfied
ConstrainedStruct { x } ConstrainedStruct { x }

View file

@ -9,8 +9,8 @@ LL | fn return_the_constrained_type(&self, x: X) -> ConstrainedStruct<X> {
| |
help: consider further restricting type parameter `X` help: consider further restricting type parameter `X`
| |
LL | trait InsufficientlyConstrainedGeneric<X=()> where X: Copy { LL | trait InsufficientlyConstrainedGeneric<X=()> where X: std::marker::Copy {
| ^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -9,8 +9,8 @@ LL | type X = Self;
| |
help: consider further restricting this bound help: consider further restricting this bound
| |
LL | impl<T: Magic + Sync> Magic for T { LL | impl<T: Magic + std::marker::Sync> Magic for T {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error[E0275]: overflow evaluating the requirement `*mut (): Magic` error[E0275]: overflow evaluating the requirement `*mut (): Magic`
--> $DIR/two-traits.rs:20:5 --> $DIR/two-traits.rs:20:5

View file

@ -2,7 +2,7 @@ error[E0277]: the size for values of type `U` cannot be known at compilation tim
--> $DIR/suggest-where-clause.rs:7:20 --> $DIR/suggest-where-clause.rs:7:20
| |
LL | fn check<T: Iterator, U: ?Sized>() { LL | fn check<T: Iterator, U: ?Sized>() {
| - this type parameter needs to be `Sized` | - this type parameter needs to be `std::marker::Sized`
LL | // suggest a where-clause, if needed LL | // suggest a where-clause, if needed
LL | mem::size_of::<U>(); LL | mem::size_of::<U>();
| ^ doesn't have a size known at compile-time | ^ doesn't have a size known at compile-time
@ -16,7 +16,7 @@ error[E0277]: the size for values of type `U` cannot be known at compilation tim
--> $DIR/suggest-where-clause.rs:10:5 --> $DIR/suggest-where-clause.rs:10:5
| |
LL | fn check<T: Iterator, U: ?Sized>() { LL | fn check<T: Iterator, U: ?Sized>() {
| - this type parameter needs to be `Sized` | - this type parameter needs to be `std::marker::Sized`
... ...
LL | mem::size_of::<Misc<U>>(); LL | mem::size_of::<Misc<U>>();
| ^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | ^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time

View file

@ -15,8 +15,8 @@ LL | type X<T> = impl Clone;
| |
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | type X<T: Clone> = impl Clone; LL | type X<T: std::clone::Clone> = impl Clone;
| ^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error; 1 warning emitted error: aborting due to previous error; 1 warning emitted

View file

@ -6,8 +6,8 @@ LL | type X<T> = impl Clone;
| |
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | type X<T: Clone> = impl Clone; LL | type X<T: std::clone::Clone> = impl Clone;
| ^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -28,8 +28,8 @@ LL | type Two<T, U> = impl Debug;
= note: required because of the requirements on the impl of `Debug` for `(T, U)` = note: required because of the requirements on the impl of `Debug` for `(T, U)`
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | type Two<T: Debug, U> = impl Debug; LL | type Two<T: std::fmt::Debug, U> = impl Debug;
| ^^^^^^^ | ^^^^^^^^^^^^^^^^^
error[E0277]: `U` doesn't implement `Debug` error[E0277]: `U` doesn't implement `Debug`
--> $DIR/generic_duplicate_param_use5.rs:11:18 --> $DIR/generic_duplicate_param_use5.rs:11:18
@ -40,8 +40,8 @@ LL | type Two<T, U> = impl Debug;
= note: required because of the requirements on the impl of `Debug` for `(T, U)` = note: required because of the requirements on the impl of `Debug` for `(T, U)`
help: consider restricting type parameter `U` help: consider restricting type parameter `U`
| |
LL | type Two<T, U: Debug> = impl Debug; LL | type Two<T, U: std::fmt::Debug> = impl Debug;
| ^^^^^^^ | ^^^^^^^^^^^^^^^^^
error: aborting due to 3 previous errors; 1 warning emitted error: aborting due to 3 previous errors; 1 warning emitted

View file

@ -19,8 +19,8 @@ LL | type Two<T, U> = impl Debug;
= note: required because of the requirements on the impl of `Debug` for `(T, U)` = note: required because of the requirements on the impl of `Debug` for `(T, U)`
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | type Two<T: Debug, U> = impl Debug; LL | type Two<T: std::fmt::Debug, U> = impl Debug;
| ^^^^^^^ | ^^^^^^^^^^^^^^^^^
error[E0277]: `U` doesn't implement `Debug` error[E0277]: `U` doesn't implement `Debug`
--> $DIR/generic_duplicate_param_use5.rs:11:18 --> $DIR/generic_duplicate_param_use5.rs:11:18
@ -31,8 +31,8 @@ LL | type Two<T, U> = impl Debug;
= note: required because of the requirements on the impl of `Debug` for `(T, U)` = note: required because of the requirements on the impl of `Debug` for `(T, U)`
help: consider restricting type parameter `U` help: consider restricting type parameter `U`
| |
LL | type Two<T, U: Debug> = impl Debug; LL | type Two<T, U: std::fmt::Debug> = impl Debug;
| ^^^^^^^ | ^^^^^^^^^^^^^^^^^
error: aborting due to 3 previous errors error: aborting due to 3 previous errors

View file

@ -28,8 +28,8 @@ LL | type Two<T, U> = impl Debug;
= note: required because of the requirements on the impl of `Debug` for `(T, T)` = note: required because of the requirements on the impl of `Debug` for `(T, T)`
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | type Two<T: Debug, U> = impl Debug; LL | type Two<T: std::fmt::Debug, U> = impl Debug;
| ^^^^^^^ | ^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors; 1 warning emitted error: aborting due to 2 previous errors; 1 warning emitted

View file

@ -19,8 +19,8 @@ LL | type Two<T, U> = impl Debug;
= note: required because of the requirements on the impl of `Debug` for `(T, T)` = note: required because of the requirements on the impl of `Debug` for `(T, T)`
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | type Two<T: Debug, U> = impl Debug; LL | type Two<T: std::fmt::Debug, U> = impl Debug;
| ^^^^^^^ | ^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -28,8 +28,8 @@ LL | type Two<T, U> = impl Debug;
= note: required because of the requirements on the impl of `Debug` for `(T, u32)` = note: required because of the requirements on the impl of `Debug` for `(T, u32)`
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | type Two<T: Debug, U> = impl Debug; LL | type Two<T: std::fmt::Debug, U> = impl Debug;
| ^^^^^^^ | ^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors; 1 warning emitted error: aborting due to 2 previous errors; 1 warning emitted

View file

@ -19,8 +19,8 @@ LL | type Two<T, U> = impl Debug;
= note: required because of the requirements on the impl of `Debug` for `(T, u32)` = note: required because of the requirements on the impl of `Debug` for `(T, u32)`
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | type Two<T: Debug, U> = impl Debug; LL | type Two<T: std::fmt::Debug, U> = impl Debug;
| ^^^^^^^ | ^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -40,8 +40,8 @@ LL | type Two<A, B> = impl Debug;
= note: required because of the requirements on the impl of `Debug` for `(A, B, <A as Foo>::Bar)` = note: required because of the requirements on the impl of `Debug` for `(A, B, <A as Foo>::Bar)`
help: consider restricting type parameter `A` help: consider restricting type parameter `A`
| |
LL | type Two<A: Debug, B> = impl Debug; LL | type Two<A: std::fmt::Debug, B> = impl Debug;
| ^^^^^^^ | ^^^^^^^^^^^^^^^^^
error[E0277]: `B` doesn't implement `Debug` error[E0277]: `B` doesn't implement `Debug`
--> $DIR/generic_duplicate_param_use9.rs:10:18 --> $DIR/generic_duplicate_param_use9.rs:10:18
@ -52,8 +52,8 @@ LL | type Two<A, B> = impl Debug;
= note: required because of the requirements on the impl of `Debug` for `(A, B, <A as Foo>::Bar)` = note: required because of the requirements on the impl of `Debug` for `(A, B, <A as Foo>::Bar)`
help: consider restricting type parameter `B` help: consider restricting type parameter `B`
| |
LL | type Two<A, B: Debug> = impl Debug; LL | type Two<A, B: std::fmt::Debug> = impl Debug;
| ^^^^^^^ | ^^^^^^^^^^^^^^^^^
error: aborting due to 4 previous errors; 1 warning emitted error: aborting due to 4 previous errors; 1 warning emitted

View file

@ -31,8 +31,8 @@ LL | type Two<A, B> = impl Debug;
= note: required because of the requirements on the impl of `Debug` for `(A, B, <A as Foo>::Bar)` = note: required because of the requirements on the impl of `Debug` for `(A, B, <A as Foo>::Bar)`
help: consider restricting type parameter `A` help: consider restricting type parameter `A`
| |
LL | type Two<A: Debug, B> = impl Debug; LL | type Two<A: std::fmt::Debug, B> = impl Debug;
| ^^^^^^^ | ^^^^^^^^^^^^^^^^^
error[E0277]: `B` doesn't implement `Debug` error[E0277]: `B` doesn't implement `Debug`
--> $DIR/generic_duplicate_param_use9.rs:10:18 --> $DIR/generic_duplicate_param_use9.rs:10:18
@ -43,8 +43,8 @@ LL | type Two<A, B> = impl Debug;
= note: required because of the requirements on the impl of `Debug` for `(A, B, <A as Foo>::Bar)` = note: required because of the requirements on the impl of `Debug` for `(A, B, <A as Foo>::Bar)`
help: consider restricting type parameter `B` help: consider restricting type parameter `B`
| |
LL | type Two<A, B: Debug> = impl Debug; LL | type Two<A, B: std::fmt::Debug> = impl Debug;
| ^^^^^^^ | ^^^^^^^^^^^^^^^^^
error: aborting due to 4 previous errors error: aborting due to 4 previous errors

View file

@ -30,8 +30,8 @@ LL | fn underconstrained<U>(_: U) -> Underconstrained<U> {
| |
help: consider restricting type parameter `U` help: consider restricting type parameter `U`
| |
LL | fn underconstrained<U: Debug>(_: U) -> Underconstrained<U> { LL | fn underconstrained<U: std::fmt::Debug>(_: U) -> Underconstrained<U> {
| ^^^^^^^ | ^^^^^^^^^^^^^^^^^
error[E0277]: `V` doesn't implement `Debug` error[E0277]: `V` doesn't implement `Debug`
--> $DIR/generic_underconstrained2.rs:21:43 --> $DIR/generic_underconstrained2.rs:21:43
@ -44,8 +44,8 @@ LL | fn underconstrained2<U, V>(_: U, _: V) -> Underconstrained2<V> {
| |
help: consider restricting type parameter `V` help: consider restricting type parameter `V`
| |
LL | fn underconstrained2<U, V: Debug>(_: U, _: V) -> Underconstrained2<V> { LL | fn underconstrained2<U, V: std::fmt::Debug>(_: U, _: V) -> Underconstrained2<V> {
| ^^^^^^^ | ^^^^^^^^^^^^^^^^^
error: aborting due to 4 previous errors; 1 warning emitted error: aborting due to 4 previous errors; 1 warning emitted

View file

@ -21,8 +21,8 @@ LL | fn underconstrained<U>(_: U) -> Underconstrained<U> {
| |
help: consider restricting type parameter `U` help: consider restricting type parameter `U`
| |
LL | fn underconstrained<U: Debug>(_: U) -> Underconstrained<U> { LL | fn underconstrained<U: std::fmt::Debug>(_: U) -> Underconstrained<U> {
| ^^^^^^^ | ^^^^^^^^^^^^^^^^^
error[E0277]: `V` doesn't implement `Debug` error[E0277]: `V` doesn't implement `Debug`
--> $DIR/generic_underconstrained2.rs:21:43 --> $DIR/generic_underconstrained2.rs:21:43
@ -35,8 +35,8 @@ LL | fn underconstrained2<U, V>(_: U, _: V) -> Underconstrained2<V> {
| |
help: consider restricting type parameter `V` help: consider restricting type parameter `V`
| |
LL | fn underconstrained2<U, V: Debug>(_: U, _: V) -> Underconstrained2<V> { LL | fn underconstrained2<U, V: std::fmt::Debug>(_: U, _: V) -> Underconstrained2<V> {
| ^^^^^^^ | ^^^^^^^^^^^^^^^^^
error: aborting due to 4 previous errors error: aborting due to 4 previous errors

View file

@ -15,8 +15,8 @@ LL | type Foo<T> = impl Default;
| |
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | type Foo<T: Default> = impl Default; LL | type Foo<T: std::default::Default> = impl Default;
| ^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error; 1 warning emitted error: aborting due to previous error; 1 warning emitted

View file

@ -6,8 +6,8 @@ LL | type Foo<T> = impl Default;
| |
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | type Foo<T: Default> = impl Default; LL | type Foo<T: std::default::Default> = impl Default;
| ^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -56,8 +56,8 @@ LL | trait Base<T = String>: Super<T> { }
| |
help: consider further restricting type parameter `T` help: consider further restricting type parameter `T`
| |
LL | trait Base<T = String>: Super<T> where T: Copy { } LL | trait Base<T = String>: Super<T> where T: std::marker::Copy { }
| ^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: cannot add `u8` to `i32` error[E0277]: cannot add `u8` to `i32`
--> $DIR/type-check-defaults.rs:24:66 --> $DIR/type-check-defaults.rs:24:66

View file

@ -9,8 +9,8 @@ LL | fn is_send<T:Send>() {
| |
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | fn foo<T: Send>() { LL | fn foo<T: std::marker::Send>() {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -2,7 +2,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim
--> $DIR/union-sized-field.rs:4:12 --> $DIR/union-sized-field.rs:4:12
| |
LL | union Foo<T: ?Sized> { LL | union Foo<T: ?Sized> {
| - this type parameter needs to be `Sized` | - this type parameter needs to be `std::marker::Sized`
LL | value: T, LL | value: T,
| ^ doesn't have a size known at compile-time | ^ doesn't have a size known at compile-time
| |
@ -21,7 +21,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim
--> $DIR/union-sized-field.rs:9:12 --> $DIR/union-sized-field.rs:9:12
| |
LL | struct Foo2<T: ?Sized> { LL | struct Foo2<T: ?Sized> {
| - this type parameter needs to be `Sized` | - this type parameter needs to be `std::marker::Sized`
LL | value: T, LL | value: T,
| ^ doesn't have a size known at compile-time | ^ doesn't have a size known at compile-time
| |
@ -40,7 +40,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim
--> $DIR/union-sized-field.rs:15:11 --> $DIR/union-sized-field.rs:15:11
| |
LL | enum Foo3<T: ?Sized> { LL | enum Foo3<T: ?Sized> {
| - this type parameter needs to be `Sized` | - this type parameter needs to be `std::marker::Sized`
LL | Value(T), LL | Value(T),
| ^ doesn't have a size known at compile-time | ^ doesn't have a size known at compile-time
| |

View file

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

View file

@ -7,7 +7,7 @@ LL | fn foo1<T>() { not_sized::<Foo<T>>() } // Hunky dory.
LL | fn foo2<T: ?Sized>() { not_sized::<Foo<T>>() } LL | fn foo2<T: ?Sized>() { not_sized::<Foo<T>>() }
| - ^^^^^^ doesn't have a size known at compile-time | - ^^^^^^ doesn't have a size known at compile-time
| | | |
| this type parameter needs to be `Sized` | this type parameter needs to be `std::marker::Sized`
| |
help: you could relax the implicit `Sized` bound on `U` if it were used through indirection like `&U` or `Box<U>` 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 --> $DIR/unsized-enum.rs:4:10

View file

@ -2,7 +2,7 @@ error[E0277]: the size for values of type `W` cannot be known at compilation tim
--> $DIR/unsized-enum2.rs:23:8 --> $DIR/unsized-enum2.rs:23:8
| |
LL | enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> { LL | enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
| - this type parameter needs to be `Sized` | - this type parameter needs to be `std::marker::Sized`
LL | // parameter LL | // parameter
LL | VA(W), LL | VA(W),
| ^ doesn't have a size known at compile-time | ^ doesn't have a size known at compile-time
@ -22,7 +22,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
--> $DIR/unsized-enum2.rs:25:11 --> $DIR/unsized-enum2.rs:25:11
| |
LL | enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> { LL | enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
| - this type parameter needs to be `Sized` | - this type parameter needs to be `std::marker::Sized`
... ...
LL | VB{x: X}, LL | VB{x: X},
| ^ doesn't have a size known at compile-time | ^ doesn't have a size known at compile-time
@ -42,7 +42,7 @@ error[E0277]: the size for values of type `Y` cannot be known at compilation tim
--> $DIR/unsized-enum2.rs:27:15 --> $DIR/unsized-enum2.rs:27:15
| |
LL | enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> { LL | enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
| - this type parameter needs to be `Sized` | - this type parameter needs to be `std::marker::Sized`
... ...
LL | VC(isize, Y), LL | VC(isize, Y),
| ^ doesn't have a size known at compile-time | ^ doesn't have a size known at compile-time
@ -62,7 +62,7 @@ error[E0277]: the size for values of type `Z` cannot be known at compilation tim
--> $DIR/unsized-enum2.rs:29:21 --> $DIR/unsized-enum2.rs:29:21
| |
LL | enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> { LL | enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
| - this type parameter needs to be `Sized` | - this type parameter needs to be `std::marker::Sized`
... ...
LL | VD{u: isize, x: Z}, LL | VD{u: isize, x: Z},
| ^ doesn't have a size known at compile-time | ^ doesn't have a size known at compile-time

View file

@ -7,7 +7,7 @@ LL |
LL | impl<X: ?Sized> S5<X> { LL | impl<X: ?Sized> S5<X> {
| - ^^^^^ doesn't have a size known at compile-time | - ^^^^^ doesn't have a size known at compile-time
| | | |
| this type parameter needs to be `Sized` | this type parameter needs to be `std::marker::Sized`
| |
help: you could relax the implicit `Sized` bound on `Y` if it were used through indirection like `&Y` or `Box<Y>` 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 --> $DIR/unsized-inherent-impl-self-type.rs:5:11

View file

@ -7,7 +7,7 @@ LL | fn foo1<T>() { not_sized::<Foo<T>>() } // Hunky dory.
LL | fn foo2<T: ?Sized>() { not_sized::<Foo<T>>() } LL | fn foo2<T: ?Sized>() { not_sized::<Foo<T>>() }
| - ^^^^^^ doesn't have a size known at compile-time | - ^^^^^^ doesn't have a size known at compile-time
| | | |
| this type parameter needs to be `Sized` | this type parameter needs to be `std::marker::Sized`
| |
help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<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 --> $DIR/unsized-struct.rs:4:12
@ -26,7 +26,7 @@ LL | fn is_sized<T:Sized>() { }
LL | fn bar2<T: ?Sized>() { is_sized::<Bar<T>>() } LL | fn bar2<T: ?Sized>() { is_sized::<Bar<T>>() }
| - ^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | - ^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
| | | |
| this type parameter needs to be `Sized` | this type parameter needs to be `std::marker::Sized`
| |
= note: required because it appears within the type `Bar<T>` = note: required because it appears within the type `Bar<T>`

View file

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

View file

@ -7,7 +7,7 @@ LL | trait T2<Z> {
LL | impl<X: ?Sized> T2<X> for S4<X> { 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
| | | |
| this type parameter needs to be `Sized` | this type parameter needs to be `std::marker::Sized`
| |
help: consider relaxing the implicit `Sized` restriction help: consider relaxing the implicit `Sized` restriction
| |

View file

@ -2,7 +2,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
--> $DIR/unsized3.rs:7:13 --> $DIR/unsized3.rs:7:13
| |
LL | fn f1<X: ?Sized>(x: &X) { LL | fn f1<X: ?Sized>(x: &X) {
| - this type parameter needs to be `Sized` | - this type parameter needs to be `std::marker::Sized`
LL | f2::<X>(x); LL | f2::<X>(x);
| ^ doesn't have a size known at compile-time | ^ doesn't have a size known at compile-time
... ...
@ -18,7 +18,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
--> $DIR/unsized3.rs:18:13 --> $DIR/unsized3.rs:18:13
| |
LL | fn f3<X: ?Sized + T>(x: &X) { LL | fn f3<X: ?Sized + T>(x: &X) {
| - this type parameter needs to be `Sized` | - this type parameter needs to be `std::marker::Sized`
LL | f4::<X>(x); LL | f4::<X>(x);
| ^ doesn't have a size known at compile-time | ^ doesn't have a size known at compile-time
... ...
@ -37,7 +37,7 @@ LL | fn f5<Y>(x: &Y) {}
| - required by this bound in `f5` | - required by this bound in `f5`
... ...
LL | fn f8<X: ?Sized>(x1: &S<X>, x2: &S<X>) { LL | fn f8<X: ?Sized>(x1: &S<X>, x2: &S<X>) {
| - this type parameter needs to be `Sized` | - this type parameter needs to be `std::marker::Sized`
LL | f5(x1); LL | f5(x1);
| ^^ doesn't have a size known at compile-time | ^^ doesn't have a size known at compile-time
| |
@ -51,7 +51,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
--> $DIR/unsized3.rs:40:8 --> $DIR/unsized3.rs:40:8
| |
LL | fn f9<X: ?Sized>(x1: Box<S<X>>) { LL | fn f9<X: ?Sized>(x1: Box<S<X>>) {
| - this type parameter needs to be `Sized` | - this type parameter needs to be `std::marker::Sized`
LL | f5(&(*x1, 34)); LL | f5(&(*x1, 34));
| ^^^^^^^^^^ doesn't have a size known at compile-time | ^^^^^^^^^^ doesn't have a size known at compile-time
| |
@ -62,7 +62,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
--> $DIR/unsized3.rs:45:9 --> $DIR/unsized3.rs:45:9
| |
LL | fn f10<X: ?Sized>(x1: Box<S<X>>) { LL | fn f10<X: ?Sized>(x1: Box<S<X>>) {
| - this type parameter needs to be `Sized` | - this type parameter needs to be `std::marker::Sized`
LL | f5(&(32, *x1)); LL | f5(&(32, *x1));
| ^^^^^^^^^ doesn't have a size known at compile-time | ^^^^^^^^^ doesn't have a size known at compile-time
| |
@ -77,7 +77,7 @@ LL | fn f5<Y>(x: &Y) {}
| - required by this bound in `f5` | - required by this bound in `f5`
... ...
LL | fn f10<X: ?Sized>(x1: Box<S<X>>) { LL | fn f10<X: ?Sized>(x1: Box<S<X>>) {
| - this type parameter needs to be `Sized` | - this type parameter needs to be `std::marker::Sized`
LL | f5(&(32, *x1)); LL | f5(&(32, *x1));
| ^^^^^^^^^^ doesn't have a size known at compile-time | ^^^^^^^^^^ doesn't have a size known at compile-time
| |

View file

@ -2,7 +2,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
--> $DIR/unsized5.rs:4:9 --> $DIR/unsized5.rs:4:9
| |
LL | struct S1<X: ?Sized> { LL | struct S1<X: ?Sized> {
| - this type parameter needs to be `Sized` | - this type parameter needs to be `std::marker::Sized`
LL | f1: X, LL | f1: X,
| ^ doesn't have a size known at compile-time | ^ doesn't have a size known at compile-time
| |
@ -21,7 +21,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
--> $DIR/unsized5.rs:10:8 --> $DIR/unsized5.rs:10:8
| |
LL | struct S2<X: ?Sized> { LL | struct S2<X: ?Sized> {
| - this type parameter needs to be `Sized` | - this type parameter needs to be `std::marker::Sized`
LL | f: isize, LL | f: isize,
LL | g: X, LL | g: X,
| ^ doesn't have a size known at compile-time | ^ doesn't have a size known at compile-time
@ -77,7 +77,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
--> $DIR/unsized5.rs:25:8 --> $DIR/unsized5.rs:25:8
| |
LL | enum E<X: ?Sized> { LL | enum E<X: ?Sized> {
| - this type parameter needs to be `Sized` | - this type parameter needs to be `std::marker::Sized`
LL | V1(X, isize), LL | V1(X, isize),
| ^ doesn't have a size known at compile-time | ^ doesn't have a size known at compile-time
| |
@ -96,7 +96,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
--> $DIR/unsized5.rs:29:12 --> $DIR/unsized5.rs:29:12
| |
LL | enum F<X: ?Sized> { LL | enum F<X: ?Sized> {
| - this type parameter needs to be `Sized` | - this type parameter needs to be `std::marker::Sized`
LL | V2{f1: X, f: isize}, LL | V2{f1: X, f: isize},
| ^ doesn't have a size known at compile-time | ^ doesn't have a size known at compile-time
| |

View file

@ -2,7 +2,7 @@ error[E0277]: the size for values of type `Y` cannot be known at compilation tim
--> $DIR/unsized6.rs:9:9 --> $DIR/unsized6.rs:9:9
| |
LL | fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) { LL | fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
| - this type parameter needs to be `Sized` | - this type parameter needs to be `std::marker::Sized`
... ...
LL | let y: Y; LL | let y: Y;
| ^ doesn't have a size known at compile-time | ^ doesn't have a size known at compile-time
@ -14,7 +14,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
--> $DIR/unsized6.rs:7:12 --> $DIR/unsized6.rs:7:12
| |
LL | fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) { LL | fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
| - this type parameter needs to be `Sized` | - this type parameter needs to be `std::marker::Sized`
LL | let _: W; // <-- this is OK, no bindings created, no initializer. LL | let _: W; // <-- this is OK, no bindings created, no initializer.
LL | let _: (isize, (X, isize)); LL | let _: (isize, (X, isize));
| ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
@ -25,7 +25,7 @@ error[E0277]: the size for values of type `Z` cannot be known at compilation tim
--> $DIR/unsized6.rs:11:12 --> $DIR/unsized6.rs:11:12
| |
LL | fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) { LL | fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
| - this type parameter needs to be `Sized` | - this type parameter needs to be `std::marker::Sized`
... ...
LL | let y: (isize, (Z, usize)); LL | let y: (isize, (Z, usize));
| ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
@ -36,7 +36,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
--> $DIR/unsized6.rs:15:9 --> $DIR/unsized6.rs:15:9
| |
LL | fn f2<X: ?Sized, Y: ?Sized>(x: &X) { LL | fn f2<X: ?Sized, Y: ?Sized>(x: &X) {
| - this type parameter needs to be `Sized` | - this type parameter needs to be `std::marker::Sized`
LL | let y: X; LL | let y: X;
| ^ doesn't have a size known at compile-time | ^ doesn't have a size known at compile-time
| |
@ -47,7 +47,7 @@ error[E0277]: the size for values of type `Y` cannot be known at compilation tim
--> $DIR/unsized6.rs:17:12 --> $DIR/unsized6.rs:17:12
| |
LL | fn f2<X: ?Sized, Y: ?Sized>(x: &X) { LL | fn f2<X: ?Sized, Y: ?Sized>(x: &X) {
| - this type parameter needs to be `Sized` | - this type parameter needs to be `std::marker::Sized`
... ...
LL | let y: (isize, (Y, isize)); LL | let y: (isize, (Y, isize));
| ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
@ -58,7 +58,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
--> $DIR/unsized6.rs:22:9 --> $DIR/unsized6.rs:22:9
| |
LL | fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) { LL | fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
| - this type parameter needs to be `Sized` | - this type parameter needs to be `std::marker::Sized`
LL | let y: X = *x1; LL | let y: X = *x1;
| ^ doesn't have a size known at compile-time | ^ doesn't have a size known at compile-time
| |
@ -69,7 +69,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
--> $DIR/unsized6.rs:24:9 --> $DIR/unsized6.rs:24:9
| |
LL | fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) { LL | fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
| - this type parameter needs to be `Sized` | - this type parameter needs to be `std::marker::Sized`
... ...
LL | let y = *x2; LL | let y = *x2;
| ^ doesn't have a size known at compile-time | ^ doesn't have a size known at compile-time
@ -81,7 +81,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
--> $DIR/unsized6.rs:26:10 --> $DIR/unsized6.rs:26:10
| |
LL | fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) { LL | fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
| - this type parameter needs to be `Sized` | - this type parameter needs to be `std::marker::Sized`
... ...
LL | let (y, z) = (*x3, 4); LL | let (y, z) = (*x3, 4);
| ^ doesn't have a size known at compile-time | ^ doesn't have a size known at compile-time
@ -93,7 +93,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
--> $DIR/unsized6.rs:30:9 --> $DIR/unsized6.rs:30:9
| |
LL | fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) { LL | fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
| - this type parameter needs to be `Sized` | - this type parameter needs to be `std::marker::Sized`
LL | let y: X = *x1; LL | let y: X = *x1;
| ^ doesn't have a size known at compile-time | ^ doesn't have a size known at compile-time
| |
@ -104,7 +104,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
--> $DIR/unsized6.rs:32:9 --> $DIR/unsized6.rs:32:9
| |
LL | fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) { LL | fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
| - this type parameter needs to be `Sized` | - this type parameter needs to be `std::marker::Sized`
... ...
LL | let y = *x2; LL | let y = *x2;
| ^ doesn't have a size known at compile-time | ^ doesn't have a size known at compile-time
@ -116,7 +116,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
--> $DIR/unsized6.rs:34:10 --> $DIR/unsized6.rs:34:10
| |
LL | fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) { LL | fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
| - this type parameter needs to be `Sized` | - this type parameter needs to be `std::marker::Sized`
... ...
LL | let (y, z) = (*x3, 4); LL | let (y, z) = (*x3, 4);
| ^ doesn't have a size known at compile-time | ^ doesn't have a size known at compile-time
@ -130,7 +130,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
LL | fn g1<X: ?Sized>(x: X) {} LL | fn g1<X: ?Sized>(x: X) {}
| - ^ doesn't have a size known at compile-time | - ^ doesn't have a size known at compile-time
| | | |
| this type parameter needs to be `Sized` | this type parameter needs to be `std::marker::Sized`
| |
= help: unsized fn params are gated as an unstable feature = help: unsized fn params are gated as an unstable feature
help: function arguments must have a statically known size, borrowed types always have a known size help: function arguments must have a statically known size, borrowed types always have a known size
@ -144,7 +144,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
LL | fn g2<X: ?Sized + T>(x: X) {} LL | fn g2<X: ?Sized + T>(x: X) {}
| - ^ doesn't have a size known at compile-time | - ^ doesn't have a size known at compile-time
| | | |
| this type parameter needs to be `Sized` | this type parameter needs to be `std::marker::Sized`
| |
= help: unsized fn params are gated as an unstable feature = help: unsized fn params are gated as an unstable feature
help: function arguments must have a statically known size, borrowed types always have a known size help: function arguments must have a statically known size, borrowed types always have a known size

View file

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

View file

@ -9,8 +9,8 @@ LL | where T: ExtraCopy<U>
| |
help: consider further restricting type parameter `U` help: consider further restricting type parameter `U`
| |
LL | where T: ExtraCopy<U>, U: Copy LL | where T: ExtraCopy<U>, U: std::marker::Copy
| ^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -9,8 +9,8 @@ LL | f: IsCopy<A>
| |
help: consider restricting type parameter `A` help: consider restricting type parameter `A`
| |
LL | enum AnotherEnum<A: Copy> { LL | enum AnotherEnum<A: std::marker::Copy> {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -9,8 +9,8 @@ LL | SomeVariant(IsCopy<A>)
| |
help: consider restricting type parameter `A` help: consider restricting type parameter `A`
| |
LL | enum SomeEnum<A: Copy> { LL | enum SomeEnum<A: std::marker::Copy> {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -9,8 +9,8 @@ LL | fn foo<T,U>() where T: ExtraCopy<U>
| |
help: consider further restricting type parameter `U` help: consider further restricting type parameter `U`
| |
LL | fn foo<T,U>() where T: ExtraCopy<U>, U: Copy LL | fn foo<T,U>() where T: ExtraCopy<U>, U: std::marker::Copy
| ^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: the size for values of type `(dyn Copy + 'static)` cannot be known at compilation time error[E0277]: the size for values of type `(dyn Copy + 'static)` cannot be known at compilation time
--> $DIR/wf-fn-where-clause.rs:12:16 --> $DIR/wf-fn-where-clause.rs:12:16

View file

@ -9,8 +9,8 @@ LL | fn bar<T>(_: &MustBeCopy<T>)
| |
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | fn bar<T: Copy>(_: &MustBeCopy<T>) LL | fn bar<T: std::marker::Copy>(_: &MustBeCopy<T>)
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -9,8 +9,8 @@ LL | fn bar<T>() -> MustBeCopy<T>
| |
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | fn bar<T: Copy>() -> MustBeCopy<T> LL | fn bar<T: std::marker::Copy>() -> MustBeCopy<T>
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -9,8 +9,8 @@ LL | x: fn(MustBeCopy<T>)
| |
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | struct Bar<T: Copy> { LL | struct Bar<T: std::marker::Copy> {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -9,8 +9,8 @@ LL | x: fn() -> MustBeCopy<T>
| |
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | struct Foo<T: Copy> { LL | struct Foo<T: std::marker::Copy> {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -9,8 +9,8 @@ LL | where T: MustBeCopy<U>
| |
help: consider further restricting type parameter `U` help: consider further restricting type parameter `U`
| |
LL | where T: MustBeCopy<U>, U: Copy LL | where T: MustBeCopy<U>, U: std::marker::Copy
| ^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -9,8 +9,8 @@ LL | x: dyn Object<MustBeCopy<T>>
| |
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | struct Bar<T: Copy> { LL | struct Bar<T: std::marker::Copy> {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -9,8 +9,8 @@ LL | fn foo(self) where T: ExtraCopy<U>
| |
help: consider restricting type parameter `U` help: consider restricting type parameter `U`
| |
LL | impl<T,U: Copy> Foo<T,U> { LL | impl<T,U: std::marker::Copy> Foo<T,U> {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -9,8 +9,8 @@ LL | impl<T,U> Foo<T,U> where T: ExtraCopy<U>
| |
help: consider further restricting type parameter `U` help: consider further restricting type parameter `U`
| |
LL | impl<T,U> Foo<T,U> where T: ExtraCopy<U>, U: Copy LL | impl<T,U> Foo<T,U> where T: ExtraCopy<U>, U: std::marker::Copy
| ^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -9,8 +9,8 @@ LL | where T: ExtraCopy<U>
| |
help: consider further restricting type parameter `U` help: consider further restricting type parameter `U`
| |
LL | where T: ExtraCopy<U>, U: Copy LL | where T: ExtraCopy<U>, U: std::marker::Copy
| ^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -9,8 +9,8 @@ LL | data: IsCopy<A>
| |
help: consider restricting type parameter `A` help: consider restricting type parameter `A`
| |
LL | struct SomeStruct<A: Copy> { LL | struct SomeStruct<A: std::marker::Copy> {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -9,8 +9,8 @@ LL | type Type1: ExtraCopy<T>;
| |
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | trait SomeTrait<T: Copy> { LL | trait SomeTrait<T: std::marker::Copy> {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -9,8 +9,8 @@ LL | where T: ExtraCopy<U>
| |
help: consider further restricting type parameter `U` help: consider further restricting type parameter `U`
| |
LL | where T: ExtraCopy<U>, U: Copy LL | where T: ExtraCopy<U>, U: std::marker::Copy
| ^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -9,8 +9,8 @@ LL | trait SomeTrait<T>: ExtraCopy<T> {
| |
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | trait SomeTrait<T: Copy>: ExtraCopy<T> { LL | trait SomeTrait<T: std::marker::Copy>: ExtraCopy<T> {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -9,8 +9,8 @@ LL | require_copy(self.x);
| |
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | impl<T: Copy> Foo<T> { LL | impl<T: std::marker::Copy> Foo<T> {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -9,8 +9,8 @@ LL | require_copy(self.x);
| |
help: consider restricting type parameter `T` help: consider restricting type parameter `T`
| |
LL | impl<T: Copy> Foo<T> for Bar<T> { LL | impl<T: std::marker::Copy> Foo<T> for Bar<T> {
| ^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error