Skip to content

Commit 89c28cd

Browse files
committed
Fully quote the comment
1 parent 3e2f4dc commit 89c28cd

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

tests/ui/attributes/positions/README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,16 @@ or:
1313
// FIXME: This can be used on stable but shouldn't.
1414
```
1515

16-
Or perhaps you've seen discussions getting derailed by comments like:
17-
18-
```text
19-
I discovered today that the following code already compiles on stable since at least Rust 1.31
20-
...
21-
```
16+
Or perhaps you've seen a discussion get derailed by a [comment](https://github.com/rust-lang/rust/issues/127436#issuecomment-2576134477) like:
17+
18+
> Amanieu and I discovered today that the following code already compiles on stable since at least Rust 1.31. I suspect that the `#[cold]` attribute is getting picked up as an argument-level attribute (similar to `#[cfg(…)]` being supported on arguments) and not as an expression attribute on the closure expression, and consequently being ignored as opposed to actually making the closure cold. If that's indeed what is happening, consider whether this case needs to be fixed before stabilizing attribute syntax on closures.
19+
> ```rust
20+
> fn main() {
21+
> f(#[cold] || {});
22+
> }
23+
>
24+
> fn f(_: impl Fn()) {}
25+
> ```
2226
2327
This is largely because our coverage of attributes and where they're allowed is very poor.
2428
This test suite attempts to consistently and exhaustively check attributes in various positions.

0 commit comments

Comments
 (0)