Repository navigation
Add PatKind::Err to AST/HIR - #119967
Add PatKind::Err to AST/HIR#119967
PatKind::Err to AST/HIR#119967Conversation
|
Some changes occurred in src/tools/rustfmt cc @rust-lang/rustfmt Some changes might have occurred in exhaustiveness checking cc @Nadrieril Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
|
Btw, if you'd like to have another small side project, you can equip |
We use rust/compiler/rustc_ast/src/ast.rs Lines 1294 to 1305 in 2730354 |
| | PatKind::Never | ||
| | PatKind::Or(_) => false, | ||
| | PatKind::Or(_) | ||
| | PatKind::Err(_) => false, |
There was a problem hiding this comment.
Not related to this PR, but I find this weird... Wild can match only a single thing if it's for a type like (), similarly 1..=1, similarly []....
commented
Jan 17, 2024
|
@bors delegate+ |
commented
Jan 17, 2024
|
✌️ @ShE3py, you can now approve this pull request! If @WaffleLapkin told you to " |
commented
Jan 17, 2024
|
Might be worth mentioning that the impls of rust/compiler/rustc_ast/src/mut_visit.rs Lines 1635 to 1667 in aa5f781 |
commented
Jan 17, 2024
|
Ty!
I looked a bit and at first glance it may be possible to add something like ast::ExprKind::Err(guar) => hir::ExprKind::Err(*guar),
ast::ExprKind::Dummy => hir::ExprKind::Err(self.dcx().span_delayed_bug(e.span, "lowered ExprKind::Dummy")),I might give it a try next week. |
commented
Jan 17, 2024
commented
Jan 17, 2024
|
@ShE3py: Yeah, general approach of splitting it and adding a dummy variant for " |
|
|
#116715 added
thir::PatKind::Error; this PR addshir::PatKind::Errandast::PatKind::Err(see #118625 (comment).)@rustbot label +A-patterns
r? WaffleLapkin