Skip to content
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

Print list of missing target features when calling a function with target features outside an unsafe block #118333

Merged
merged 2 commits into from
Nov 29, 2023

Conversation

eduardosm
Copy link
Contributor

Fixes #108680

Supersedes #109710. I used the same wording for the messages, but the implementation is different.

r? @est31

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 26, 2023
@rustbot
Copy link
Collaborator

rustbot commented Nov 26, 2023

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

CallToFunctionWith,
CallToFunctionWith {
/// Target features enabled in callee's `#[target_feature]` but missing in
/// caller's `#[target_feature]`
Copy link

Choose a reason for hiding this comment

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

Suggested change
/// caller's `#[target_feature]`
/// caller's `#[target_feature]`.

Copy link
Member

@est31 est31 left a comment

Choose a reason for hiding this comment

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

Thanks for filing!

LGTM except one question: could you add something to the existing test that excercises the mir_transform_target_feature_call_note case with multiple target features? Because right now, there is only tests for one.

@eduardosm
Copy link
Contributor Author

Done.

I just learned about -Z thir-unsafeck. If I understood it correctly, it is an alternative unsafety checker that runs on a different stage. Do we want to make the change there too?

@est31
Copy link
Member

est31 commented Nov 28, 2023

Do we want to make the change there too?

Yeah good point, we'd want that change be present there, too. So the .thir.stderr file should have the same changes in the end as .mir.stderr, ideally.

…unction with target features outside an unsafe block
@eduardosm
Copy link
Contributor Author

Done, also added a test to cover the case of an unsafe function with a unsafe_op_in_unsafe_fn lint.

Copy link
Member

@est31 est31 left a comment

Choose a reason for hiding this comment

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

Great work, thank you!

@est31
Copy link
Member

est31 commented Nov 29, 2023

@bors r+

@bors
Copy link
Contributor

bors commented Nov 29, 2023

📌 Commit 6b066a9 has been approved by est31

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 29, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 29, 2023
…tures, r=est31

Print list of missing target features when calling a function with target features outside an unsafe block

Fixes rust-lang#108680

Supersedes rust-lang#109710. I used the same wording for the messages, but the implementation is different.

r? `@est31`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 29, 2023
…tures, r=est31

Print list of missing target features when calling a function with target features outside an unsafe block

Fixes rust-lang#108680

Supersedes rust-lang#109710. I used the same wording for the messages, but the implementation is different.

r? ``@est31``
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 29, 2023
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#118157 (Add `never_patterns` feature gate)
 - rust-lang#118191 (Suggest `let` or `==` on typo'd let-chain)
 - rust-lang#118231 (also add is_empty to const raw slices)
 - rust-lang#118333 (Print list of missing target features when calling a function with target features outside an unsafe block)
 - rust-lang#118426 (ConstProp: Correctly remove const if unknown value assigned to it.)
 - rust-lang#118428 (rustdoc: Move `AssocItemRender` and `RenderMode` to `html::render`.)
 - rust-lang#118438 (Update nto-qnx.md)

Failed merges:

 - rust-lang#118268 (Pretty print `Fn<(..., ...)>` trait refs with parentheses (almost) always)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 911a5ee into rust-lang:master Nov 29, 2023
11 checks passed
@rustbot rustbot added this to the 1.76.0 milestone Nov 29, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Nov 29, 2023
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

Fixes rust-lang#108680

Supersedes rust-lang#109710. I used the same wording for the messages, but the implementation is different.

r? `@est31`
@eduardosm eduardosm deleted the print-missing-target-features branch November 29, 2023 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

target_feature 1.1 error should print the list of missing target features
4 participants