In AST->HIR and HIR->MIR conversion, the terms 'lowering' and 'desugaring' mean the same right? I've seen both used in various places and wasn't sure if there's a difference
Not an expert at all, but I've always thought of it as desugaring also includes some transformations (e.g. in the AST->HIR,
? is expanded into a
match) whereas lowering is just converting from one representation to another.
oh right, so IIUC lowering is the the general transformation and then there's additional desugarings on top like
for loops and
yes, that's correct. Lowering can be from
hir::ExprKind::Binary without any changes to representation
desugaring always means some sort of expansion into a reduced set of possible representations
Depending on context, "desugaring" sometimes also refers to an in-language desugaring.