Uh oh!
There was an error while loading. Please reload this page.
Fix target_feature 1.1 should print the list of missing target features - #109710
Fix target_feature 1.1 should print the list of missing target features#109710rohaquinlop wants to merge 1 commit into
Conversation
rustbot
commented
Mar 28, 2023
r? @oli-obk (rustbot has picked a reviewer for you, use r? to override) |
rustbot
commented
Mar 28, 2023
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
rohaquinlop
commented
Mar 28, 2023
@est31 Already created the PR. |
This comment has been minimized.
This comment has been minimized.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
est31
left a comment
There was a problem hiding this comment.
This looks really great already, you will also need to bless the tests whose output has been changed by this PR. I offer you to help with this as you said you have M1 hardware which makes it hard to work on x86 specific tests: i can file a PR to your PR once it is ready in the other components.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
bors
commented
Mar 30, 2023
☔ The latest upstream changes (presumably #109734) made this pull request unmergeable. Please resolve the merge conflicts. |
d4ad06c to
3260f5cCompare
This comment has been minimized.
This comment has been minimized.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
3260f5c to
4270524Compare
This comment has been minimized.
This comment has been minimized.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
4270524 to
d7a8af4Compare
This comment has been minimized.
This comment has been minimized.
rohaquinlop
commented
Apr 16, 2023
@estebank What should we do for the test outputs in another architectures? |
est31
commented
Apr 16, 2023
LGTM except for the test issue 👍 |
This comment has been minimized.
This comment has been minimized.
50d411d to
63dc009Compare
This comment has been minimized.
This comment has been minimized.
63dc009 to
fbc38d2Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
802c173 to
004b5e0Compare
This comment has been minimized.
This comment has been minimized.
004b5e0 to
ae93226Compareae93226 to
73fd02fComparerohaquinlop
commented
Jun 7, 2023
@rustbot label -S-waiting-on-author +S-waiting-on-review |
| with interior mutability, the field can be changed to invalid values", | ||
| ), | ||
| CallToFunctionWith => ( | ||
| CallToFunctionWith { missing_features: _, target_features: _ } => ( |
There was a problem hiding this comment.
You can use { .. } here, this holds true for the other occurrences of this pattern in the last commit as well.
| } | ||
| } | ||
| fn target_features(&self) -> Vec<Symbol> { |
There was a problem hiding this comment.
This should return Option<Vec<Symbol>> here instead of an empty vector. Then in the note_missing_features function, you don't need to check is_empty any more but can directly use self.target_features()?.
| } | ||
| impl UnsafetyViolationDetails { | ||
| fn missing_features(&self) -> Vec<Symbol> { |
There was a problem hiding this comment.
Same here, missing_features should return an Option<Vec<Symbol>> instead.
| diag.help(help); | ||
| } | ||
| match self.details.violation { |
There was a problem hiding this comment.
The outer match is not needed here, you can just collapse it to a single if let. If it's None, you just do what you do in the _ arm.
There was a problem hiding this comment.
This was the old code
There was a problem hiding this comment.
It's still part of the diff though? Maybe you haven't added these changes to git yet?
There was a problem hiding this comment.
Ohh you meant what I am asking you to do reflects the older state of a PR, and you were asked to change it? I don't think so, but please correct me if I'm wrong. The older state also had a match, just no if let inside. Now you are doing both. Ideally you'd just have an if let, like:
ifletSome(note_missing_features) = self.details.violation.note_missing_features(){
diag.note(note_missing_features);}else{
diag.note(self.details.clone().note());}The note_missing_features function will already return None if it's not a CallToFunctionWith, we just use this fact here.
My demand is more or less the same thing I asked about in march: #109710 (comment)
If you need more clarifications, please ask!
| details: unsafe_details, | ||
| op_in_unsafe_fn_allowed, | ||
| help: details.help_missing_features(), | ||
| note_missing_features: details.note_missing_features(), |
There was a problem hiding this comment.
You don't need to store this any more, you can just call note_missing_features() where you'd be using the note_missing_features field. Same goes for the help field.
| if let Some(help) = self.help { | ||
| diag.help(help); | ||
| } | ||
| match self.details.violation { |
There was a problem hiding this comment.
Same holds here, this can be collapsed into a single if let Some(note_missing_features) = self.self.details.note_missing_features().
| diag.set_arg("details", desc); | ||
| diag.span_label(self.details.span, self.details.label()); | ||
| diag.note(self.details.note()); | ||
| diag.span_label(self.details.clone().span, self.details.clone().label()); |
There was a problem hiding this comment.
I think you don't need to clone details to obtain the span, just to obtain the label.
There was a problem hiding this comment.
It's necessary, if I don't clone it then will be an error here
bors
commented
Jun 13, 2023
☔ The latest upstream changes (presumably #112017) made this pull request unmergeable. Please resolve the merge conflicts. |
oli-obk
commented
Jun 14, 2023
r? @est31 (feel free to bounce back to me if you prefer) |
est31
commented
Jul 20, 2023
This has some still outstanding points and also needs a rebase, @rohaquinlop if you need advice for any of these please write! |
rohaquinlop
commented
Jul 21, 2023
@est31 I'll go back to work on this issue, thanks in advance |
JohnCSimon
commented
Oct 1, 2023
ping from triage - can you post your status on this PR? There hasn't been an update in a few months. Thanks! FYI: when a PR is ready for review, send a message containing |
Dylan-DPC
commented
Oct 21, 2023
Closing this as inactive. Feel free to reöpen this pr or create a new pr if you get the time to work on this. Thanks |
…tures, r=est31 Print list of missing target features when calling a function with target features outside an unsafe block Fixesrust-lang#108680 Supersedes rust-lang#109710. I used the same wording for the messages, but the implementation is different. r? `@est31`
…tures, r=est31 Print list of missing target features when calling a function with target features outside an unsafe block Fixesrust-lang#108680 Supersedes rust-lang#109710. I used the same wording for the messages, but the implementation is different. r? ``@est31``
…tures, r=est31 Print list of missing target features when calling a function with target features outside an unsafe block Fixesrust-lang#108680 Supersedes rust-lang#109710. I used the same wording for the messages, but the implementation is different. r? `@est31`
Rollup merge of rust-lang#118333 - eduardosm:print-missing-target-features, r=est31 Print list of missing target features when calling a function with target features outside an unsafe block Fixesrust-lang#108680 Supersedes rust-lang#109710. I used the same wording for the messages, but the implementation is different. r? `@est31`
Fixed#108680
According to the issue description implemented the note and help description. Removed the note in the general case.