Skip to content

NLL doesn't check user type annotations are well-formed #54620

Closed
@matthewjasper

Description

@matthewjasper

For example, this code is accepted with NLL enabled:

fn call2<'a, 'b>(a: &'a usize, b: &'b usize) {
let z: Option<&'b &'a usize> = None;//~ ERROR E0623
}
fn call3<'a, 'b>(a: &'a usize, b: &'b usize) {
let y: Paramd<'a> = Paramd { x: a };
let z: Option<&'b Paramd<'a>> = None;//~ ERROR E0623
}
fn call4<'a, 'b>(a: &'a usize, b: &'b usize) {
let z: Option<&'a &'b usize> = None;//~ ERROR E0623
}

cc #47184

Metadata

Metadata

Assignees

Labels

A-NLLArea: Non-lexical lifetimes (NLL)E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.NLL-soundWorking towards the "invalid code does not compile" goal

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions