diff options
| author | Ezra Shaw <ezrasure@outlook.com> | 2023-04-14 20:18:28 +1200 |
|---|---|---|
| committer | Ezra Shaw <ezrasure@outlook.com> | 2023-04-14 20:18:28 +1200 |
| commit | b506d966a3e413f0d8f3a2fc470f941d7d8c471d (patch) | |
| tree | 37c190ef038618a7b93e9ffa11d1382c2ef76113 /tests/ui/implied-bounds | |
| parent | ecf2a9b75ec591db6e89f4bde391b87f35c2ea08 (diff) | |
| download | rust-b506d966a3e413f0d8f3a2fc470f941d7d8c471d.tar.gz rust-b506d966a3e413f0d8f3a2fc470f941d7d8c471d.zip | |
implement review suggestions
Diffstat (limited to 'tests/ui/implied-bounds')
| -rw-r--r-- | tests/ui/implied-bounds/issue-110161.rs | 12 | ||||
| -rw-r--r-- | tests/ui/implied-bounds/issue-110161.stderr | 4 |
2 files changed, 9 insertions, 7 deletions
diff --git a/tests/ui/implied-bounds/issue-110161.rs b/tests/ui/implied-bounds/issue-110161.rs index ca75026ffe8..e52c8356b52 100644 --- a/tests/ui/implied-bounds/issue-110161.rs +++ b/tests/ui/implied-bounds/issue-110161.rs @@ -3,22 +3,24 @@ // compile-flags: --crate-type=lib -trait Trait { +trait LtTrait { type Ty; } // erroneous `Ty` impl -impl Trait for () { +impl LtTrait for () { //~^ ERROR not all trait items implemented, missing: `Ty` [E0046] } // `'lt` is not constrained by the erroneous `Ty` -impl<'lt, T> Trait for Box<T> +impl<'lt, T> LtTrait for Box<T> where - T: Trait<Ty = &'lt ()>, + T: LtTrait<Ty = &'lt ()>, { type Ty = &'lt (); } // unconstrained lifetime appears in implied bounds -fn test(_: <Box<()> as Trait>::Ty) {} +fn test(_: <Box<()> as LtTrait>::Ty) {} + +fn test2<'x>(_: &'x <Box<()> as LtTrait>::Ty) {} diff --git a/tests/ui/implied-bounds/issue-110161.stderr b/tests/ui/implied-bounds/issue-110161.stderr index c76b4737626..9e0188694ed 100644 --- a/tests/ui/implied-bounds/issue-110161.stderr +++ b/tests/ui/implied-bounds/issue-110161.stderr @@ -4,8 +4,8 @@ error[E0046]: not all trait items implemented, missing: `Ty` LL | type Ty; | ------- `Ty` from trait ... -LL | impl Trait for () { - | ^^^^^^^^^^^^^^^^^ missing `Ty` in implementation +LL | impl LtTrait for () { + | ^^^^^^^^^^^^^^^^^^^ missing `Ty` in implementation error: aborting due to previous error |
