Update reference for target_feature_11. by veluca93 · Pull Request #1720 · rust-lang/reference (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation9 Commits5 Checks5 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

veluca93

@ehuss

Note there was a previous PR at #1181 that includes some comments of things that were missing or confusing. For example #1181 (comment), contained some changes that happened over time that hadn't yet been captured.

@veluca93

Note there was a previous PR at #1181 that includes some comments of things that were missing or confusing. For example #1181 (comment), contained some changes that happened over time that hadn't yet been captured.

I was not aware of the existing PR!

I believe I have integrated the main comments from that PR, PTAL :-)

@veluca93

chorman0773

Choose a reason for hiding this comment

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

Content looks to be correct (verified by short code tests) and I don't have any editorial concerns.

ehuss

Comment on lines 92 to 94

- `#[target_feature]` functions (and closures that inherit the attribute)
can only be safely called within caller that enable all the `target_feature`s
that the callee enables.

Choose a reason for hiding this comment

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

Does this still exclude implicitly enabled features? If so, can this be clarified to state that it is only the explicitly listed features from the attribute on both sides, and does not consider implicit ones?

Choose a reason for hiding this comment

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

This does include implicitly enabled features on either side.
Although of course implicitly enabled features on the callee are enabled on the caller too if all the explicitly enabled features in the callee are enabled...

Do you think that is something that should be clarified?

Choose a reason for hiding this comment

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

Ah, ok. It looks like this changed in rust-lang/rust#128221 since the last time I looked at this.

I'd like to do a quick editorial pass, and I'll try to clarify this point. I'll try to get to that today.

@ehuss

Am I correct in understanding that this is a new "unsafe superpower"? That is, do we need to add a new item to unsafety.md that defines something along the lines of calling a safe function with an unmatched target_feature?

@veluca93

Am I correct in understanding that this is a new "unsafe superpower"? That is, do we need to add a new item to unsafety.md that defines something along the lines of calling a safe function with an unmatched target_feature?

I think this is technically true, yes (in some sense it is not new, because tf functions were unsafe before, but it's probably worth mentioning explicitly)

@ehuss

@ehuss

The unsafe block enables several abilities beyond just calling unsafe functions and dereferencing pointers. Link to the actual list of things you can do.

@ehuss

@ehuss

This does some rewording to try to make things a little more explicit and clearer:

traviscross

ehuss

Choose a reason for hiding this comment

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

This was referenced

Feb 13, 2025

compiler-errors added a commit to compiler-errors/rust that referenced this pull request

Feb 25, 2025

@compiler-errors

Update books

rust-lang/book

2 commits in d4d2c18cbd20876b2130a546e790446a8444cb32..4a01a9182496f807aaa5f72d93a25ce18bcbe105 2025-02-24 14:48:34 UTC to 2025-02-13 19:29:47 UTC

rust-lang/edition-guide

2 commits in 8dbdda7cae4fa030f09f8f5b63994d4d1dde74b9..daa4b763cd848f986813b5cf8069e1649f7147af 2025-02-22 14:58:51 UTC to 2025-02-21 02:30:17 UTC

rust-lang/nomicon

1 commits in 336f75835a6c0514852cc65aba9a698b699b13c8..8f5c7322b65d079aa5b242eb10d89a98e12471e1 2025-02-19 13:16:47 UTC to 2025-02-19 13:16:47 UTC

rust-lang/reference

4 commits in 6195dbd70fc6f0980c314b4d23875ac570d8253a..615b4cec60c269cfc105d511c93287620032d5b0 2025-02-18 23:01:53 UTC to 2025-02-13 15:12:49 UTC

rust-timer added a commit to rust-lang-ci/rust that referenced this pull request

Feb 25, 2025

@rust-timer

Rollup merge of rust-lang#137552 - rustbot:docs-update, r=ehuss

Update books

rust-lang/book

2 commits in d4d2c18cbd20876b2130a546e790446a8444cb32..4a01a9182496f807aaa5f72d93a25ce18bcbe105 2025-02-24 14:48:34 UTC to 2025-02-13 19:29:47 UTC

rust-lang/edition-guide

2 commits in 8dbdda7cae4fa030f09f8f5b63994d4d1dde74b9..daa4b763cd848f986813b5cf8069e1649f7147af 2025-02-22 14:58:51 UTC to 2025-02-21 02:30:17 UTC

rust-lang/nomicon

1 commits in 336f75835a6c0514852cc65aba9a698b699b13c8..8f5c7322b65d079aa5b242eb10d89a98e12471e1 2025-02-19 13:16:47 UTC to 2025-02-19 13:16:47 UTC

rust-lang/reference

4 commits in 6195dbd70fc6f0980c314b4d23875ac570d8253a..615b4cec60c269cfc105d511c93287620032d5b0 2025-02-18 23:01:53 UTC to 2025-02-13 15:12:49 UTC

@ehuss ehuss mentioned this pull request

Feb 25, 2025