diff options
| author | Michael Goulet <michael@errs.io> | 2023-06-02 05:54:52 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-06-20 04:38:46 +0000 |
| commit | 657d3f43a9802a3e119c1acf6467ddc0eb41e0be (patch) | |
| tree | b2d69b2fd363ea9288c29d40f616a83b4d55a6c9 /tests/ui/unsized | |
| parent | 5683791ebb7bbc440366635c322ad82badc554ca (diff) | |
| download | rust-657d3f43a9802a3e119c1acf6467ddc0eb41e0be.tar.gz rust-657d3f43a9802a3e119c1acf6467ddc0eb41e0be.zip | |
Add rustc_do_not_implement_via_object
Diffstat (limited to 'tests/ui/unsized')
| -rw-r--r-- | tests/ui/unsized/issue-71659.current.stderr (renamed from tests/ui/unsized/issue-71659.stderr) | 4 | ||||
| -rw-r--r-- | tests/ui/unsized/issue-71659.next.stderr | 18 | ||||
| -rw-r--r-- | tests/ui/unsized/issue-71659.rs | 3 |
3 files changed, 23 insertions, 2 deletions
diff --git a/tests/ui/unsized/issue-71659.stderr b/tests/ui/unsized/issue-71659.current.stderr index b57b3015e47..6b982a73952 100644 --- a/tests/ui/unsized/issue-71659.stderr +++ b/tests/ui/unsized/issue-71659.current.stderr @@ -1,11 +1,11 @@ error[E0277]: the trait bound `dyn Foo: CastTo<[i32]>` is not satisfied - --> $DIR/issue-71659.rs:30:15 + --> $DIR/issue-71659.rs:33:15 | LL | let x = x.cast::<[i32]>(); | ^^^^ the trait `CastTo<[i32]>` is not implemented for `dyn Foo` | note: required by a bound in `Cast::cast` - --> $DIR/issue-71659.rs:19:15 + --> $DIR/issue-71659.rs:22:15 | LL | fn cast<T: ?Sized>(&self) -> &T | ---- required by a bound in this associated function diff --git a/tests/ui/unsized/issue-71659.next.stderr b/tests/ui/unsized/issue-71659.next.stderr new file mode 100644 index 00000000000..6b982a73952 --- /dev/null +++ b/tests/ui/unsized/issue-71659.next.stderr @@ -0,0 +1,18 @@ +error[E0277]: the trait bound `dyn Foo: CastTo<[i32]>` is not satisfied + --> $DIR/issue-71659.rs:33:15 + | +LL | let x = x.cast::<[i32]>(); + | ^^^^ the trait `CastTo<[i32]>` is not implemented for `dyn Foo` + | +note: required by a bound in `Cast::cast` + --> $DIR/issue-71659.rs:22:15 + | +LL | fn cast<T: ?Sized>(&self) -> &T + | ---- required by a bound in this associated function +LL | where +LL | Self: CastTo<T>, + | ^^^^^^^^^ required by this bound in `Cast::cast` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/unsized/issue-71659.rs b/tests/ui/unsized/issue-71659.rs index 3524ca02bbf..db5c2e205aa 100644 --- a/tests/ui/unsized/issue-71659.rs +++ b/tests/ui/unsized/issue-71659.rs @@ -1,3 +1,6 @@ +// revisions: current next +//[next] compile-flags: -Ztrait-solver=next + #![feature(unsize)] use std::marker::Unsize; |
