-
Notifications
You must be signed in to change notification settings - Fork 13k
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
dont ICE when ConstKind::Expr for is_const_evaluatable #116740
dont ICE when ConstKind::Expr for is_const_evaluatable #116740
Conversation
r? @wesleywiser (rustbot has picked a reviewer for you, use r? to override) |
Some changes occurred in cc @BoxyUwU |
I dont think this is the right solution. It's fine for |
e43e5d0
to
9d4ab9d
Compare
@rustbot ready |
}; | ||
Some(err) | ||
} | ||
ty::ConstKind::Expr(_) => 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.
we should still actually emit an error for these failures imo
9d4ab9d
to
4a7da1a
Compare
let mut err = self | ||
.tcx | ||
.sess | ||
.struct_span_err(span, "evaluation of ConstKind::Expr is not supported"); |
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.
"ConstKind::Expr" is not something that should be exposed to users. really the message should be the same as for ConstKind::Unevaluated
except that instead of using the source map stuff we should just print the const out using {}
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.
@rustbot ready
4a7da1a
to
69a2bd6
Compare
@bors r+ rollup |
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#116740 (dont ICE when ConstKind::Expr for is_const_evaluatable) - rust-lang#117914 (On borrow return type, suggest borrowing from arg or owned return type) - rust-lang#117927 (Clarify how to choose a FutureIncompatibilityReason variant.) - rust-lang#118855 (Improve an error involving attribute values.) - rust-lang#118856 (rustdoc-search: clean up parser) - rust-lang#118865 (rustc_codegen_llvm: Enforce `rustc::potential_query_instability` lint) - rust-lang#118866 (llvm-wrapper: adapt for LLVM API change) - rust-lang#118868 (Correctly gate the parsing of match arms without body) - rust-lang#118877 (tests: CGU tests require build-pass, not check-pass (remove FIXME)) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#116740 - lenko-d:const_evaluatable_failed_for_non_unevaluated_const, r=BoxyUwU dont ICE when ConstKind::Expr for is_const_evaluatable The problem is that we are not handling ConstKind::Expr inside report_not_const_evaluatable_error Fixes [rust-lang#114151]
The problem is that we are not handling ConstKind::Expr inside report_not_const_evaluatable_error
Fixes [#114151]