Skip to content

unnormalized user annotations can be ill-formed #104764

Closed
@aliemjay

Description

@aliemjay

We're still not doing WF-checks on user annotations prior to normalization, so this code is still accepted:

trait Trait { type Ty; }
impl<T> Trait for T { type Ty = (); }
fn test<T>() {
    let _: <&'static T as Trait>::Ty = ();
}

I consider this a different issue than #101350 because it is a more long-standing problem and not strictly an NLL regression.

Originally posted by @aliemjay in #101947 (comment)

@rustbot label C-bug T-types A-borrow-checker A-NLL NLL-sound
@rustbot claim

Metadata

Metadata

Assignees

Labels

A-NLLArea: Non-lexical lifetimes (NLL)A-borrow-checkerArea: The borrow checkerC-bugCategory: This is a bug.NLL-soundWorking towards the "invalid code does not compile" goalT-typesRelevant to the types team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions