-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-closuresArea: Closures (`|…| { … }`)Area: Closures (`|…| { … }`)A-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an AST
Description
#17041 implemented unboxed closure sugar parsing for trait bounds, but it doesn't seem to be implemented for trait objects.
I realize that this example probably wouldn't work anyway due to the lack of higher-rank lifetimes, but the point is that the compiler yields a parser error.
trait Router {
fn route(&mut self, p: &Path) -> Path;
}
impl<'a> Router for Box<FnMut(&'a Path) -> Path + 'a> {
fn route(&mut self, p: &Path) -> Path {
(*self).call_mut((p,))
}
}
fn main() {}
@p1start observed this as well.
Metadata
Metadata
Assignees
Labels
A-closuresArea: Closures (`|…| { … }`)Area: Closures (`|…| { … }`)A-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an AST