From 62e5dee1c5743bb01b32a8b7eec691c02d528bf3 Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Wed, 27 May 2015 14:51:58 -0400 Subject: [PATCH] fix example for E0018 Fixes #25326 --- src/librustc/diagnostics.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/librustc/diagnostics.rs b/src/librustc/diagnostics.rs index 9d459027bf5cd..9f576d0dae0e4 100644 --- a/src/librustc/diagnostics.rs +++ b/src/librustc/diagnostics.rs @@ -218,9 +218,9 @@ Therefore, casting one of these non-constant pointers to an integer results in a non-constant integer which lead to this error. Example: ``` -const X: u32 = 50; -const Y: *const u32 = &X; -println!("{:?}", Y); +const X: u32 = 1; +const Y: usize = &X as *const u32 as usize; +println!("{}", Y); ``` "##,