- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
Closed
Labels
A-type-systemArea: Type systemArea: Type systemT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
When writing for<'a : 'b> fn(...) -> ..., the constraint 'a : 'b is completely ignored by borrowcheck.
This makes it possible to write the following function, which is weird:
fn g<'b>(f : for<'c : 'b> fn(&'c mut i32) -> &'b mut i32) -> &'b mut i32 {
    let f2 : for<'c> fn(&'c mut i32) -> &'b mut i32 =
      f ; // WTF, we are dropping the constraint 'c : 'b ?
}
Metadata
Metadata
Assignees
Labels
A-type-systemArea: Type systemArea: Type systemT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.