Always drop var IDs from type variables modulo -Z verbose, per PR discussion
This commit is contained in:
parent
1b79303f49
commit
3db13f4892
11 changed files with 71 additions and 101 deletions
21
src/test/compile-fail/issue-13482-2.rs
Normal file
21
src/test/compile-fail/issue-13482-2.rs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags:-Z verbose
|
||||
|
||||
fn main() {
|
||||
let x = [1,2];
|
||||
let y = match x {
|
||||
[] => None,
|
||||
//~^ ERROR types: expected `[_#0i, ..2]`, found `[_#7, ..0]`
|
||||
// (expected array of 2 elements, found array of 0 elements)
|
||||
[a,_] => Some(a)
|
||||
};
|
||||
}
|
||||
|
|
@ -12,7 +12,7 @@ fn main() {
|
|||
let x = [1,2];
|
||||
let y = match x {
|
||||
[] => None,
|
||||
//~^ ERROR types: expected `[_#0i, ..2]`, found `[_#7, ..0]`
|
||||
//~^ ERROR types: expected `[_#i, ..2]`, found `[_, ..0]`
|
||||
// (expected array of 2 elements, found array of 0 elements)
|
||||
[a,_] => Some(a)
|
||||
};
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
fn main() {
|
||||
match None {
|
||||
Err(_) => ()
|
||||
//~^ ERROR mismatched types: expected `core::option::Option<_#1>`
|
||||
// , found `core::result::Result<_#2, _#3>`
|
||||
//~^ ERROR mismatched types: expected `core::option::Option<_>`
|
||||
// , found `core::result::Result<_, _>`
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ fn main() {
|
|||
let a = if true {
|
||||
0
|
||||
} else if false {
|
||||
//~^ ERROR if may be missing an else clause: expected `()`, found `_#1i`
|
||||
//~^ ERROR if may be missing an else clause: expected `()`, found `_#i`
|
||||
1
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,6 @@
|
|||
const A: (int,int) = (4,2);
|
||||
fn main() {
|
||||
match 42 { A => () }
|
||||
//~^ ERROR mismatched types: expected `_#0i`, found `(int, int)`
|
||||
//~^ ERROR mismatched types: expected `_#i`, found `(int, int)`
|
||||
// (expected integral variable, found tuple)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ fn main() {
|
|||
|
||||
match (true, false) {
|
||||
(true, false, false) => ()
|
||||
//~^ ERROR mismatched types: expected `(bool, bool)`, found `(_#9, _#10, _#11)`
|
||||
//~^ ERROR mismatched types: expected `(bool, bool)`, found `(_, _, _)`
|
||||
}
|
||||
|
||||
match (true, false) {
|
||||
|
|
|
|||
|
|
@ -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 `_#0f`
|
||||
//~^ ERROR: expected `uint`, found `_#f`
|
||||
let e = [0, .."foo"]; //~ ERROR expected positive integer for repeat count, found string
|
||||
//~^ ERROR: expected `uint`, found `&'static str`
|
||||
let f = [0, ..-4];
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ struct Foo<T,U>(T);
|
|||
fn main() {
|
||||
match Foo(1.1) {
|
||||
1 => {}
|
||||
//~^ ERROR expected `Foo<_#0f, _#2>`, found `_#0i`
|
||||
//~^ ERROR expected `Foo<_#f, _>`, found `_#i`
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,6 @@
|
|||
|
||||
fn main() {
|
||||
let (x, y) = ();
|
||||
//~^ ERROR expected `()`, found `(_#3, _#4)` (expected (), found tuple)
|
||||
//~^ ERROR expected `()`, found `(_, _)` (expected (), found tuple)
|
||||
return x;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue