Skip to content

Conversation

@folkertdev
Copy link
Member

No description provided.

Comment on lines +906 to +912
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
}
Copy link
Member Author

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

Copy link
Collaborator

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.

@folkertdev folkertdev force-pushed the loop-match-proper-errors branch 2 times, most recently from f5122c3 to 18ac1ea Compare March 13, 2025 15:08
@folkertdev folkertdev force-pushed the loop-match-proper-errors branch from 18ac1ea to 2265cb4 Compare March 13, 2025 15:12
@folkertdev folkertdev requested a review from bjorn3 March 13, 2025 15:14
Ok(target_id) => {
let Some(value) = value else {
let span = expr.span;
self.tcx.dcx().emit_fatal(ConstContinueMissingValue { span })
Copy link
Collaborator

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bjorn3
Copy link
Collaborator

bjorn3 commented Mar 13, 2025

Can you tick the checkbox for better errors in the todo file?

@folkertdev folkertdev merged commit eb82562 into trifectatechfoundation:loop_match_attr Mar 13, 2025
1 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants