From a2624fc90891b8265550229e38bc255e61a9d335 Mon Sep 17 00:00:00 2001 From: Jakub Bukaj Date: Thu, 30 Oct 2014 21:17:06 +0100 Subject: [PATCH] Use the `_` representation for integral variables as well --- src/librustc/util/ppaux.rs | 5 ++--- src/test/compile-fail/issue-13482.rs | 2 +- src/test/compile-fail/issue-4201.rs | 2 +- src/test/compile-fail/issue-4968.rs | 2 +- src/test/compile-fail/repeat_count.rs | 2 +- .../compile-fail/slightly-nice-generic-literal-messages.rs | 2 +- 6 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/librustc/util/ppaux.rs b/src/librustc/util/ppaux.rs index 633a350ddb2a4..8befba00fd2fe 100644 --- a/src/librustc/util/ppaux.rs +++ b/src/librustc/util/ppaux.rs @@ -376,9 +376,8 @@ pub fn ty_to_string(cx: &ctxt, typ: t) -> String { format!("_#{}i", vid), ty::FloatVar(ty::FloatVid { index: vid }) if print_var_ids => format!("_#{}f", vid), - ty::TyVar(_) => "_".to_string(), - ty::IntVar(_) => "_#i".to_string(), - ty::FloatVar(_) => "_#f".to_string(), + ty::TyVar(_) | ty::IntVar(_) | ty::FloatVar(_) => + "_".to_string(), ty::SkolemizedTy(v) => format!("SkolemizedTy({})", v), ty::SkolemizedIntTy(v) => format!("SkolemizedIntTy({})", v) } diff --git a/src/test/compile-fail/issue-13482.rs b/src/test/compile-fail/issue-13482.rs index e0b1f8845e236..18070ed53b04a 100644 --- a/src/test/compile-fail/issue-13482.rs +++ b/src/test/compile-fail/issue-13482.rs @@ -12,7 +12,7 @@ fn main() { let x = [1,2]; let y = match x { [] => None, -//~^ ERROR types: expected `[_#i, ..2]`, found `[_, ..0]` +//~^ ERROR types: expected `[_, ..2]`, found `[_, ..0]` // (expected array of 2 elements, found array of 0 elements) [a,_] => Some(a) }; diff --git a/src/test/compile-fail/issue-4201.rs b/src/test/compile-fail/issue-4201.rs index 5899fa43a4821..0391c73d90a6c 100644 --- a/src/test/compile-fail/issue-4201.rs +++ b/src/test/compile-fail/issue-4201.rs @@ -12,7 +12,7 @@ fn main() { let a = if true { 0 } else if false { -//~^ ERROR if may be missing an else clause: expected `()`, found `_#i` +//~^ ERROR if may be missing an else clause: expected `()`, found `_` 1 }; } diff --git a/src/test/compile-fail/issue-4968.rs b/src/test/compile-fail/issue-4968.rs index 54fd9d492bfcb..cf1f1f5908954 100644 --- a/src/test/compile-fail/issue-4968.rs +++ b/src/test/compile-fail/issue-4968.rs @@ -13,6 +13,6 @@ const A: (int,int) = (4,2); fn main() { match 42 { A => () } - //~^ ERROR mismatched types: expected `_#i`, found `(int, int)` + //~^ ERROR mismatched types: expected `_`, found `(int, int)` // (expected integral variable, found tuple) } diff --git a/src/test/compile-fail/repeat_count.rs b/src/test/compile-fail/repeat_count.rs index 0d4dab9916dcf..be79a7a915b88 100644 --- a/src/test/compile-fail/repeat_count.rs +++ b/src/test/compile-fail/repeat_count.rs @@ -18,7 +18,7 @@ fn main() { let c = [0, ..true]; //~ ERROR expected positive integer for repeat count, found boolean //~^ ERROR: expected `uint`, found `bool` let d = [0, ..0.5]; //~ ERROR expected positive integer for repeat count, found float - //~^ ERROR: expected `uint`, found `_#f` + //~^ ERROR: expected `uint`, found `_` let e = [0, .."foo"]; //~ ERROR expected positive integer for repeat count, found string //~^ ERROR: expected `uint`, found `&'static str` let f = [0, ..-4]; diff --git a/src/test/compile-fail/slightly-nice-generic-literal-messages.rs b/src/test/compile-fail/slightly-nice-generic-literal-messages.rs index 3ac3988bad2bd..a655a17c037d2 100644 --- a/src/test/compile-fail/slightly-nice-generic-literal-messages.rs +++ b/src/test/compile-fail/slightly-nice-generic-literal-messages.rs @@ -13,7 +13,7 @@ struct Foo(T); fn main() { match Foo(1.1) { 1 => {} - //~^ ERROR expected `Foo<_#f, _>`, found `_#i` + //~^ ERROR expected `Foo<_, _>`, found `_` } }