Skip to content

Commit 3cd0b46

Browse files
committed
Fix a comment that only made sense in the context of a dataflow based mutability check
1 parent b217fab commit 3cd0b46

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/test/ui/consts/const-mut-refs/mut_ref_in_final.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ const A: *const i32 = &4;
99
// as that would be an enormous footgun in oli-obk's opinion.
1010
const B: *mut i32 = &mut 4; //~ ERROR mutable references are not allowed
1111

12-
// Could be ok, but the same analysis that prevents the mutable one above will also bail out here
13-
// Using a block with some complex content, because just `&45` would get promoted,
14-
// which is not what we want to test here.
12+
// Ok, because no references to mutable data exist here, since the `{}` moves
13+
// its value and then takes a reference to that.
1514
const C: *const i32 = &{
1615
let mut x = 42;
1716
x += 3;

0 commit comments

Comments
 (0)