@@ -5,40 +5,32 @@ LL | fn arg<T: ?Send>(_: T) {}
5
5
| ^
6
6
7
7
warning: 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
9
9
|
10
10
LL | fn ref_arg<T: ?Send>(_: &T) {}
11
11
| ^
12
12
13
13
warning: 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
15
15
|
16
16
LL | fn ret() -> impl Iterator<Item = ()> + ?Send { std::iter::empty() }
17
17
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18
18
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
21
21
|
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
35
27
|
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
38
30
|
39
- LL | fn arg <T: ?Send>(_: &T) {}
40
- | ^
31
+ LL | fn ref_arg <T: ?Send + ?Sized >(_: &T) {}
32
+ | ^^^^^^^^
41
33
42
- error: aborting due to 2 previous errors ; 3 warnings emitted
34
+ error: aborting due to previous error ; 3 warnings emitted
43
35
44
36
For more information about this error, try `rustc --explain E0277`.
0 commit comments