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

Remove reference to #[cold] in section on match expressions #1213

Closed
junbl opened this issue May 9, 2022 · 2 comments
Closed

Remove reference to #[cold] in section on match expressions #1213

junbl opened this issue May 9, 2022 · 2 comments
Labels
A-attributes Area: Attributes Easy We believe this would not be difficult to actually fix

Comments

@junbl
Copy link

junbl commented May 9, 2022

The section Attributes on match arms lists #[cold] as one of the macros that can be applied to match guards:

The only attributes that have meaning on match arms are cfg, cold, and the lint check attributes.

However, attempting to do so generates this warning:

     |
1272 |                 #[cold]
     |                 ^^^^^^^
     |
     = note: `#[warn(unused_attributes)]` on by default
     = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
     = note: see issue #80564 <https://github.com/rust-lang/rust/issues/80564> for more information

Therefore, it seems like the reference to cold should be removed here.

@ehuss ehuss added Easy We believe this would not be difficult to actually fix A-attributes Area: Attributes labels May 9, 2022
@ehuss
Copy link
Contributor

ehuss commented May 9, 2022

Yea, I believe cold only applies to functions.

@ehuss
Copy link
Contributor

ehuss commented May 13, 2022

Closed by #1216

@ehuss ehuss closed this as completed May 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes Easy We believe this would not be difficult to actually fix
Projects
None yet
Development

No branches or pull requests

2 participants