Don't print leading zeros on hex dumps constants

This commit is contained in:
Oliver Scherer 2020-02-05 12:17:41 +01:00
parent 4ddb4bdaad
commit e22ddfd80d
5 changed files with 17 additions and 21 deletions

View file

@ -1,12 +1,9 @@
// normalize-stderr-64bit "0x00000000" -> "0x[PREFIX]"
// normalize-stderr-32bit "0x" -> "0x[PREFIX]"
#![feature(const_generics, const_compare_raw_pointers)]
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
struct Const<const P: *const u32>;
fn main() {
let _: Const<{15 as *const _}> = Const::<{10 as *const _}>; //~ mismatched types
let _: Const<{10 as *const _}> = Const::<{10 as *const _}>;
let _: Const<{ 15 as *const _ }> = Const::<{ 10 as *const _ }>; //~ mismatched types
let _: Const<{ 10 as *const _ }> = Const::<{ 10 as *const _ }>;
}

View file

@ -1,5 +1,5 @@
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
--> $DIR/raw-ptr-const-param.rs:4:12
--> $DIR/raw-ptr-const-param.rs:1:12
|
LL | #![feature(const_generics, const_compare_raw_pointers)]
| ^^^^^^^^^^^^^^
@ -7,15 +7,15 @@ LL | #![feature(const_generics, const_compare_raw_pointers)]
= note: `#[warn(incomplete_features)]` on by default
error[E0308]: mismatched types
--> $DIR/raw-ptr-const-param.rs:10:38
--> $DIR/raw-ptr-const-param.rs:7:40
|
LL | let _: Const<{15 as *const _}> = Const::<{10 as *const _}>;
| ----------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `0x[PREFIX]0000000f`, found `0x[PREFIX]0000000a`
LL | let _: Const<{ 15 as *const _ }> = Const::<{ 10 as *const _ }>;
| ------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `0xf`, found `0xa`
| |
| expected due to this
|
= note: expected struct `Const<0x[PREFIX]0000000f>`
found struct `Const<0x[PREFIX]0000000a>`
= note: expected struct `Const<0xf>`
found struct `Const<0xa>`
error: aborting due to previous error