Skip to content

Commit d1265b7

Browse files
committed
Update attr name for #[unroll] in Unstable Book
1 parent 945d2f3 commit d1265b7

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

src/doc/unstable-book/src/language-features/loop-hints.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,22 @@ The tracking issue for this feature is: [#156874]
66

77
------
88

9+
<!--
10+
FIXME(#159429): temporarily renamed `#[unroll]` to mitigate a nameres ambiguity
11+
-->
12+
913
Loop unrolling can be a powerful optimization but like inlining, it is sometimes useful to
1014
manually provide hints to optimizations.
1115

12-
`#[unroll]` will encourage unrolling of a loop.
16+
`#[rustc_unroll]` will encourage unrolling of a loop.
1317

14-
`#[unroll(full)]` is a stronger hint and can cause optimizations to completely ignore the code
18+
`#[rustc_unroll(full)]` is a stronger hint and can cause optimizations to completely ignore the code
1519
side growth from repeating a loop body.
1620

17-
`#[unroll(never)]` is a strong hint to not unroll the loop at all. Note that other loop
21+
`#[rustc_unroll(never)]` is a strong hint to not unroll the loop at all. Note that other loop
1822
optimizations may still be applied.
1923

20-
`#[unroll(N)]` is a hint to unroll `N` iterations of the loop.
24+
`#[rustc_unroll(N)]` is a hint to unroll `N` iterations of the loop.
2125

2226
In all cases these are just hints and may be ignored. But unlike function inlining hints,
2327
loops tend to be heavily modified during compilation, which can make obeying hints challenging.

0 commit comments

Comments
 (0)