Skip to content

Commit

Permalink
Remove some annotations that just specify the default
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Feb 22, 2024
1 parent e4622e0 commit 1efb747
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 17 deletions.
2 changes: 0 additions & 2 deletions tests/ui/rfcs/impl-trait/higher-ranked-regions-diag.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Regression test for #97099.
// This was an ICE because `impl Sized` captures the lifetime 'a.

// check-fail

trait Trait<E> {
type Assoc;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/rfcs/impl-trait/higher-ranked-regions-diag.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0700]: hidden type for `impl Sized` captures lifetime that does not appear in bounds
--> $DIR/higher-ranked-regions-diag.rs:21:5
--> $DIR/higher-ranked-regions-diag.rs:19:5
|
LL | fn bar() -> impl for<'a> Trait<&'a (), Assoc = impl Sized> {
| -- ---------- opaque type defined here
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// Basic tests for opaque type inference under for<_> binders.

// check-fail

#![feature(type_alias_impl_trait)]

trait Trait<'a> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
error[E0792]: expected generic lifetime parameter, found `'a`
--> $DIR/higher-ranked-regions-basic.rs:17:55
--> $DIR/higher-ranked-regions-basic.rs:15:55
|
LL | type Opq<'a> = impl Sized + 'a;
| -- this generic parameter must be used with a generic lifetime parameter
LL | fn test() -> impl for<'a> Trait<'a, Ty = Opq<'a>> {}
| ^^

error[E0700]: hidden type for `impl Sized` captures lifetime that does not appear in bounds
--> $DIR/higher-ranked-regions-basic.rs:23:58
--> $DIR/higher-ranked-regions-basic.rs:21:58
|
LL | fn test() -> impl for<'a> Trait<'a, Ty = impl Sized> {}
| -- ---------- ^^
Expand All @@ -16,7 +16,7 @@ LL | fn test() -> impl for<'a> Trait<'a, Ty = impl Sized> {}
| hidden type `&'a ()` captures the lifetime `'a` as defined here

error[E0700]: hidden type for `capture_tait::Opq0` captures lifetime that does not appear in bounds
--> $DIR/higher-ranked-regions-basic.rs:32:23
--> $DIR/higher-ranked-regions-basic.rs:30:23
|
LL | type Opq0 = impl Sized;
| ---------- opaque type defined here
Expand All @@ -27,7 +27,7 @@ LL | fn test() -> Opq2 {}
| ^^

error[E0792]: expected generic lifetime parameter, found `'a`
--> $DIR/higher-ranked-regions-basic.rs:41:23
--> $DIR/higher-ranked-regions-basic.rs:39:23
|
LL | type Opq1<'a> = impl for<'b> Trait<'b, Ty = Opq0<'b>>; // <- Note 'b
| -- this generic parameter must be used with a generic lifetime parameter
Expand All @@ -36,7 +36,7 @@ LL | fn test() -> Opq2 {}
| ^^

error[E0700]: hidden type for `capture_tait_complex_fail::Opq0<'a>` captures lifetime that does not appear in bounds
--> $DIR/higher-ranked-regions-basic.rs:51:23
--> $DIR/higher-ranked-regions-basic.rs:49:23
|
LL | type Opq0<'a> = impl Sized;
| ---------- opaque type defined here
Expand All @@ -47,47 +47,47 @@ LL | fn test() -> Opq2 {}
| ^^

error[E0792]: non-defining opaque type use in defining scope
--> $DIR/higher-ranked-regions-basic.rs:59:41
--> $DIR/higher-ranked-regions-basic.rs:57:41
|
LL | fn test() -> impl for<'a> Trait<'a, Ty = Opq0<'a, 'static>> {}
| ^^^^^^^^^^^^^^^^^^^^^^ argument `'static` is not a generic parameter
|
note: for this opaque type
--> $DIR/higher-ranked-regions-basic.rs:58:25
--> $DIR/higher-ranked-regions-basic.rs:56:25
|
LL | type Opq0<'a, 'b> = impl Sized;
| ^^^^^^^^^^

error[E0792]: expected generic lifetime parameter, found `'a`
--> $DIR/higher-ranked-regions-basic.rs:59:65
--> $DIR/higher-ranked-regions-basic.rs:57:65
|
LL | type Opq0<'a, 'b> = impl Sized;
| -- this generic parameter must be used with a generic lifetime parameter
LL | fn test() -> impl for<'a> Trait<'a, Ty = Opq0<'a, 'static>> {}
| ^^

error: non-defining opaque type use in defining scope
--> $DIR/higher-ranked-regions-basic.rs:68:41
--> $DIR/higher-ranked-regions-basic.rs:66:41
|
LL | fn test() -> impl for<'a> Trait<'a, Ty = Opq0<'a, 'a>> {}
| ^^^^^^^^^^^^^^^^^ generic argument `'a` used twice
|
note: for this opaque type
--> $DIR/higher-ranked-regions-basic.rs:67:25
--> $DIR/higher-ranked-regions-basic.rs:65:25
|
LL | type Opq0<'a, 'b> = impl Sized;
| ^^^^^^^^^^

error[E0792]: expected generic lifetime parameter, found `'a`
--> $DIR/higher-ranked-regions-basic.rs:68:60
--> $DIR/higher-ranked-regions-basic.rs:66:60
|
LL | type Opq0<'a, 'b> = impl Sized;
| -- this generic parameter must be used with a generic lifetime parameter
LL | fn test() -> impl for<'a> Trait<'a, Ty = Opq0<'a, 'a>> {}
| ^^

error[E0792]: expected generic lifetime parameter, found `'a`
--> $DIR/higher-ranked-regions-basic.rs:78:23
--> $DIR/higher-ranked-regions-basic.rs:76:23
|
LL | type Opq1<'a> = impl for<'b> Trait<'b, Ty = Opq0<'a, 'b>>;
| -- this generic parameter must be used with a generic lifetime parameter
Expand Down

0 comments on commit 1efb747

Please sign in to comment.