1
Fork 0

Revert "Rollup merge of #86011 - tlyu:correct-sized-bound-spans, r=estebank"

This reverts commit 36a1076d24, reversing
changes made to e1e9319d93.
This commit is contained in:
Yuki Okushi 2021-10-19 02:33:38 +09:00
parent 5dab47dcd8
commit e2453dc2ff
No known key found for this signature in database
GPG key ID: DABA5B072961C18A
20 changed files with 83 additions and 94 deletions

View file

@ -64,16 +64,16 @@ impl<'tcx> Bounds<'tcx> {
}) })
}); });
self.region_bounds sized_predicate
.iter() .into_iter()
.map(|&(region_bound, span)| { .chain(self.region_bounds.iter().map(|&(region_bound, span)| {
( (
region_bound region_bound
.map_bound(|region_bound| ty::OutlivesPredicate(param_ty, region_bound)) .map_bound(|region_bound| ty::OutlivesPredicate(param_ty, region_bound))
.to_predicate(tcx), .to_predicate(tcx),
span, span,
) )
}) }))
.chain(self.trait_bounds.iter().map(|&(bound_trait_ref, span, constness)| { .chain(self.trait_bounds.iter().map(|&(bound_trait_ref, span, constness)| {
let predicate = bound_trait_ref.with_constness(constness).to_predicate(tcx); let predicate = bound_trait_ref.with_constness(constness).to_predicate(tcx);
(predicate, span) (predicate, span)
@ -83,7 +83,6 @@ impl<'tcx> Bounds<'tcx> {
.iter() .iter()
.map(|&(projection, span)| (projection.to_predicate(tcx), span)), .map(|&(projection, span)| (projection.to_predicate(tcx), span)),
) )
.chain(sized_predicate.into_iter())
.collect() .collect()
} }
} }

View file

@ -11,7 +11,7 @@ note: required by a bound in `std::hash::Hash::hash`
--> $SRC_DIR/core/src/hash/mod.rs:LL:COL --> $SRC_DIR/core/src/hash/mod.rs:LL:COL
| |
LL | fn hash<H: Hasher>(&self, state: &mut H); LL | fn hash<H: Hasher>(&self, state: &mut H);
| ^^^^^^ required by this bound in `std::hash::Hash::hash` | ^ required by this bound in `std::hash::Hash::hash`
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error error: aborting due to previous error

View file

@ -11,7 +11,7 @@ note: required by a bound in `std::hash::Hash::hash`
--> $SRC_DIR/core/src/hash/mod.rs:LL:COL --> $SRC_DIR/core/src/hash/mod.rs:LL:COL
| |
LL | fn hash<H: Hasher>(&self, state: &mut H); LL | fn hash<H: Hasher>(&self, state: &mut H);
| ^^^^^^ required by this bound in `std::hash::Hash::hash` | ^ required by this bound in `std::hash::Hash::hash`
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error error: aborting due to previous error

View file

@ -11,7 +11,7 @@ note: required by a bound in `std::hash::Hash::hash`
--> $SRC_DIR/core/src/hash/mod.rs:LL:COL --> $SRC_DIR/core/src/hash/mod.rs:LL:COL
| |
LL | fn hash<H: Hasher>(&self, state: &mut H); LL | fn hash<H: Hasher>(&self, state: &mut H);
| ^^^^^^ required by this bound in `std::hash::Hash::hash` | ^ required by this bound in `std::hash::Hash::hash`
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error error: aborting due to previous error

View file

@ -11,7 +11,7 @@ note: required by a bound in `std::hash::Hash::hash`
--> $SRC_DIR/core/src/hash/mod.rs:LL:COL --> $SRC_DIR/core/src/hash/mod.rs:LL:COL
| |
LL | fn hash<H: Hasher>(&self, state: &mut H); LL | fn hash<H: Hasher>(&self, state: &mut H);
| ^^^^^^ required by this bound in `std::hash::Hash::hash` | ^ required by this bound in `std::hash::Hash::hash`
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error error: aborting due to previous error

View file

@ -1,19 +1,3 @@
error[E0277]: the size for values of type `Self` cannot be known at compilation time
--> $DIR/issue-74816.rs:9:5
|
LL | type Associated: Trait1 = Self;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
note: required by a bound in `Trait2::Associated`
--> $DIR/issue-74816.rs:9:5
|
LL | type Associated: Trait1 = Self;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Trait2::Associated`
help: consider further restricting `Self`
|
LL | trait Trait2: Sized {
| +++++++
error[E0277]: the trait bound `Self: Trait1` is not satisfied error[E0277]: the trait bound `Self: Trait1` is not satisfied
--> $DIR/issue-74816.rs:9:5 --> $DIR/issue-74816.rs:9:5
| |
@ -30,6 +14,22 @@ help: consider further restricting `Self`
LL | trait Trait2: Trait1 { LL | trait Trait2: Trait1 {
| ++++++++ | ++++++++
error[E0277]: the size for values of type `Self` cannot be known at compilation time
--> $DIR/issue-74816.rs:9:5
|
LL | type Associated: Trait1 = Self;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
note: required by a bound in `Trait2::Associated`
--> $DIR/issue-74816.rs:9:5
|
LL | type Associated: Trait1 = Self;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Trait2::Associated`
help: consider further restricting `Self`
|
LL | trait Trait2: Sized {
| +++++++
error: aborting due to 2 previous errors error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0277`. For more information about this error, try `rustc --explain E0277`.

View file

@ -20,13 +20,13 @@ LL | for<'a> T: 'a,
| ^^ | ^^
error[E0311]: the parameter type `T` may not live long enough error[E0311]: the parameter type `T` may not live long enough
--> $DIR/issue-86483.rs:9:19 --> $DIR/issue-86483.rs:9:5
| |
LL | pub trait IceIce<T> LL | pub trait IceIce<T>
| - help: consider adding an explicit lifetime bound...: `T: 'a` | - help: consider adding an explicit lifetime bound...: `T: 'a`
... ...
LL | type Ice<'v>: IntoIterator<Item = &'v T>; LL | type Ice<'v>: IntoIterator<Item = &'v T>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds... | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds...
| |
note: ...that is required by this bound note: ...that is required by this bound
--> $DIR/issue-86483.rs:7:16 --> $DIR/issue-86483.rs:7:16

View file

@ -6,10 +6,10 @@ LL | impl Tsized for () {}
| |
= help: the trait `Sized` is not implemented for `[()]` = help: the trait `Sized` is not implemented for `[()]`
note: required by a bound in `Tsized` note: required by a bound in `Tsized`
--> $DIR/issue-61631-default-type-param-can-reference-self-in-trait.rs:17:17 --> $DIR/issue-61631-default-type-param-can-reference-self-in-trait.rs:17:14
| |
LL | trait Tsized<P: Sized = [Self]> {} LL | trait Tsized<P: Sized = [Self]> {}
| ^^^^^ required by this bound in `Tsized` | ^ required by this bound in `Tsized`
error: aborting due to previous error error: aborting due to previous error

View file

@ -1,21 +1,11 @@
error[E0283]: type annotations needed error[E0282]: type annotations needed
--> $DIR/issue-16966.rs:2:5 --> $DIR/issue-16966.rs:2:5
| |
LL | panic!(std::default::Default::default()); LL | panic!(std::default::Default::default());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for type parameter `M` declared on the function `begin_panic` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for type parameter `M` declared on the function `begin_panic`
| |
= note: cannot satisfy `_: Any`
note: required by a bound in `begin_panic`
--> $SRC_DIR/std/src/panicking.rs:LL:COL
|
LL | pub fn begin_panic<M: Any + Send>(msg: M) -> ! {
| ^^^ required by this bound in `begin_panic`
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider specifying the type argument in the function call
|
LL | $crate::rt::begin_panic::<M>($msg)
| +++++
error: aborting due to previous error error: aborting due to previous error
For more information about this error, try `rustc --explain E0283`. For more information about this error, try `rustc --explain E0282`.

View file

@ -10,7 +10,7 @@ note: required by a bound in `std::hash::Hash::hash`
--> $SRC_DIR/core/src/hash/mod.rs:LL:COL --> $SRC_DIR/core/src/hash/mod.rs:LL:COL
| |
LL | fn hash<H: Hasher>(&self, state: &mut H); LL | fn hash<H: Hasher>(&self, state: &mut H);
| ^^^^^^ required by this bound in `std::hash::Hash::hash` | ^ required by this bound in `std::hash::Hash::hash`
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error error: aborting due to previous error

View file

@ -1,4 +1,4 @@
error[E0275]: overflow evaluating the requirement `<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<T as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next: Next` error[E0275]: overflow evaluating the requirement `<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<T as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next: Sized`
--> $DIR/issue-23122-2.rs:9:17 --> $DIR/issue-23122-2.rs:9:17
| |
LL | type Next = <GetNext<T::Next> as Next>::Next; LL | type Next = <GetNext<T::Next> as Next>::Next;

View file

@ -12,10 +12,10 @@ LL | const ARR_LEN: usize = Tt::const_val::<[i8; 123]>();
| |
= note: cannot satisfy `_: Tt` = note: cannot satisfy `_: Tt`
note: required by a bound in `Tt::const_val` note: required by a bound in `Tt::const_val`
--> $DIR/issue-54954.rs:5:27 --> $DIR/issue-54954.rs:5:24
| |
LL | const fn const_val<T: Sized>() -> usize { LL | const fn const_val<T: Sized>() -> usize {
| ^^^^^ required by this bound in `Tt::const_val` | ^ required by this bound in `Tt::const_val`
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -20,11 +20,11 @@ error[E0277]: the trait bound `T: Bar` is not satisfied
LL | T::c::<T>(); LL | T::c::<T>();
| ^^^^^^^^^ the trait `Bar` is not implemented for `T` | ^^^^^^^^^ the trait `Bar` is not implemented for `T`
| |
note: required by a bound in `Foo::c` note: required by `Foo::c`
--> $DIR/trait-where-clause.rs:9:10 --> $DIR/trait-where-clause.rs:9:5
| |
LL | fn c<T: ~const Bar>(); LL | fn c<T: ~const Bar>();
| ^ required by this bound in `Foo::c` | ^^^^^^^^^^^^^^^^^^^^^^
help: consider further restricting this bound help: consider further restricting this bound
| |
LL | const fn test1<T: ~const Foo + Bar + Bar>() { LL | const fn test1<T: ~const Foo + Bar + Bar>() {
@ -52,11 +52,11 @@ error[E0277]: the trait bound `T: Bar` is not satisfied
LL | T::c::<T>(); LL | T::c::<T>();
| ^^^^^^^^^ the trait `Bar` is not implemented for `T` | ^^^^^^^^^ the trait `Bar` is not implemented for `T`
| |
note: required by a bound in `Foo::c` note: required by `Foo::c`
--> $DIR/trait-where-clause.rs:9:10 --> $DIR/trait-where-clause.rs:9:5
| |
LL | fn c<T: ~const Bar>(); LL | fn c<T: ~const Bar>();
| ^ required by this bound in `Foo::c` | ^^^^^^^^^^^^^^^^^^^^^^
help: consider further restricting this bound help: consider further restricting this bound
| |
LL | fn test3<T: Foo + Bar>() { LL | fn test3<T: Foo + Bar>() {

View file

@ -49,10 +49,10 @@ LL | f_sized(*ref_cl);
| |
= help: the trait `Sized` is not implemented for `dyn Fn()` = help: the trait `Sized` is not implemented for `dyn Fn()`
note: required by a bound in `f_sized` note: required by a bound in `f_sized`
--> $DIR/issue-84973-blacklist.rs:9:15 --> $DIR/issue-84973-blacklist.rs:9:12
| |
LL | fn f_sized<T: Sized>(t: T) {} LL | fn f_sized<T: Sized>(t: T) {}
| ^^^^^ required by this bound in `f_sized` | ^ required by this bound in `f_sized`
error[E0277]: `Rc<{integer}>` cannot be sent between threads safely error[E0277]: `Rc<{integer}>` cannot be sent between threads safely
--> $DIR/issue-84973-blacklist.rs:27:12 --> $DIR/issue-84973-blacklist.rs:27:12

View file

@ -1,23 +1,3 @@
error[E0277]: `[i32]` is not an iterator
--> $DIR/slice-issue-87994.rs:3:12
|
LL | for _ in v[1..] {
| ^^^^^^ expected an implementor of trait `IntoIterator`
|
= note: the trait bound `[i32]: IntoIterator` is not satisfied
= note: required because of the requirements on the impl of `IntoIterator` for `[i32]`
note: required by `into_iter`
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
|
LL | fn into_iter(self) -> Self::IntoIter;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: consider borrowing here
|
LL | for _ in &v[1..] {
| +
LL | for _ in &mut v[1..] {
| ++++
error[E0277]: the size for values of type `[i32]` cannot be known at compilation time error[E0277]: the size for values of type `[i32]` cannot be known at compilation time
--> $DIR/slice-issue-87994.rs:3:12 --> $DIR/slice-issue-87994.rs:3:12
| |
@ -38,7 +18,27 @@ LL | for _ in &v[1..] {
LL | for _ in &mut v[1..] { LL | for _ in &mut v[1..] {
| ++++ | ++++
error[E0277]: `[K]` is not an iterator error[E0277]: `[i32]` is not an iterator
--> $DIR/slice-issue-87994.rs:3:12
|
LL | for _ in v[1..] {
| ^^^^^^ expected an implementor of trait `IntoIterator`
|
= note: the trait bound `[i32]: IntoIterator` is not satisfied
= note: required because of the requirements on the impl of `IntoIterator` for `[i32]`
note: required by `into_iter`
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
|
LL | fn into_iter(self) -> Self::IntoIter;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: consider borrowing here
|
LL | for _ in &v[1..] {
| +
LL | for _ in &mut v[1..] {
| ++++
error[E0277]: the size for values of type `[K]` cannot be known at compilation time
--> $DIR/slice-issue-87994.rs:11:13 --> $DIR/slice-issue-87994.rs:11:13
| |
LL | for i2 in v2[1..] { LL | for i2 in v2[1..] {
@ -58,7 +58,7 @@ LL | for i2 in &v2[1..] {
LL | for i2 in &mut v2[1..] { LL | for i2 in &mut v2[1..] {
| ++++ | ++++
error[E0277]: the size for values of type `[K]` cannot be known at compilation time error[E0277]: `[K]` is not an iterator
--> $DIR/slice-issue-87994.rs:11:13 --> $DIR/slice-issue-87994.rs:11:13
| |
LL | for i2 in v2[1..] { LL | for i2 in v2[1..] {

View file

@ -5,7 +5,7 @@ use std::fmt::Debug;
fn main() {} fn main() {}
type Two<A, B> = impl Debug; type Two<A, B> = impl Debug;
//~^ ERROR the trait bound `A: Foo` is not satisfied //~^ ERROR the trait bound `A: Foo` is not satisfied in `(A, B, <A as Foo>::Bar)`
//~| ERROR `A` doesn't implement `Debug` //~| ERROR `A` doesn't implement `Debug`
//~| ERROR `B` doesn't implement `Debug` //~| ERROR `B` doesn't implement `Debug`

View file

@ -10,6 +10,18 @@ note: previous use here
LL | fn two<T: Debug + Foo, U: Debug>(t: T, u: U) -> Two<T, U> { LL | fn two<T: Debug + Foo, U: Debug>(t: T, u: U) -> Two<T, U> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: the trait bound `A: Foo` is not satisfied in `(A, B, <A as Foo>::Bar)`
--> $DIR/generic_duplicate_param_use9.rs:7:18
|
LL | type Two<A, B> = impl Debug;
| ^^^^^^^^^^ within `(A, B, <A as Foo>::Bar)`, the trait `Foo` is not implemented for `A`
|
= note: required because it appears within the type `(A, B, <A as Foo>::Bar)`
help: consider restricting type parameter `A`
|
LL | type Two<A: Foo, B> = impl Debug;
| +++++
error[E0277]: `A` doesn't implement `Debug` error[E0277]: `A` doesn't implement `Debug`
--> $DIR/generic_duplicate_param_use9.rs:7:18 --> $DIR/generic_duplicate_param_use9.rs:7:18
| |
@ -34,18 +46,6 @@ help: consider restricting type parameter `B`
LL | type Two<A, B: std::fmt::Debug> = impl Debug; LL | type Two<A, B: std::fmt::Debug> = impl Debug;
| +++++++++++++++++ | +++++++++++++++++
error[E0277]: the trait bound `A: Foo` is not satisfied
--> $DIR/generic_duplicate_param_use9.rs:7:18
|
LL | type Two<A, B> = impl Debug;
| ^^^^^^^^^^ the trait `Foo` is not implemented for `A`
|
= note: required because of the requirements on the impl of `Debug` for `(A, B, <A as Foo>::Bar)`
help: consider restricting type parameter `A`
|
LL | type Two<A: Foo, B> = impl Debug;
| +++++
error: aborting due to 4 previous errors error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0277`. For more information about this error, try `rustc --explain E0277`.

View file

@ -19,10 +19,10 @@ LL | | >(Unique<T>, A);
| |________________- doesn't satisfy `Box<dyn Foo>: Clone` | |________________- doesn't satisfy `Box<dyn Foo>: Clone`
| |
= note: the following trait bounds were not satisfied: = note: the following trait bounds were not satisfied:
`dyn Foo: Clone`
which is required by `Box<dyn Foo>: Clone`
`dyn Foo: Sized` `dyn Foo: Sized`
which is required by `Box<dyn Foo>: Clone` which is required by `Box<dyn Foo>: Clone`
`dyn Foo: Clone`
which is required by `Box<dyn Foo>: Clone`
error: aborting due to previous error error: aborting due to previous error

View file

@ -7,10 +7,10 @@ LL | fn foo<T: ?Sized>() { bar::<T>() }
| this type parameter needs to be `std::marker::Sized` | this type parameter needs to be `std::marker::Sized`
| |
note: required by a bound in `bar` note: required by a bound in `bar`
--> $DIR/unsized-bare-typaram.rs:1:11 --> $DIR/unsized-bare-typaram.rs:1:8
| |
LL | fn bar<T: Sized>() { } LL | fn bar<T: Sized>() { }
| ^^^^^ required by this bound in `bar` | ^ required by this bound in `bar`
help: consider removing the `?Sized` bound to make the type parameter `Sized` help: consider removing the `?Sized` bound to make the type parameter `Sized`
| |
LL - fn foo<T: ?Sized>() { bar::<T>() } LL - fn foo<T: ?Sized>() { bar::<T>() }

View file

@ -38,10 +38,10 @@ note: required because it appears within the type `Bar<T>`
LL | struct Bar<T: ?Sized> { data: T } LL | struct Bar<T: ?Sized> { data: T }
| ^^^ | ^^^
note: required by a bound in `is_sized` note: required by a bound in `is_sized`
--> $DIR/unsized-struct.rs:1:15 --> $DIR/unsized-struct.rs:1:13
| |
LL | fn is_sized<T:Sized>() { } LL | fn is_sized<T:Sized>() { }
| ^^^^^ required by this bound in `is_sized` | ^ required by this bound in `is_sized`
help: consider removing the `?Sized` bound to make the type parameter `Sized` help: consider removing the `?Sized` bound to make the type parameter `Sized`
| |
LL - fn bar2<T: ?Sized>() { is_sized::<Bar<T>>() } LL - fn bar2<T: ?Sized>() { is_sized::<Bar<T>>() }