diff options
| author | Jeremy Smart <jeremy3141592@gmail.com> | 2025-09-11 09:13:44 -0400 |
|---|---|---|
| committer | Jeremy Smart <jeremy3141592@gmail.com> | 2025-09-16 10:17:25 -0400 |
| commit | 1a1510816a69844fb3611efdc53acee07a55cebb (patch) | |
| tree | 0eb19e16c4c7ff25fb552445338f5f2b7e241891 /tests | |
| parent | f4665ab8368ad2e8a86d4390ae35c28bdd9561bb (diff) | |
| download | rust-1a1510816a69844fb3611efdc53acee07a55cebb.tar.gz rust-1a1510816a69844fb3611efdc53acee07a55cebb.zip | |
handle const generics, ?Sized, early bound lifetimes
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/suggestions/apitit-unimplemented-method.rs | 5 | ||||
| -rw-r--r-- | tests/ui/suggestions/apitit-unimplemented-method.stderr | 10 | ||||
| -rw-r--r-- | tests/ui/suggestions/auxiliary/dep.rs | 14 |
3 files changed, 23 insertions, 6 deletions
diff --git a/tests/ui/suggestions/apitit-unimplemented-method.rs b/tests/ui/suggestions/apitit-unimplemented-method.rs index b182e1939b3..c0cd709e230 100644 --- a/tests/ui/suggestions/apitit-unimplemented-method.rs +++ b/tests/ui/suggestions/apitit-unimplemented-method.rs @@ -4,9 +4,12 @@ extern crate dep; use dep::*; struct Local; + impl Trait for Local {} //~^ ERROR not all trait items implemented //~| HELP implement the missing item: `fn foo(_: impl Sized) { todo!() }` -//~| HELP implement the missing item: `fn bar<T>(_: impl Sized) { todo!() }` +//~| HELP implement the missing item: `fn bar<T>(_: impl Sized) where Foo<T>: MetaSized { todo!() }` +//~| HELP implement the missing item: `fn baz<const N: usize>() { todo!() }` +//~| HELP implement the missing item: `fn quux<'a: 'b, 'b, T>() where T: ?Sized { todo!() }` fn main() {} diff --git a/tests/ui/suggestions/apitit-unimplemented-method.stderr b/tests/ui/suggestions/apitit-unimplemented-method.stderr index b309a64e958..1f2e0ea2cad 100644 --- a/tests/ui/suggestions/apitit-unimplemented-method.stderr +++ b/tests/ui/suggestions/apitit-unimplemented-method.stderr @@ -1,11 +1,13 @@ -error[E0046]: not all trait items implemented, missing: `foo`, `bar` - --> $DIR/apitit-unimplemented-method.rs:7:1 +error[E0046]: not all trait items implemented, missing: `foo`, `bar`, `baz`, `quux` + --> $DIR/apitit-unimplemented-method.rs:8:1 | LL | impl Trait for Local {} - | ^^^^^^^^^^^^^^^^^^^^ missing `foo`, `bar` in implementation + | ^^^^^^^^^^^^^^^^^^^^ missing `foo`, `bar`, `baz`, `quux` in implementation | = help: implement the missing item: `fn foo(_: impl Sized) { todo!() }` - = help: implement the missing item: `fn bar<T>(_: impl Sized) { todo!() }` + = help: implement the missing item: `fn bar<T>(_: impl Sized) where Foo<T>: MetaSized { todo!() }` + = help: implement the missing item: `fn baz<const N: usize>() { todo!() }` + = help: implement the missing item: `fn quux<'a: 'b, 'b, T>() where T: ?Sized { todo!() }` error: aborting due to 1 previous error diff --git a/tests/ui/suggestions/auxiliary/dep.rs b/tests/ui/suggestions/auxiliary/dep.rs index ac0de418313..c28c8b8a52f 100644 --- a/tests/ui/suggestions/auxiliary/dep.rs +++ b/tests/ui/suggestions/auxiliary/dep.rs @@ -1,4 +1,16 @@ +#![feature(sized_hierarchy)] + +use std::marker::MetaSized; + +pub struct Foo<T> { + inner: T, +} + pub trait Trait { fn foo(_: impl Sized); - fn bar<T>(_: impl Sized); + fn bar<T>(_: impl Sized) + where + Foo<T>: MetaSized; + fn baz<'a, const N: usize>(); + fn quux<'a: 'b, 'b, T: ?Sized>(); } |
