]> git.lizzy.rs Git - rust.git/commitdiff
Rename _ to {numerics} for unknown numeric types
authorJonathan Turner <jturner@mozilla.com>
Wed, 27 Jul 2016 23:59:33 +0000 (16:59 -0700)
committerJonathan Turner <jturner@mozilla.com>
Thu, 28 Jul 2016 15:58:25 +0000 (08:58 -0700)
35 files changed:
src/librustc/util/ppaux.rs
src/test/compile-fail/array-not-vector.rs
src/test/compile-fail/bad-const-type.rs
src/test/compile-fail/coerce-mut.rs
src/test/compile-fail/coercion-slice.rs
src/test/compile-fail/fully-qualified-type-name1.rs
src/test/compile-fail/if-let-arm-types.rs
src/test/compile-fail/indexing-requires-a-uint.rs
src/test/compile-fail/integral-variable-unification-error.rs
src/test/compile-fail/issue-13466.rs
src/test/compile-fail/issue-17651.rs
src/test/compile-fail/issue-19991.rs
src/test/compile-fail/issue-26237.rs
src/test/compile-fail/issue-4201.rs
src/test/compile-fail/issue-4968.rs
src/test/compile-fail/issue-7867.rs
src/test/compile-fail/kindck-impl-type-params-2.rs
src/test/compile-fail/match-range-fail.rs
src/test/compile-fail/match-vec-mismatch.rs
src/test/compile-fail/method-self-arg-1.rs
src/test/compile-fail/mut-pattern-mismatched.rs
src/test/compile-fail/no_send-rc.rs
src/test/compile-fail/range-1.rs
src/test/compile-fail/repeat_count.rs
src/test/compile-fail/slightly-nice-generic-literal-messages.rs
src/test/compile-fail/str-idx.rs
src/test/compile-fail/struct-base-wrong-type-2.rs
src/test/compile-fail/struct-base-wrong-type.rs
src/test/compile-fail/traits-inductive-overflow-simultaneous.rs
src/test/compile-fail/tuple-arity-mismatch.rs
src/test/compile-fail/tuple-index-out-of-bounds.rs
src/test/compile-fail/type-mismatch-multiple.rs
src/test/compile-fail/typeck-unsafe-always-share.rs
src/test/compile-fail/vtable-res-trait-param.rs
src/test/ui/mismatched_types/issue-26480.stderr

index 0bfb7c1ed55321da22e6c9fe412b2dedcbc04686..a33d914e7cf7a19ef0687661beaccc29d18b57dd 100644 (file)
@@ -974,7 +974,8 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
             ty::TyVar(ref vid) if print_var_ids => write!(f, "{:?}", vid),
             ty::IntVar(ref vid) if print_var_ids => write!(f, "{:?}", vid),
             ty::FloatVar(ref vid) if print_var_ids => write!(f, "{:?}", vid),
-            ty::TyVar(_) | ty::IntVar(_) | ty::FloatVar(_) => write!(f, "_"),
+            ty::TyVar(_) => write!(f, "_"),
+            ty::IntVar(_) | ty::FloatVar(_) => write!(f, "{}", "{numeric}"),
             ty::FreshTy(v) => write!(f, "FreshTy({})", v),
             ty::FreshIntTy(v) => write!(f, "FreshIntTy({})", v),
             ty::FreshFloatTy(v) => write!(f, "FreshFloatTy({})", v)
