-
-
Notifications
You must be signed in to change notification settings - Fork 0
Loop match proper errors #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loop match proper errors #3
Conversation
| fn local(expr: &rustc_hir::Expr<'_>) -> Option<hir::HirId> { | ||
| if let hir::ExprKind::Path(hir::QPath::Resolved(_, path)) = expr.kind { | ||
| if let Res::Local(hir_id) = path.res { | ||
| return Some(hir_id); | ||
| } | ||
| } | ||
|
|
||
| None | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ideally this would be a method somewhere, but I'm not sure where that should be
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure either. Can be left for later.
f5122c3 to
18ac1ea
Compare
18ac1ea to
2265cb4
Compare
| Ok(target_id) => { | ||
| let Some(value) = value else { | ||
| let span = expr.span; | ||
| self.tcx.dcx().emit_fatal(ConstContinueMissingValue { span }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally this would be a regular error and produce ExprKind::Err instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no error variant for this type I think? https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/thir/enum.ExprKind.html
|
Can you tick the checkbox for better errors in the todo file? |
eb82562
into
trifectatechfoundation:loop_match_attr
No description provided.