Skip to content

Commit c3f1547

Browse files
steveklabnikXMPPwocky
authored andcommitted
fix example for E0018
Fixes rust-lang#25326
1 parent ae31b5e commit c3f1547

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/librustc/diagnostics.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,9 @@ Therefore, casting one of these non-constant pointers to an integer results
218218
in a non-constant integer which lead to this error. Example:
219219
220220
```
221-
const X: u32 = 50;
222-
const Y: *const u32 = &X;
223-
println!("{:?}", Y);
221+
const X: u32 = 1;
222+
const Y: usize = &X as *const u32 as usize;
223+
println!("{}", Y);
224224
```
225225
"##,
226226

0 commit comments

Comments
 (0)