Created
June 5, 2019 19:56
-
-
Save Centril/b0e62d31d4ae1849535c3e506e1fad64 to your computer and use it in GitHub Desktop.
Old test for nested lifetimes in associated type bounds
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
// compile-fail | |
#![feature(associated_type_bounds)] | |
use std::fmt::Debug; | |
trait Lam<Binder> { type App; } | |
fn nested_bounds<_0, _1, _2, D>() | |
where | |
D: Clone + Iterator<Item: Send + for<'a> Iterator<Item: for<'b> Lam<&'a &'b u8, App = _0>>>, | |
//~^ ERROR nested quantification of lifetimes [E0316] | |
_0: Debug, | |
{} | |
fn nested_bounds_desugared<_0, _1, _2, D>() | |
where | |
D: Clone + Iterator<Item = _2>, | |
_2: Send + for<'a> Iterator, | |
for<'a> <_2 as Iterator>::Item: for<'b> Lam<&'a &'b u8, App = _0>, | |
//~^ ERROR nested quantification of lifetimes [E0316] | |
_0: Debug, | |
{} | |
fn main() {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Alternative desugaring that might not error:
Should we allow nested lifetimes generally in the language e.g. when written explicitly?