-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
141 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
src/test/ui/late-bound-lifetimes/downgraded_to_early_through_alias.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// check-pass | ||
|
||
trait Gats<'a> { | ||
type Assoc; | ||
type Assoc2; | ||
} | ||
|
||
trait Trait: for<'a> Gats<'a> { | ||
fn foo<'a>(_: &mut <Self as Gats<'a>>::Assoc) -> <Self as Gats<'a>>::Assoc2; | ||
} | ||
|
||
impl<'a> Gats<'a> for () { | ||
type Assoc = &'a u32; | ||
type Assoc2 = (); | ||
} | ||
|
||
type GatsAssoc<'a, T> = <T as Gats<'a>>::Assoc; | ||
type GatsAssoc2<'a, T> = <T as Gats<'a>>::Assoc2; | ||
|
||
impl Trait for () { | ||
fn foo<'a>(_: &mut GatsAssoc<'a, Self>) -> GatsAssoc2<'a, Self> {} | ||
} | ||
|
||
fn main() {} |
7 changes: 1 addition & 6 deletions
7
src/test/ui/issues/issue-47511.rs → ...st/ui/late-bound-lifetimes/issue-47511.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// ensures that we don't ICE when there are too many args supplied to the alias. | ||
|
||
trait Trait<'a> { | ||
type Assoc; | ||
} | ||
|
||
type Alias<'a, T> = <T as Trait<'a>>::Assoc; | ||
|
||
fn bar<'a, T: Trait<'a>>(_: Alias<'a, 'a, T>) {} | ||
//~^ error: this type alias takes 1 lifetime argument but 2 lifetime arguments were supplied | ||
|
||
fn main() {} |
17 changes: 17 additions & 0 deletions
17
src/test/ui/late-bound-lifetimes/mismatched_arg_count.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
error[E0107]: this type alias takes 1 lifetime argument but 2 lifetime arguments were supplied | ||
--> $DIR/mismatched_arg_count.rs:9:29 | ||
| | ||
LL | fn bar<'a, T: Trait<'a>>(_: Alias<'a, 'a, T>) {} | ||
| ^^^^^ -- help: remove this lifetime argument | ||
| | | ||
| expected 1 lifetime argument | ||
| | ||
note: type alias defined here, with 1 lifetime parameter: `'a` | ||
--> $DIR/mismatched_arg_count.rs:7:6 | ||
| | ||
LL | type Alias<'a, T> = <T as Trait<'a>>::Assoc; | ||
| ^^^^^ -- | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0107`. |