-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Make promote_consts
emit the errors when required promotion fails
#65946
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
Changes from all commits
9bb9833
46b68b0
122c6fe
627e3ef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1599,20 +1599,12 @@ impl<'a, 'tcx> Visitor<'tcx> for Checker<'a, 'tcx> { | |
// This is not a problem, because the argument explicitly | ||
// requests constness, in contrast to regular promotion | ||
// which happens even without the user requesting it. | ||
// We can error out with a hard error if the argument is not | ||
// constant here. | ||
// | ||
// `promote_consts` is responsible for emitting the error if | ||
// the argument is not promotable. | ||
if !IsNotPromotable::in_operand(self, arg) { | ||
debug!("visit_terminator_kind: candidate={:?}", candidate); | ||
self.promotion_candidates.push(candidate); | ||
} else { | ||
if is_shuffle { | ||
span_err!(self.tcx.sess, self.span, E0526, | ||
"shuffle indices are not constant"); | ||
|
||
} else { | ||
self.tcx.sess.span_err(self.span, | ||
&format!("argument {} is required to be a constant", | ||
i + 1)); | ||
} | ||
} | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,6 @@ const WHITELIST: &[&str] = &[ | |
"E0514", | ||
"E0519", | ||
"E0523", | ||
"E0526", | ||
"E0554", | ||
"E0570", | ||
"E0629", | ||
|
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.
Please remove (comment out? not sure)
E0526
from:src/librustc_mir/error_codes.rs
src/tools/tidy/src/error_codes_check.rs
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.
I removed it entirely from
tidy
but commented it out inlibrustc_mir
where there's other unused errors that are commented out.