Fix handling of const patterns

E.g. in `match x { None => ... }`, `None` is a path pattern (resolving to the
option variant), not a binding. To determine this, we need to try to resolve the
name during lowering. This isn't too hard since we already need to resolve names
for macro expansion anyway (though maybe a bit hacky).

Fixes #1618.
This commit is contained in:
Florian Diebold 2020-02-21 16:56:34 +01:00
parent e3037c2631
commit f1f45f9191
5 changed files with 85 additions and 6 deletions

View file

@ -48,7 +48,7 @@ pub enum Literal {
#[derive(Debug, Clone, Eq, PartialEq)]
pub enum Expr {
/// This is produced if syntax tree does not have a required expression piece.
/// This is produced if the syntax tree does not have a required expression piece.
Missing,
Path(Path),
If {