Skip to content

Commit a2624fc

Browse files
author
Jakub Bukaj
committed
Use the _ representation for integral variables as well
1 parent cac9954 commit a2624fc

File tree

6 files changed

+7
-8
lines changed

6 files changed

+7
-8
lines changed

src/librustc/util/ppaux.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -376,9 +376,8 @@ pub fn ty_to_string(cx: &ctxt, typ: t) -> String {
376376
format!("_#{}i", vid),
377377
ty::FloatVar(ty::FloatVid { index: vid }) if print_var_ids =>
378378
format!("_#{}f", vid),
379-
ty::TyVar(_) => "_".to_string(),
380-
ty::IntVar(_) => "_#i".to_string(),
381-
ty::FloatVar(_) => "_#f".to_string(),
379+
ty::TyVar(_) | ty::IntVar(_) | ty::FloatVar(_) =>
380+
"_".to_string(),
382381
ty::SkolemizedTy(v) => format!("SkolemizedTy({})", v),
383382
ty::SkolemizedIntTy(v) => format!("SkolemizedIntTy({})", v)
384383
}

src/test/compile-fail/issue-13482.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fn main() {
1212
let x = [1,2];
1313
let y = match x {
1414
[] => None,
15-
//~^ ERROR types: expected `[_#i, ..2]`, found `[_, ..0]`
15+
//~^ ERROR types: expected `[_, ..2]`, found `[_, ..0]`
1616
// (expected array of 2 elements, found array of 0 elements)
1717
[a,_] => Some(a)
1818
};

src/test/compile-fail/issue-4201.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fn main() {
1212
let a = if true {
1313
0
1414
} else if false {
15-
//~^ ERROR if may be missing an else clause: expected `()`, found `_#i`
15+
//~^ ERROR if may be missing an else clause: expected `()`, found `_`
1616
1
1717
};
1818
}

src/test/compile-fail/issue-4968.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
const A: (int,int) = (4,2);
1414
fn main() {
1515
match 42 { A => () }
16-
//~^ ERROR mismatched types: expected `_#i`, found `(int, int)`
16+
//~^ ERROR mismatched types: expected `_`, found `(int, int)`
1717
// (expected integral variable, found tuple)
1818
}

src/test/compile-fail/repeat_count.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ fn main() {
1818
let c = [0, ..true]; //~ ERROR expected positive integer for repeat count, found boolean
1919
//~^ ERROR: expected `uint`, found `bool`
2020
let d = [0, ..0.5]; //~ ERROR expected positive integer for repeat count, found float
21-
//~^ ERROR: expected `uint`, found `_#f`
21+
//~^ ERROR: expected `uint`, found `_`
2222
let e = [0, .."foo"]; //~ ERROR expected positive integer for repeat count, found string
2323
//~^ ERROR: expected `uint`, found `&'static str`
2424
let f = [0, ..-4];

src/test/compile-fail/slightly-nice-generic-literal-messages.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ struct Foo<T,U>(T);
1313
fn main() {
1414
match Foo(1.1) {
1515
1 => {}
16-
//~^ ERROR expected `Foo<_#f, _>`, found `_#i`
16+
//~^ ERROR expected `Foo<_, _>`, found `_`
1717
}
1818

1919
}

0 commit comments

Comments
 (0)