Skip to content

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented Jun 30, 2025

New rules:

  • attributes.codegen.inline.syntax
  • attributes.codegen.inline.allowed-positions
  • attributes.codegen.inline.duplicates
  • attributes.codegen.inline.trait
  • attributes.codegen.inline.externally-exported
  • attributes.codegen.cold.intro
  • attributes.codegen.cold.syntax
  • attributes.codegen.cold.allowed-positions
  • attributes.codegen.cold.duplicates
  • attributes.codegen.cold.trait

Removed rules:

  • attributes.codegen.hint
  • attributes.codegen.hint.cold-inline
  • attributes.codegen.hint.usage --- split into the corresponding attributes

@rustbot rustbot added the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Jun 30, 2025
I didn't feel like this section was pulling its weight. It also wasn't
entirely correct.
This adds some wording that was removed from the "optimization hints"
section.
This rule did not seem to be covered elsewhere. I'm not 100% positive
this is the best way to document this, but I think it is accurate.

This is implemented in
https://github.com/rust-lang/rust/blob/5526a2f47cd676ceeedc08cf71ae75ce2e9284ae/compiler/rustc_passes/src/check_attr.rs#L482-L497
Note in particular that `inline` and similar attributes can be applied
to `async` blocks as well as to closures.  Along with the editorial
revisions, let's say that and also discuss the current limitations
that affect how these can be applied.
On lang, we had earlier made a decision about how `inline` should
apply to `async fn`.  Let's document that here.
@traviscross traviscross added this pull request to the merge queue Sep 3, 2025
Merged via the queue into rust-lang:master with commit b091a8a Sep 3, 2025
5 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Sep 3, 2025
jhpratt added a commit to jhpratt/rust that referenced this pull request Sep 8, 2025
Update books

## rust-lang/nomicon

1 commits in 57ed4473660565d9357fcae176b358d7e8724ebf..f17a018b9989430967d1c58e9a12c51169abc744
2025-09-05 22:46:58 UTC to 2025-09-05 22:46:58 UTC