index 1bbccae53a44d6f755804790fe9d8b787025028f..b8883e4661eaa0b0578139a2df327580c86a82e5 100644 (file)
@@ -12,7 +12,7 @@ fn main() {
     let _x: i32 = [1, 2, 3];
     //~^ ERROR mismatched types
     //~| expected type `i32`
-    //~| found type `[_; 3]`
+    //~| found type `[{numeric}; 3]`
     //~| expected i32, found array of 3 elements
 
     let x: &[i32] = &[1, 2, 3];
index ee6ac33072792a722202d7a1b82f7bbbcad19f6b..3b6221f0df5b8fed24af3913e373299cd5779520 100644 (file)
@@ -11,6 +11,6 @@
 static i: String = 10;
 //~^ ERROR mismatched types
 //~| expected type `std::string::String`
-//~| found type `_`
+//~| found type `{numeric}`
 //~| expected struct `std::string::String`, found integral variable
 fn main() { println!("{}", i); }
index 634d12441a12077c73bf3c5b62f63ff126d4d21b..91222e58b78cc1608fc5980c4d0110e46a46aa53 100644 (file)
@@ -15,6 +15,6 @@ fn main() {
     f(&x);
     //~^ ERROR mismatched types
     //~| expected type `&mut i32`
-    //~| found type `&_`
+    //~| found type `&{numeric}`
     //~| values differ in mutability
 }
index bd7e6c2a2131d36d0eb104be0864caabe72b9c40..bfec84993961e4dd323007e6b2cab652fb0510d4 100644 (file)
@@ -14,6 +14,6 @@ fn main() {
     let _: &[i32] = [0];
     //~^ ERROR mismatched types
     //~| expected type `&[i32]`
-    //~| found type `[_; 1]`
+    //~| found type `[{numeric}; 1]`
     //~| expected &-ptr, found array of 1 elements
 }
index 5ea8ce226443836889e06866c287577af8a95f3a..3ae95a72abdd9d36f7ed0c83469a2bba8bf02468 100644 (file)
@@ -15,6 +15,6 @@ fn main() {
     x = 5;
     //~^ ERROR mismatched types
     //~| expected type `std::option::Option<usize>`
-    //~| found type `_`
+    //~| found type `{numeric}`
     //~| expected enum `std::option::Option`, found integral variable
 }
index c7b1e1a62c2097c4e87fdcbdec210f5aa8b7f9a3..394a6fb30d7e98b6ba3fac2163b7e8a280725734 100644 (file)
@@ -12,7 +12,7 @@ fn main() {
     if let Some(b) = None { //~ ERROR: `if let` arms have incompatible types
         //~^ expected (), found integral variable
         //~| expected type `()`
-        //~| found type `_`
+        //~| found type `{numeric}`
         ()
     } else {                //~ NOTE: `if let` arm with an incompatible type
         1
index 354d7b936485bd0505c02eb71758860d5400d5a4..fe29a840f28c7706e76ad994d3d41073a8b2a94b 100644 (file)
@@ -13,7 +13,7 @@
 
 fn main() {
     fn bar<T>(_: T) {}
-    [0][0u8]; //~ ERROR: `[_]: std::ops::Index<u8>` is not satisfied
+    [0][0u8]; //~ ERROR: `[{numeric}]: std::ops::Index<u8>` is not satisfied
 
     [0][0]; // should infer to be a usize
 
index 99f2d25166891b1a785f03c1e8098edf9c113d63..9dd3772c10cd904c224664d5a7912113e788e79b 100644 (file)
@@ -12,7 +12,7 @@ fn main() {
     let mut x = 2;
     x = 5.0;
     //~^ ERROR mismatched types
-    //~| expected type `_`
-    //~| found type `_`
+    //~| expected type `{numeric}`
+    //~| found type `{numeric}`
     //~| expected integral variable, found floating-point variable
 }
index 17b96411603ef3e3ce6ffd4981728f34fd98e686..b1a5adb313face7f9ea68fee9e83553142c05f0b 100644 (file)
@@ -17,13 +17,13 @@ pub fn main() {
     let _x: usize = match Some(1) {
         Ok(u) => u,
         //~^ ERROR mismatched types
-        //~| expected type `std::option::Option<_>`
+        //~| expected type `std::option::Option<{numeric}>`
         //~| found type `std::result::Result<_, _>`
         //~| expected enum `std::option::Option`, found enum `std::result::Result`
 
         Err(e) => panic!(e)
         //~^ ERROR mismatched types
-        //~| expected type `std::option::Option<_>`
+        //~| expected type `std::option::Option<{numeric}>`
         //~| found type `std::result::Result<_, _>`
         //~| expected enum `std::option::Option`, found enum `std::result::Result`
     };
index 0fe01ece558ee0d9a4b8f3fbdcc431252dc932d2..2438c86a57c7f713e2a4695f40042cc65e6bb578 100644 (file)
@@ -14,5 +14,5 @@
 fn main() {
     // FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
     (|| Box::new(*(&[0][..])))();
-    //~^ ERROR `[_]: std::marker::Sized` is not satisfied
+    //~^ ERROR `[{numeric}]: std::marker::Sized` is not satisfied
 }
index b368daaaf587c15cf874979d1a2ce9ec93c5d161..77a83a608213d1a27673320f1867e80b7a68f2fc 100644 (file)
@@ -14,7 +14,7 @@
 fn main() {
     if let Some(homura) = Some("madoka") { //~  ERROR missing an else clause
                                            //~| expected type `()`
-                                           //~| found type `_`
+                                           //~| found type `{numeric}`
                                            //~| expected (), found integral variable
         765
     };
index 11e236d22126b3638504f4bb00019c4529d220bf..f2d24f3998cc22505dde6313c321a03656d64585 100644 (file)
@@ -11,7 +11,7 @@
 macro_rules! macro_panic {
     ($not_a_function:expr, $some_argument:ident) => {
         $not_a_function($some_argument)
-        //~^ ERROR expected function, found `_`
+        //~^ ERROR expected function, found `{numeric}`
     }
 }
 
index 58423341cc6f0e88e283a338f69e8e8d367e1905..65bfeed20eaa04c81654316afc8c9a9b408103cf 100644 (file)
@@ -14,7 +14,7 @@ fn main() {
     } else if false {
 //~^ ERROR if may be missing an else clause
 //~| expected type `()`
-//~| found type `_`
+//~| found type `{numeric}`
 //~| expected (), found integral variable
         1
     };
index 7c0905873df8900f961438f2cc49cb9a841a77e3..e929f0cb3113d2e090513871feef615f41812e69 100644 (file)
@@ -14,7 +14,7 @@
 fn main() {
     match 42 { A => () }
     //~^ ERROR mismatched types
-    //~| expected type `_`
+    //~| expected type `{numeric}`
     //~| found type `(isize, isize)`
     //~| expected integral variable, found tuple
 }
index e0de860b0eac30ef260b9bf75f1d3c678e27c813..95ba2308bfb90667ee77d3978e8315206792ebf5 100644 (file)
@@ -25,12 +25,12 @@ fn main() {
     match &Some(42) {
         Some(x) => (),
         //~^ ERROR mismatched types
-        //~| expected type `&std::option::Option<_>`
+        //~| expected type `&std::option::Option<{numeric}>`
         //~| found type `std::option::Option<_>`
         //~| expected &-ptr, found enum `std::option::Option`
         None => ()
         //~^ ERROR mismatched types
-        //~| expected type `&std::option::Option<_>`
+        //~| expected type `&std::option::Option<{numeric}>`
         //~| found type `std::option::Option<_>`
         //~| expected &-ptr, found enum `std::option::Option`
     }
index 1cf970e150d7033da338ec5b79e80ec5a6056c8a..93723ae9f237cc67820fa28fd1c4c447c9ea997e 100644 (file)
@@ -21,5 +21,5 @@ fn take_param<T:Foo>(foo: &T) { }
 fn main() {
     let x: Box<_> = box 3;
     take_param(&x);
-    //~^ ERROR `Box<_>: std::marker::Copy` is not satisfied
+    //~^ ERROR `Box<{numeric}>: std::marker::Copy` is not satisfied
 }
index 2c4c2563021867ddbd6c305f1500b60c6971a5e4..30386a589837abe6b7aee754e58dff23172ce616 100644 (file)
@@ -20,7 +20,7 @@ fn main() {
         10 ... "what" => ()
     };
     //~^^ ERROR only char and numeric types are allowed in range
-    //~| start type: _
+    //~| start type: {numeric}
     //~| end type: &'static str
 
     match 5 {
index 3ac4958e7db0f6425b5a5d170574d967e1849bdf..94ac49e8f60d3f1c6628512f76f107462272559b 100644 (file)
@@ -18,7 +18,7 @@ fn main() {
     };
 
     match &[0, 1, 2] {
-        [..] => {} //~ ERROR expected an array or slice, found `&[_; 3]`
+        [..] => {} //~ ERROR expected an array or slice, found `&[{numeric}; 3]`
     };
 
     match &[0, 1, 2] {
index ffa5287d4b2c34d5ae5a770642ed2650ece23a4a..5596fb7c807997e6a51aaeac191adac9edd49c25 100644 (file)
@@ -24,6 +24,6 @@ fn main() {
                  //~| expected &-ptr, found struct `Foo`
     Foo::bar(&42); //~  ERROR mismatched types
                       //~| expected type `&Foo`
-                      //~| found type `&_`
+                      //~| found type `&{numeric}`
                       //~| expected struct `Foo`, found integral variable
 }
index 63e7dbd30def2fcf96fe647e0f55dc314646b4e7..d1fd0057d294795361ecebf18d5fd174fdd60060 100644 (file)
@@ -14,7 +14,7 @@ fn main() {
     // (separate lines to ensure the spans are accurate)
 
      let &_ //~  ERROR mismatched types
-            //~| expected type `&mut _`
+            //~| expected type `&mut {numeric}`
             //~| found type `&_`
             //~| values differ in mutability
         = foo;
@@ -23,7 +23,7 @@ fn main() {
     let bar = &1;
     let &_ = bar;
     let &mut _ //~  ERROR mismatched types
-               //~| expected type `&_`
+               //~| expected type `&{numeric}`
                //~| found type `&mut _`
                //~| values differ in mutability
          = bar;
index 69f6fcdc4afa6577b8a0cbeb232f7ea4b758ec7a..7c364e8d6fb561e5d0668452eb9fac79b9472c27 100644 (file)
@@ -15,5 +15,5 @@ fn bar<T: Send>(_: T) {}
 fn main() {
     let x = Rc::new(5);
     bar(x);
-    //~^ ERROR `std::rc::Rc<_>: std::marker::Send` is not satisfied
+    //~^ ERROR `std::rc::Rc<{numeric}>: std::marker::Send` is not satisfied
 }
index c00be91a2d74daf067a0d99abb6251d0652239c9..7d69eca5ad58f9be952aac390405c104cce3f68c 100644 (file)
@@ -23,5 +23,5 @@ pub fn main() {
     // Unsized type.
     let arr: &[_] = &[1, 2, 3];
     let range = *arr..;
-    //~^ ERROR `[_]: std::marker::Sized` is not satisfied
+    //~^ ERROR `[{numeric}]: std::marker::Sized` is not satisfied
 }
index 3a7e9cc4191ec2af4de80bacf0579705aefe9bd8..1bdd24abe8183331ad3f9acf5d91794e4c7b1ff0 100644 (file)
@@ -28,7 +28,7 @@ fn main() {
     let d = [0; 0.5];
     //~^ ERROR mismatched types
     //~| expected type `usize`
-    //~| found type `_`
+    //~| found type `{numeric}`
     //~| expected usize, found floating-point variable
     //~| ERROR expected usize for repeat count, found float [E0306]
     let e = [0; "foo"];
index 3140bb6e5731d04d5822800e32fd00eb06dceb09..589876a7f5ff10a9126f1ba6f31af7f4b221c0d2 100644 (file)
@@ -16,8 +16,8 @@ fn main() {
     match Foo(1.1, marker::PhantomData) {
         1 => {}
     //~^ ERROR mismatched types
-    //~| expected type `Foo<_, _>`
-    //~| found type `_`
+    //~| expected type `Foo<{numeric}, _>`
+    //~| found type `{numeric}`
     //~| expected struct `Foo`, found integral variable
     }
 
index b972a09b5c4908fa9e200d0888fbbb1f64fe33b3..1fb93bd790912883df8eaf2af51cd80b5605faac 100644 (file)
@@ -10,5 +10,5 @@
 
 pub fn main() {
     let s: &str = "hello";
-    let c: u8 = s[4]; //~ ERROR `str: std::ops::Index<_>` is not satisfied
+    let c: u8 = s[4]; //~ ERROR `str: std::ops::Index<{numeric}>` is not satisfied
 }
index 1250d0dabcd9a561e87db5a136d2cf65c6e89c76..9624af488dd89ef8cce18f7974ba3772a437a25a 100644 (file)
@@ -24,6 +24,6 @@ fn main() {
                                //~| expected struct `Foo`, found struct `Bar`
     let f__isize = Foo { a: 2, ..4 }; //~  ERROR mismatched types
                                  //~| expected type `Foo`
-                                 //~| found type `_`
+                                 //~| found type `{numeric}`
                                  //~| expected struct `Foo`, found integral variable
 }
index 4503e465840fe73bfb6f5b0364f52e0f72f82fb7..89b57f3dcd325f9498172bc0a39d13f5be0be2d4 100644 (file)
@@ -23,7 +23,7 @@ struct Bar { x: isize }
                                        //~| expected struct `Foo`, found struct `Bar`
 static foo_i: Foo = Foo { a: 2, ..4 }; //~  ERROR mismatched types
                                        //~| expected type `Foo`
-                                       //~| found type `_`
+                                       //~| found type `{numeric}`
                                        //~| expected struct `Foo`, found integral variable
 
 fn main() {
index 2968e8a7ca9968edaeb83f689ab50274800dded0..97a99cb3ce7ccf6d2e7998bb643bed0f66283e2f 100644 (file)
@@ -26,5 +26,5 @@ fn is_ee<T: Combo>(t: T) {
 
 fn main() {
     is_ee(4);
-    //~^ ERROR overflow evaluating the requirement `_: Tweedle
+    //~^ ERROR overflow evaluating the requirement `{numeric}: Tweedle
 }
index e62255a4e77d4301756320a6cd13c25f5f5c69fa..09dc9aaf000e85cd666e63e7beee33a0918a96cc 100644 (file)
@@ -16,7 +16,7 @@ fn main() {
     let y = first ((1,2.0,3));
     //~^ ERROR mismatched types
     //~| expected type `(isize, f64)`
-    //~| found type `(isize, f64, _)`
+    //~| found type `(isize, f64, {numeric})`
     //~| expected a tuple with 2 elements, found one with 3 elements
 
     let y = first ((1,));
index c2c41fbbb2aaf16857a721a4a2dd90ec859dfafe..4a9d59ea0ed7ffa26de98c42db71ee188817895f 100644 (file)
@@ -20,5 +20,5 @@ fn main() {
     tuple.0;
     tuple.1;
     tuple.2;
-    //~^ ERROR attempted out-of-bounds tuple index `2` on type `(_, _)`
+    //~^ ERROR attempted out-of-bounds tuple index `2` on type `({numeric}, {numeric})`
 }
index 0f174d99fefcbe4b5d952776a7ec7d906dc7179a..681b3a559c2b8418c83d68dc587e780778eb6211 100644 (file)
@@ -13,7 +13,7 @@
 fn main() { let a: bool = 1; let b: i32 = true; }
 //~^ ERROR mismatched types
 //~| expected type `bool`
-//~| found type `_`
+//~| found type `{numeric}`
 //~| expected bool, found integral variable
 //~| ERROR mismatched types
 //~| expected i32, found bool
index 6047f6770a7bdc17422c88bdb54f1e182f4ecc96..50b8ae7e48cdc19ae58c546627609a92ae305ccb 100644 (file)
@@ -27,7 +27,7 @@ fn test<T: Sync>(s: T) {}
 fn main() {
     let us = UnsafeCell::new(MySync{u: UnsafeCell::new(0)});
     test(us);
-    //~^ ERROR `std::cell::UnsafeCell<MySync<_>>: std::marker::Sync` is not satisfied
+    //~^ ERROR `std::cell::UnsafeCell<MySync<{numeric}>>: std::marker::Sync` is not satisfied
 
     let uns = UnsafeCell::new(NoSync);
     test(uns);
index eb0baff0005ddd53ce54853b1f31223495b7d2b2..936b23075eb983606b2f2ec847aa0b99a03304c8 100644 (file)
@@ -24,7 +24,7 @@ fn gimme_an_a<A:TraitA>(&self, a: A) -> isize {
 
 fn call_it<B:TraitB>(b: B)  -> isize {
     let y = 4;
-    b.gimme_an_a(y) //~ ERROR `_: TraitA` is not satisfied
+    b.gimme_an_a(y) //~ ERROR `{numeric}: TraitA` is not satisfied
 }
 
 fn main() {
index ff6920d28ccf90a3647df517a6d4dae074feecdd..3a8d9a16398d1d9e7029c4c13587d29f11ba1833 100644 (file)
@@ -5,7 +5,7 @@ error[E0308]: mismatched types
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u64, found usize
 $DIR/issue-26480.rs:38:5: 38:19 note: in this expansion of write! (defined in $DIR/issue-26480.rs)
 
-error: non-scalar cast: `_` as `()`
+error: non-scalar cast: `{numeric}` as `()`
   --> $DIR/issue-26480.rs:33:19
    |
 33 |     ($x:expr) => ($x as ())