-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
AST/HIR: Introduce ExprKind::Err
for better error recovery in the front-end
#56999
Conversation
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.
Really cool!
CC #48724
src/test/run-pass/macros/log_syntax-trace_macros-macro-locations.rs
Outdated
Show resolved
Hide resolved
--> $DIR/issue-40396.rs:12:21 | ||
| | ||
LL | (0..13).collect<Vec<i32>>(); | ||
| ^^^ did you mean `Vec { /* fields */ }`? |
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.
The fallout on this case is a bit unfortunate.
In my ideal world we would use something similar to #53578 to parse missing the turbofish and avoid all of these errors, but that's not gonna happen anytime soon.
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.
This is pretty bad, but not actually a fallout from this PR.
(0..13).collect<Vec<i32>>()
outside of macros already produced this.
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=0be590d180bad8cbea3789d5e7d2e269
This comment has been minimized.
This comment has been minimized.
737a178
to
4a6aa36
Compare
Updated with test fixes and one new commit making sure that all feature-gate errors are recoverable. |
r=me once travis is happy |
@bors r=estebank |
📌 Commit 4a6aa36 has been approved by |
AST/HIR: Introduce `ExprKind::Err` for better error recovery in the front-end This way we can avoid aborting compilation if expansion produces errors and generate `ExprKind::Err`s instead.
AST/HIR: Introduce `ExprKind::Err` for better error recovery in the front-end This way we can avoid aborting compilation if expansion produces errors and generate `ExprKind::Err`s instead.
Rollup of 10 pull requests Successful merges: - #56188 (enum type instead of variant suggestion unification ) - #56916 (Fix mutable references in `static mut`) - #56917 (Simplify MIR generation for logical operations) - #56953 (Mark tuple structs as live if their constructors are used) - #56964 (Remove `TokenStream::JointTree`.) - #56966 (Correct strings for raw pointer deref and array access suggestions) - #56999 (AST/HIR: Introduce `ExprKind::Err` for better error recovery in the front-end) - #57020 (Point to cause of `fn` expected return type) - #57032 (fix deprecation warnings in liballoc benches) - #57053 (Fix alignment for array indexing) Failed merges: r? @ghost
This PR failed in a rollup: #57075 (comment) |
@bors r- |
☔ The latest upstream changes (presumably #57108) made this pull request unmergeable. Please resolve the merge conflicts. |
9ed057f
to
fdde6df
Compare
@bors r=estebank |
📌 Commit fdde6df45855155510ca567b28dc37233bab9773 has been approved by |
⌛ Testing commit fdde6df45855155510ca567b28dc37233bab9773 with merge 220af3d83594be55382de515730c07d9067c41d0... |
⌛ Testing commit 994215781986afb842e4690592859e68a60092ca with merge 3e5056f704e1e533995af5aef6564c43876feba3... |
💔 Test failed - status-travis |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Fix a number of uncovered deficiencies in diagnostics
9942157
to
bc16ede
Compare
@bors r=estebank |
📌 Commit bc16ede has been approved by |
AST/HIR: Introduce `ExprKind::Err` for better error recovery in the front-end This way we can avoid aborting compilation if expansion produces errors and generate `ExprKind::Err`s instead.
☀️ Test successful - status-appveyor, status-travis |
Match on ast/hir::ExprKind::Err rustup rust-lang/rust#56999
This way we can avoid aborting compilation if expansion produces errors and generate
ExprKind::Err
s instead.