@@ -5,40 +5,32 @@ LL | fn arg<T: ?Send>(_: T) {}
55 | ^
66
77warning: default bound relaxed for a type parameter, but this does nothing because the given bound is not a default; only `?Sized` is supported
8- --> $DIR/issue-87199.rs:11 :12
8+ --> $DIR/issue-87199.rs:10 :12
99 |
1010LL | fn ref_arg<T: ?Send>(_: &T) {}
1111 | ^
1212
1313warning: default bound relaxed for a type parameter, but this does nothing because the given bound is not a default; only `?Sized` is supported
14- --> $DIR/issue-87199.rs:13 :13
14+ --> $DIR/issue-87199.rs:12 :13
1515 |
1616LL | fn ret() -> impl Iterator<Item = ()> + ?Send { std::iter::empty() }
1717 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1818
19- error[E0277]: the size for values of type `impl Iterator+?Sized ` cannot be known at compilation time
20- --> $DIR/issue-87199.rs:13:13
19+ error[E0277]: the size for values of type `[i32] ` cannot be known at compilation time
20+ --> $DIR/issue-87199.rs:18:22
2121 |
22- LL | fn ret() -> impl Iterator<Item = ()> + ?Send { std::iter::empty() }
23- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
24- |
25- = help: the trait `Sized` is not implemented for `impl Iterator+?Sized`
26- = note: the return type of a function must have a statically known size
27-
28- error[E0277]: the size for values of type `T` cannot be known at compilation time
29- --> $DIR/issue-87199.rs:8:18
30- |
31- LL | fn arg<T: ?Send>(_: T) {}
32- | - ^ doesn't have a size known at compile-time
33- | |
34- | this type parameter needs to be `std::marker::Sized`
22+ LL | fn ref_arg<T: ?Send>(_: &T) {}
23+ | - required by this bound in `ref_arg`
24+ ...
25+ LL | ref_arg::<[i32]>(&[5]);
26+ | ^^^^ doesn't have a size known at compile-time
3527 |
36- = help: unsized fn params are gated as an unstable feature
37- help: function arguments must have a statically known size, borrowed types always have a known size
28+ = help: the trait `Sized` is not implemented for `[i32]`
29+ help: consider relaxing the implicit `Sized` restriction
3830 |
39- LL | fn arg <T: ?Send>(_: &T) {}
40- | ^
31+ LL | fn ref_arg <T: ?Send + ?Sized >(_: &T) {}
32+ | ^^^^^^^^
4133
42- error: aborting due to 2 previous errors ; 3 warnings emitted
34+ error: aborting due to previous error ; 3 warnings emitted
4335
4436For more information about this error, try `rustc --explain E0277`.
0 commit comments