- Add missing "C" ABI to FFI example code (rust-lang/nomicon#501)

## rust-lang/reference

7 commits in 89f67b3c1b904cbcd9ed55e443d6fc67c8ca2769..b3ce60628c6f55ab8ff3dba9f3d20203df1c0dee
2025-09-05 20:14:36 UTC to 2025-08-26 20:17:24 UTC

- Ensure all lexical elements are SCREAMING_CASE (rust-lang/reference#1990)
- Link out to the notation from grammar summary (rust-lang/reference#1989)
- Or-patterns are extending (rust-lang/reference#1975)
- Specify lifetime extension of `match` arms and `if` consequent/`else` block tail expressions (rust-lang/reference#1981)
- clean up and properly test temporary lifetime extension in doctests (rust-lang/reference#1979)
- Update `cold` and `inline` to use the attribute template (rust-lang/reference#1907)
- Pluralize "syntax diagrams" (rust-lang/reference#1977)

## rust-lang/rust-by-example

1 commits in ad27f82c18464525c761a4a8db2e01785da59e1f..dd26bc8e726dc2e73534c8972d4dccd1bed7495f
2025-09-04 22:33:29 UTC to 2025-09-04 22:33:29 UTC

- Fix drop order explanation in trait > drop (rust-lang/rust-by-example#1953)
Zalathar added a commit to Zalathar/rust that referenced this pull request Sep 9, 2025
Update books

## rust-lang/nomicon

1 commits in 57ed4473660565d9357fcae176b358d7e8724ebf..f17a018b9989430967d1c58e9a12c51169abc744
2025-09-05 22:46:58 UTC to 2025-09-05 22:46:58 UTC

- Add missing "C" ABI to FFI example code (rust-lang/nomicon#501)

## rust-lang/reference

7 commits in 89f67b3c1b904cbcd9ed55e443d6fc67c8ca2769..b3ce60628c6f55ab8ff3dba9f3d20203df1c0dee
2025-09-05 20:14:36 UTC to 2025-08-26 20:17:24 UTC

- Ensure all lexical elements are SCREAMING_CASE (rust-lang/reference#1990)
- Link out to the notation from grammar summary (rust-lang/reference#1989)
- Or-patterns are extending (rust-lang/reference#1975)
- Specify lifetime extension of `match` arms and `if` consequent/`else` block tail expressions (rust-lang/reference#1981)
- clean up and properly test temporary lifetime extension in doctests (rust-lang/reference#1979)
- Update `cold` and `inline` to use the attribute template (rust-lang/reference#1907)
- Pluralize "syntax diagrams" (rust-lang/reference#1977)

## rust-lang/rust-by-example

1 commits in ad27f82c18464525c761a4a8db2e01785da59e1f..dd26bc8e726dc2e73534c8972d4dccd1bed7495f
2025-09-04 22:33:29 UTC to 2025-09-04 22:33:29 UTC

- Fix drop order explanation in trait > drop (rust-lang/rust-by-example#1953)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Sep 9, 2025
Update books

## rust-lang/nomicon

1 commits in 57ed4473660565d9357fcae176b358d7e8724ebf..f17a018b9989430967d1c58e9a12c51169abc744
2025-09-05 22:46:58 UTC to 2025-09-05 22:46:58 UTC

- Add missing "C" ABI to FFI example code (rust-lang/nomicon#501)

## rust-lang/reference

7 commits in 89f67b3c1b904cbcd9ed55e443d6fc67c8ca2769..b3ce60628c6f55ab8ff3dba9f3d20203df1c0dee
2025-09-05 20:14:36 UTC to 2025-08-26 20:17:24 UTC

- Ensure all lexical elements are SCREAMING_CASE (rust-lang/reference#1990)
- Link out to the notation from grammar summary (rust-lang/reference#1989)
- Or-patterns are extending (rust-lang/reference#1975)
- Specify lifetime extension of `match` arms and `if` consequent/`else` block tail expressions (rust-lang/reference#1981)
- clean up and properly test temporary lifetime extension in doctests (rust-lang/reference#1979)
- Update `cold` and `inline` to use the attribute template (rust-lang/reference#1907)
- Pluralize "syntax diagrams" (rust-lang/reference#1977)

## rust-lang/rust-by-example

1 commits in ad27f82c18464525c761a4a8db2e01785da59e1f..dd26bc8e726dc2e73534c8972d4dccd1bed7495f
2025-09-04 22:33:29 UTC to 2025-09-04 22:33:29 UTC

- Fix drop order explanation in trait > drop (rust-lang/rust-by-example#1953)
rust-timer added a commit to rust-lang/rust that referenced this pull request Sep 9, 2025
Rollup merge of #146339 - rustbot:docs-update, r=ehuss

Update books

## rust-lang/nomicon

1 commits in 57ed4473660565d9357fcae176b358d7e8724ebf..f17a018b9989430967d1c58e9a12c51169abc744
2025-09-05 22:46:58 UTC to 2025-09-05 22:46:58 UTC

- Add missing "C" ABI to FFI example code (rust-lang/nomicon#501)

## rust-lang/reference

7 commits in 89f67b3c1b904cbcd9ed55e443d6fc67c8ca2769..b3ce60628c6f55ab8ff3dba9f3d20203df1c0dee
2025-09-05 20:14:36 UTC to 2025-08-26 20:17:24 UTC

- Ensure all lexical elements are SCREAMING_CASE (rust-lang/reference#1990)
- Link out to the notation from grammar summary (rust-lang/reference#1989)
- Or-patterns are extending (rust-lang/reference#1975)
- Specify lifetime extension of `match` arms and `if` consequent/`else` block tail expressions (rust-lang/reference#1981)
- clean up and properly test temporary lifetime extension in doctests (rust-lang/reference#1979)
- Update `cold` and `inline` to use the attribute template (rust-lang/reference#1907)
- Pluralize "syntax diagrams" (rust-lang/reference#1977)

## rust-lang/rust-by-example

1 commits in ad27f82c18464525c761a4a8db2e01785da59e1f..dd26bc8e726dc2e73534c8972d4dccd1bed7495f
2025-09-04 22:33:29 UTC to 2025-09-04 22:33:29 UTC

- Fix drop order explanation in trait > drop (rust-lang/rust-by-example#1953)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants