about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authoroli <github35764891676564198441@oli-obk.de>2021-01-16 17:31:22 +0000
committeroli <github35764891676564198441@oli-obk.de>2021-01-23 11:33:45 +0000
commit3cd0b46baca1848b577f2172935a139663697643 (patch)
tree3369b40c5885e7f71a432df7b50062c52bf0ff6f /src
parentb217fab9608f97fc99c77f4cac5909df0e59db0c (diff)
downloadrust-3cd0b46baca1848b577f2172935a139663697643.tar.gz
rust-3cd0b46baca1848b577f2172935a139663697643.zip
Fix a comment that only made sense in the context of a dataflow based mutability check
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/consts/const-mut-refs/mut_ref_in_final.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/test/ui/consts/const-mut-refs/mut_ref_in_final.rs b/src/test/ui/consts/const-mut-refs/mut_ref_in_final.rs
index c85acd3b849..98960ec6c6e 100644
--- a/src/test/ui/consts/const-mut-refs/mut_ref_in_final.rs
+++ b/src/test/ui/consts/const-mut-refs/mut_ref_in_final.rs
@@ -9,9 +9,8 @@ const A: *const i32 = &4;
 // as that would be an enormous footgun in oli-obk's opinion.
 const B: *mut i32 = &mut 4; //~ ERROR mutable references are not allowed
 
-// Could be ok, but the same analysis that prevents the mutable one above will also bail out here
-// Using a block with some complex content, because just `&45` would get promoted,
-// which is not what we want to test here.
+// Ok, because no references to mutable data exist here, since the `{}` moves
+// its value and then takes a reference to that.
 const C: *const i32 = &{
     let mut x = 42;
     x += 3;