summaryrefslogtreecommitdiffstats
path: root/src/test/ui/unsized
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/unsized-locals/borrow-after-move.stderr2
-rw-r--r--src/test/ui/unsized-locals/by-value-trait-object-safety.stderr2
-rw-r--r--src/test/ui/unsized-locals/double-move.stderr2
-rw-r--r--src/test/ui/unsized-locals/issue-30276-feature-flagged.stderr2
-rw-r--r--src/test/ui/unsized-locals/issue-50940-with-feature.stderr2
-rw-r--r--src/test/ui/unsized-locals/unsized-exprs.stderr4
-rw-r--r--src/test/ui/unsized/issue-71659.stderr6
-rw-r--r--src/test/ui/unsized/issue-75707.stderr4
-rw-r--r--src/test/ui/unsized/issue-75899-but-gats.rs21
-rw-r--r--src/test/ui/unsized/issue-75899.rs18
-rw-r--r--src/test/ui/unsized/unsized-fn-param.stderr16
-rw-r--r--src/test/ui/unsized/unsized-struct.stderr4
-rw-r--r--src/test/ui/unsized/unsized3.stderr10
13 files changed, 60 insertions, 33 deletions
diff --git a/src/test/ui/unsized-locals/borrow-after-move.stderr b/src/test/ui/unsized-locals/borrow-after-move.stderr
index 4f2bc06d4..28ae1c068 100644
--- a/src/test/ui/unsized-locals/borrow-after-move.stderr
+++ b/src/test/ui/unsized-locals/borrow-after-move.stderr
@@ -4,8 +4,8 @@ warning: the feature `unsized_locals` is incomplete and may not be safe to use a
LL | #![feature(unsized_locals, unsized_fn_params)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= note: see issue #48055 <https://github.com/rust-lang/rust/issues/48055> for more information
+ = note: `#[warn(incomplete_features)]` on by default
error[E0382]: borrow of moved value: `x`
--> $DIR/borrow-after-move.rs:21:24
diff --git a/src/test/ui/unsized-locals/by-value-trait-object-safety.stderr b/src/test/ui/unsized-locals/by-value-trait-object-safety.stderr
index 59d91bc0c..4f13ec7ac 100644
--- a/src/test/ui/unsized-locals/by-value-trait-object-safety.stderr
+++ b/src/test/ui/unsized-locals/by-value-trait-object-safety.stderr
@@ -4,8 +4,8 @@ warning: the feature `unsized_locals` is incomplete and may not be safe to use a
LL | #![feature(unsized_locals)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= note: see issue #48055 <https://github.com/rust-lang/rust/issues/48055> for more information
+ = note: `#[warn(incomplete_features)]` on by default
error: the `foo` method cannot be invoked on a trait object
--> $DIR/by-value-trait-object-safety.rs:20:7
diff --git a/src/test/ui/unsized-locals/double-move.stderr b/src/test/ui/unsized-locals/double-move.stderr
index 4bb2ad88f..dfae6cc75 100644
--- a/src/test/ui/unsized-locals/double-move.stderr
+++ b/src/test/ui/unsized-locals/double-move.stderr
@@ -4,8 +4,8 @@ warning: the feature `unsized_locals` is incomplete and may not be safe to use a
LL | #![feature(unsized_locals, unsized_fn_params)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= note: see issue #48055 <https://github.com/rust-lang/rust/issues/48055> for more information
+ = note: `#[warn(incomplete_features)]` on by default
error[E0382]: use of moved value: `y`
--> $DIR/double-move.rs:21:22
diff --git a/src/test/ui/unsized-locals/issue-30276-feature-flagged.stderr b/src/test/ui/unsized-locals/issue-30276-feature-flagged.stderr
index 0f0ff5793..b6002cf89 100644
--- a/src/test/ui/unsized-locals/issue-30276-feature-flagged.stderr
+++ b/src/test/ui/unsized-locals/issue-30276-feature-flagged.stderr
@@ -4,8 +4,8 @@ warning: the feature `unsized_locals` is incomplete and may not be safe to use a
LL | #![feature(unsized_locals)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= note: see issue #48055 <https://github.com/rust-lang/rust/issues/48055> for more information
+ = note: `#[warn(incomplete_features)]` on by default
error[E0277]: the size for values of type `[i32]` cannot be known at compilation time
--> $DIR/issue-30276-feature-flagged.rs:7:29
diff --git a/src/test/ui/unsized-locals/issue-50940-with-feature.stderr b/src/test/ui/unsized-locals/issue-50940-with-feature.stderr
index 4523d41b6..8bbe317ec 100644
--- a/src/test/ui/unsized-locals/issue-50940-with-feature.stderr
+++ b/src/test/ui/unsized-locals/issue-50940-with-feature.stderr
@@ -4,8 +4,8 @@ warning: the feature `unsized_locals` is incomplete and may not be safe to use a
LL | #![feature(unsized_locals, unsized_fn_params)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= note: see issue #48055 <https://github.com/rust-lang/rust/issues/48055> for more information
+ = note: `#[warn(incomplete_features)]` on by default
error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/issue-50940-with-feature.rs:6:5
diff --git a/src/test/ui/unsized-locals/unsized-exprs.stderr b/src/test/ui/unsized-locals/unsized-exprs.stderr
index 6960255d9..a7f57e3fd 100644
--- a/src/test/ui/unsized-locals/unsized-exprs.stderr
+++ b/src/test/ui/unsized-locals/unsized-exprs.stderr
@@ -12,9 +12,7 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation
--> $DIR/unsized-exprs.rs:24:22
|
LL | udrop::<A<[u8]>>(A { 0: *foo() });
- | ---------------- ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
- | |
- | required by a bound introduced by this call
+ | ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: within `A<[u8]>`, the trait `Sized` is not implemented for `[u8]`
note: required because it appears within the type `A<[u8]>`
diff --git a/src/test/ui/unsized/issue-71659.stderr b/src/test/ui/unsized/issue-71659.stderr
index d7b95f557..50060e53a 100644
--- a/src/test/ui/unsized/issue-71659.stderr
+++ b/src/test/ui/unsized/issue-71659.stderr
@@ -1,8 +1,10 @@
error[E0277]: the trait bound `dyn Foo: CastTo<[i32]>` is not satisfied
- --> $DIR/issue-71659.rs:30:15
+ --> $DIR/issue-71659.rs:30:13
|
LL | let x = x.cast::<[i32]>();
- | ^^^^ the trait `CastTo<[i32]>` is not implemented for `dyn Foo`
+ | ^ ---- required by a bound introduced by this call
+ | |
+ | the trait `CastTo<[i32]>` is not implemented for `dyn Foo`
|
note: required by a bound in `Cast::cast`
--> $DIR/issue-71659.rs:19:15
diff --git a/src/test/ui/unsized/issue-75707.stderr b/src/test/ui/unsized/issue-75707.stderr
index 7d0a2cb85..97618ed05 100644
--- a/src/test/ui/unsized/issue-75707.stderr
+++ b/src/test/ui/unsized/issue-75707.stderr
@@ -1,8 +1,8 @@
error[E0277]: the trait bound `MyCall: Callback` is not satisfied
- --> $DIR/issue-75707.rs:15:5
+ --> $DIR/issue-75707.rs:15:9
|
LL | f::<dyn Processing<Call = MyCall>>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Callback` is not implemented for `MyCall`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Callback` is not implemented for `MyCall`
|
note: required by a bound in `f`
--> $DIR/issue-75707.rs:9:9
diff --git a/src/test/ui/unsized/issue-75899-but-gats.rs b/src/test/ui/unsized/issue-75899-but-gats.rs
new file mode 100644
index 000000000..5716817f4
--- /dev/null
+++ b/src/test/ui/unsized/issue-75899-but-gats.rs
@@ -0,0 +1,21 @@
+// check-pass
+
+use std::fmt::Debug;
+use std::marker::PhantomData;
+
+trait Foo {
+ type Gat<'a>: ?Sized where Self: 'a;
+}
+
+struct Bar<'a, T: Foo + 'a>(T::Gat<'a>);
+
+struct Baz<T: ?Sized>(PhantomData<T>);
+
+impl<T: ?Sized> Foo for Baz<T> {
+ type Gat<'a> = T where Self: 'a;
+}
+
+fn main() {
+ let x = Bar::<'_, Baz<()>>(());
+ let y: &Bar<'_, Baz<dyn Debug>> = &x;
+}
diff --git a/src/test/ui/unsized/issue-75899.rs b/src/test/ui/unsized/issue-75899.rs
new file mode 100644
index 000000000..abff17e11
--- /dev/null
+++ b/src/test/ui/unsized/issue-75899.rs
@@ -0,0 +1,18 @@
+// check-pass
+
+trait Trait {}
+impl<T> Trait for T {}
+
+trait Noop {
+ type Assoc: ?Sized;
+}
+impl<T: ?Sized> Noop for T {
+ type Assoc = T;
+}
+
+struct NoopNewtype<T: ?Sized + Noop>(T::Assoc);
+fn coerce_newtype<T: Trait>(x: &NoopNewtype<T>) -> &NoopNewtype<dyn Trait + '_> {
+ x
+}
+
+fn main() {}
diff --git a/src/test/ui/unsized/unsized-fn-param.stderr b/src/test/ui/unsized/unsized-fn-param.stderr
index 0221ef16b..b47726054 100644
--- a/src/test/ui/unsized/unsized-fn-param.stderr
+++ b/src/test/ui/unsized/unsized-fn-param.stderr
@@ -2,9 +2,7 @@ error[E0277]: the size for values of type `str` cannot be known at compilation t
--> $DIR/unsized-fn-param.rs:11:11
|
LL | foo11("bar", &"baz");
- | ----- ^^^^^ doesn't have a size known at compile-time
- | |
- | required by a bound introduced by this call
+ | ^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `str`
= note: required for the cast from `str` to the object type `dyn AsRef<Path>`
@@ -17,9 +15,7 @@ error[E0277]: the size for values of type `str` cannot be known at compilation t
--> $DIR/unsized-fn-param.rs:13:19
|
LL | foo12(&"bar", "baz");
- | ----- ^^^^^ doesn't have a size known at compile-time
- | |
- | required by a bound introduced by this call
+ | ^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `str`
= note: required for the cast from `str` to the object type `dyn AsRef<Path>`
@@ -32,9 +28,7 @@ error[E0277]: the size for values of type `str` cannot be known at compilation t
--> $DIR/unsized-fn-param.rs:16:11
|
LL | foo21("bar", &"baz");
- | ----- ^^^^^ doesn't have a size known at compile-time
- | |
- | required by a bound introduced by this call
+ | ^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `str`
= note: required for the cast from `str` to the object type `dyn AsRef<str>`
@@ -47,9 +41,7 @@ error[E0277]: the size for values of type `str` cannot be known at compilation t
--> $DIR/unsized-fn-param.rs:18:19
|
LL | foo22(&"bar", "baz");
- | ----- ^^^^^ doesn't have a size known at compile-time
- | |
- | required by a bound introduced by this call
+ | ^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `str`
= note: required for the cast from `str` to the object type `dyn AsRef<str>`
diff --git a/src/test/ui/unsized/unsized-struct.stderr b/src/test/ui/unsized/unsized-struct.stderr
index c9510e92f..dff1b0a51 100644
--- a/src/test/ui/unsized/unsized-struct.stderr
+++ b/src/test/ui/unsized/unsized-struct.stderr
@@ -25,10 +25,10 @@ LL + fn foo2<T>() { not_sized::<Foo<T>>() }
|
error[E0277]: the size for values of type `T` cannot be known at compilation time
- --> $DIR/unsized-struct.rs:13:24
+ --> $DIR/unsized-struct.rs:13:35
|
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 `std::marker::Sized`
|
diff --git a/src/test/ui/unsized/unsized3.stderr b/src/test/ui/unsized/unsized3.stderr
index d64091b15..9ad1ac6b4 100644
--- a/src/test/ui/unsized/unsized3.stderr
+++ b/src/test/ui/unsized/unsized3.stderr
@@ -79,14 +79,12 @@ LL | fn f5<Y: ?Sized>(x: &Y) {}
| ++++++++
error[E0277]: the size for values of type `X` cannot be known at compilation time
- --> $DIR/unsized3.rs:40:8
+ --> $DIR/unsized3.rs:40:5
|
LL | fn f9<X: ?Sized>(x1: Box<S<X>>) {
| - this type parameter needs to be `std::marker::Sized`
LL | f5(&(*x1, 34));
- | -- ^^^^^^^^^^ doesn't have a size known at compile-time
- | |
- | required by a bound introduced by this call
+ | ^^ doesn't have a size known at compile-time
|
note: required because it appears within the type `S<X>`
--> $DIR/unsized3.rs:28:8
@@ -106,9 +104,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
LL | fn f10<X: ?Sized>(x1: Box<S<X>>) {
| - this type parameter needs to be `std::marker::Sized`
LL | f5(&(32, *x1));
- | -- ^^^^^^^^^ doesn't have a size known at compile-time
- | |
- | required by a bound introduced by this call
+ | ^^^^^^^^^ doesn't have a size known at compile-time
|
note: required because it appears within the type `S<X>`
--> $DIR/unsized3.rs:28:8