-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Open
Labels
bugSomething isn't workingSomething isn't workingcompilerGeneral compiler. Should eventually become more specific as the issue is triagedGeneral compiler. Should eventually become more specific as the issue is triagedcompiler: frontendEverything to do with type checking, control flow analysis, and everything between parsing and IRgenEverything to do with type checking, control flow analysis, and everything between parsing and IRgenteam:compilerCompiler TeamCompiler Team
Description
Type checking of trait constraints inserts items of traits listed in the constraints, into the namespace.
E.g., the following project compiles without errors, because C gets inserted into the namespace of f.
library;
pub trait A {
const C: bool;
}
struct S<T> { }
impl<T> S<T> {
fn f() -> bool where T: A {
C // <<<--- NO ERROR HERE!!
}
}Additionally, this insertion causes issues like #7396.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingcompilerGeneral compiler. Should eventually become more specific as the issue is triagedGeneral compiler. Should eventually become more specific as the issue is triagedcompiler: frontendEverything to do with type checking, control flow analysis, and everything between parsing and IRgenEverything to do with type checking, control flow analysis, and everything between parsing and IRgenteam:compilerCompiler TeamCompiler Team