fix: Look for enum variants and trait assoc functions when looking for lang items#9808
fix: Look for enum variants and trait assoc functions when looking for lang items#9808bors[bot] merged 1 commit intorust-lang:masterfrom
Conversation
|
bors r+ I wonder why |
|
Good question, |
|
Interesting, they were added for AST lowering purposes rust-lang/rust#75145 |
|
Interesting! So that means that we might want to change I don't think we do a lot of desugaring today, we have an explicit I think that's the right pattern -- AST-based desugaring is a nice thing in theory, but, in practice, it doesn't save that much effort. And the lowering shape in rustc, which has this awkward effect of needing both unresolved and resolved paths in the same data type, feels like an evidence for awkwardness of lowering. At this point, it seems that it's better to carry the surface syntax as is through the type-inference, and then, in a single step, resolve all names and simplify things to some core language. |
Examples for lang enum variants are the
Optionvariants.Assoc trait functions aren't being seen since they aren't declared in the direct module scope.