Skip to content

Commit

Permalink
Use the _ representation for integral variables as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Bukaj committed Oct 30, 2014
1 parent cac9954 commit a2624fc
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
5 changes: 2 additions & 3 deletions src/librustc/util/ppaux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/issue-13482.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
};
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/issue-4201.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
}
2 changes: 1 addition & 1 deletion src/test/compile-fail/issue-4968.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
2 changes: 1 addition & 1 deletion src/test/compile-fail/repeat_count.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct Foo<T,U>(T);
fn main() {
match Foo(1.1) {
1 => {}
//~^ ERROR expected `Foo<_#f, _>`, found `_#i`
//~^ ERROR expected `Foo<_, _>`, found `_`
}

}

5 comments on commit a2624fc

@bors
Copy link
Contributor

@bors bors commented on a2624fc Oct 31, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on a2624fc Oct 31, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging jakub-/rust/var-ids-in-error-messages = a2624fc into auto

@bors
Copy link
Contributor

@bors bors commented on a2624fc Oct 31, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jakub-/rust/var-ids-in-error-messages = a2624fc merged ok, testing candidate = 82045ca

@bors
Copy link
Contributor

@bors bors commented on a2624fc Oct 31, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on a2624fc Oct 31, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 82045ca

Please sign in to comment.