forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Capture lifetimes for associated type bounds destined to be lowered t…
…o opaques
- Loading branch information
1 parent
b2515fa
commit f1679f7
Showing
3 changed files
with
31 additions
and
0 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 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
19 changes: 19 additions & 0 deletions
19
tests/ui/impl-trait/in-trait/lifetime-in-associated-trait-bound.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,19 @@ | ||
// check-pass | ||
|
||
#![feature(associated_type_bounds, return_position_impl_trait_in_trait)] | ||
|
||
trait Trait { | ||
type Type; | ||
|
||
fn method(&self) -> impl Trait<Type: '_>; | ||
} | ||
|
||
impl Trait for () { | ||
type Type = (); | ||
|
||
fn method(&self) -> impl Trait<Type: '_> { | ||
() | ||
} | ||
} | ||
|
||
fn main() {} |