diff options
| author | bors <bors@rust-lang.org> | 2015-07-29 14:47:23 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-07-29 14:47:23 +0000 |
| commit | ddbce1107bc95ea4ad0da6299ca31e313a39e0fc (patch) | |
| tree | 585177068133e497fdca05340ca4642719aba505 /src/test | |
| parent | ddc28298b9133e6a9cc39e276f9feff51d808949 (diff) | |
| parent | 5944303339fac6f2aa100ae4d2ac5fb72814c4e2 (diff) | |
| download | rust-ddbce1107bc95ea4ad0da6299ca31e313a39e0fc.tar.gz rust-ddbce1107bc95ea4ad0da6299ca31e313a39e0fc.zip | |
Auto merge of #27380 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #27102, #27286, #27313, #27325, #27326, #27327, #27341, #27342, #27343, #27345, #27350, #27355, #27374, #27375, #27379 - Failed merges:
Diffstat (limited to 'src/test')
39 files changed, 143 insertions, 100 deletions
diff --git a/src/test/compile-fail/bad-expr-lhs.rs b/src/test/compile-fail/bad-expr-lhs.rs index 6907bf4b5b8..c7d2f2c472f 100644 --- a/src/test/compile-fail/bad-expr-lhs.rs +++ b/src/test/compile-fail/bad-expr-lhs.rs @@ -9,12 +9,12 @@ // except according to those terms. fn main() { - 1 = 2; //~ ERROR illegal left-hand side expression - 1 += 2; //~ ERROR illegal left-hand side expression - (1, 2) = (3, 4); //~ ERROR illegal left-hand side expression + 1 = 2; //~ ERROR invalid left-hand side expression + 1 += 2; //~ ERROR invalid left-hand side expression + (1, 2) = (3, 4); //~ ERROR invalid left-hand side expression let (a, b) = (1, 2); - (a, b) = (3, 4); //~ ERROR illegal left-hand side expression + (a, b) = (3, 4); //~ ERROR invalid left-hand side expression - None = Some(3); //~ ERROR illegal left-hand side expression + None = Some(3); //~ ERROR invalid left-hand side expression } diff --git a/src/test/compile-fail/cast-as-bool.rs b/src/test/compile-fail/cast-as-bool.rs index 6d68f56b2b1..92cbbaa1cb4 100644 --- a/src/test/compile-fail/cast-as-bool.rs +++ b/src/test/compile-fail/cast-as-bool.rs @@ -8,5 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern: cannot cast as `bool`, compare with zero instead -fn main() { let u = (5 as bool); } +fn main() { + let u = (5 as bool); + //~^ ERROR cannot cast as `bool` + //~^^ HELP compare with zero instead +} diff --git a/src/test/compile-fail/cast-rfc0401.rs b/src/test/compile-fail/cast-rfc0401.rs index 29ce8c15143..7fca4aece69 100644 --- a/src/test/compile-fail/cast-rfc0401.rs +++ b/src/test/compile-fail/cast-rfc0401.rs @@ -10,12 +10,16 @@ fn illegal_cast<U:?Sized,V:?Sized>(u: *const U) -> *const V { - u as *const V //~ ERROR vtable kinds + u as *const V + //~^ ERROR casting + //~^^ NOTE vtable kinds } fn illegal_cast_2<U:?Sized>(u: *const U) -> *const str { - u as *const str //~ ERROR vtable kinds + u as *const str + //~^ ERROR casting + //~^^ NOTE vtable kinds } trait Foo { fn foo(&self) {} } @@ -41,32 +45,58 @@ fn main() let _ = v as (u32,); //~ ERROR non-scalar let _ = Some(&v) as *const u8; //~ ERROR non-scalar - let _ = v as f32; //~ ERROR through a usize first - let _ = main as f64; //~ ERROR through a usize first - let _ = &v as usize; //~ ERROR through a raw pointer first - let _ = f as *const u8; //~ ERROR through a usize first - let _ = 3 as bool; //~ ERROR compare with zero - let _ = E::A as bool; //~ ERROR compare with zero + let _ = v as f32; + //~^ ERROR casting + //~^^ HELP through a usize first + let _ = main as f64; + //~^ ERROR casting + //~^^ HELP through a usize first + let _ = &v as usize; + //~^ ERROR casting + //~^^ HELP through a raw pointer first + let _ = f as *const u8; + //~^ ERROR casting + //~^^ HELP through a usize first + let _ = 3 as bool; + //~^ ERROR cannot cast as `bool` + //~^^ HELP compare with zero + let _ = E::A as bool; + //~^ ERROR cannot cast as `bool` + //~^^ HELP compare with zero let _ = 0x61u32 as char; //~ ERROR only `u8` can be cast - let _ = false as f32; //~ ERROR through an integer first - let _ = E::A as f32; //~ ERROR through an integer first - let _ = 'a' as f32; //~ ERROR through an integer first + let _ = false as f32; + //~^ ERROR casting + //~^^ HELP through an integer first + let _ = E::A as f32; + //~^ ERROR casting + //~^^ HELP through an integer first + let _ = 'a' as f32; + //~^ ERROR casting + //~^^ HELP through an integer first - let _ = false as *const u8; //~ ERROR through a usize first - let _ = E::A as *const u8; //~ ERROR through a usize first - let _ = 'a' as *const u8; //~ ERROR through a usize first + let _ = false as *const u8; + //~^ ERROR casting + //~^^ HELP through a usize first + let _ = E::A as *const u8; + //~^ ERROR casting + //~^^ HELP through a usize first + let _ = 'a' as *const u8; + //~^ ERROR casting + //~^^ HELP through a usize first - let _ = 42usize as *const [u8]; //~ ERROR illegal cast - let _ = v as *const [u8]; //~ ERROR illegal cast + let _ = 42usize as *const [u8]; //~ ERROR casting + let _ = v as *const [u8]; //~ ERROR casting let _ = fat_v as *const Foo; //~^ ERROR `core::marker::Sized` is not implemented for the type `[u8]` - let _ = foo as *const str; //~ ERROR illegal cast - let _ = foo as *mut str; //~ ERROR illegal cast - let _ = main as *mut str; //~ ERROR illegal cast - let _ = &f as *mut f32; //~ ERROR illegal cast - let _ = &f as *const f64; //~ ERROR illegal cast - let _ = fat_v as usize; //~ ERROR through a raw pointer first + let _ = foo as *const str; //~ ERROR casting + let _ = foo as *mut str; //~ ERROR casting + let _ = main as *mut str; //~ ERROR casting + let _ = &f as *mut f32; //~ ERROR casting + let _ = &f as *const f64; //~ ERROR casting + let _ = fat_v as usize; + //~^ ERROR casting + //~^^ HELP through a raw pointer first let a : *const str = "hello"; let _ = a as *const Foo; @@ -76,6 +106,10 @@ fn main() let _ = main.f as *const u32; //~ ERROR attempted access of field let cf: *const Foo = &0; - let _ = cf as *const [u8]; //~ ERROR vtable kinds - let _ = cf as *const Bar; //~ ERROR vtable kinds + let _ = cf as *const [u8]; + //~^ ERROR casting + //~^^ NOTE vtable kinds + let _ = cf as *const Bar; + //~^ ERROR casting + //~^^ NOTE vtable kinds } diff --git a/src/test/compile-fail/const-cast-different-types.rs b/src/test/compile-fail/const-cast-different-types.rs index e6851f02cb6..397804566b4 100644 --- a/src/test/compile-fail/const-cast-different-types.rs +++ b/src/test/compile-fail/const-cast-different-types.rs @@ -9,8 +9,8 @@ // except according to those terms. static a: &'static str = "foo"; -static b: *const u8 = a as *const u8; //~ ERROR illegal cast -static c: *const u8 = &a as *const u8; //~ ERROR illegal cast +static b: *const u8 = a as *const u8; //~ ERROR casting +static c: *const u8 = &a as *const u8; //~ ERROR casting fn main() { } diff --git a/src/test/compile-fail/enum-to-float-cast-2.rs b/src/test/compile-fail/enum-to-float-cast-2.rs index 7ee67131755..e6f473c8aac 100644 --- a/src/test/compile-fail/enum-to-float-cast-2.rs +++ b/src/test/compile-fail/enum-to-float-cast-2.rs @@ -21,8 +21,8 @@ enum F { } pub fn main() { - let a = E::L0 as f32; //~ ERROR illegal cast - let c = F::H1 as f32; //~ ERROR illegal cast + let a = E::L0 as f32; //~ ERROR casting + let c = F::H1 as f32; //~ ERROR casting assert_eq!(a, -1.0f32); assert_eq!(c, -1.0f32); } diff --git a/src/test/compile-fail/enum-to-float-cast.rs b/src/test/compile-fail/enum-to-float-cast.rs index 225b8702302..b562ba0e41a 100644 --- a/src/test/compile-fail/enum-to-float-cast.rs +++ b/src/test/compile-fail/enum-to-float-cast.rs @@ -20,8 +20,8 @@ enum F { H1 = 0xFFFFFFFFFFFFFFFF } -static C0: f32 = E::L0 as f32; //~ ERROR illegal cast -static C1: f32 = F::H1 as f32; //~ ERROR illegal cast +static C0: f32 = E::L0 as f32; //~ ERROR casting +static C1: f32 = F::H1 as f32; //~ ERROR casting pub fn main() { let b = C0; diff --git a/src/test/compile-fail/fat-ptr-cast.rs b/src/test/compile-fail/fat-ptr-cast.rs index 25cab09b7cb..3746f29ea55 100644 --- a/src/test/compile-fail/fat-ptr-cast.rs +++ b/src/test/compile-fail/fat-ptr-cast.rs @@ -17,14 +17,16 @@ fn main() { let p = a as *const [i32]; let q = a.as_ptr(); - a as usize; //~ ERROR illegal cast + a as usize; //~ ERROR casting b as usize; //~ ERROR non-scalar cast - p as usize; //~ ERROR illegal cast; cast through a raw pointer + p as usize; + //~^ ERROR casting + //~^^ HELP cast through a raw pointer // #22955 - q as *const [i32]; //~ ERROR illegal cast + q as *const [i32]; //~ ERROR casting // #21397 - let t: *mut (Trait + 'static) = 0 as *mut _; //~ ERROR illegal cast - let mut fail: *const str = 0 as *const str; //~ ERROR illegal cast + let t: *mut (Trait + 'static) = 0 as *mut _; //~ ERROR casting + let mut fail: *const str = 0 as *const str; //~ ERROR casting } diff --git a/src/test/compile-fail/infinite-tag-type-recursion.rs b/src/test/compile-fail/infinite-tag-type-recursion.rs index a57c015d684..7dbf75feda0 100644 --- a/src/test/compile-fail/infinite-tag-type-recursion.rs +++ b/src/test/compile-fail/infinite-tag-type-recursion.rs @@ -9,7 +9,7 @@ // except according to those terms. -// error-pattern: illegal recursive enum type; wrap the inner value in a box +// error-pattern: invalid recursive enum type enum mlist { cons(isize, mlist), nil, } diff --git a/src/test/compile-fail/issue-13407.rs b/src/test/compile-fail/issue-13407.rs index f845eba4060..311280bd497 100644 --- a/src/test/compile-fail/issue-13407.rs +++ b/src/test/compile-fail/issue-13407.rs @@ -14,6 +14,6 @@ mod A { fn main() { A::C = 1; - //~^ ERROR: illegal left-hand side expression + //~^ ERROR: invalid left-hand side expression //~| ERROR: mismatched types } diff --git a/src/test/compile-fail/issue-14845.rs b/src/test/compile-fail/issue-14845.rs index 219f08ad35a..74f0833e8d1 100644 --- a/src/test/compile-fail/issue-14845.rs +++ b/src/test/compile-fail/issue-14845.rs @@ -15,8 +15,8 @@ struct X { fn main() { let x = X { a: [0] }; - let _f = &x.a as *mut u8; //~ ERROR illegal cast + let _f = &x.a as *mut u8; //~ ERROR casting let local: [u8; 1] = [0]; - let _v = &local as *mut u8; //~ ERROR illegal cast + let _v = &local as *mut u8; //~ ERROR casting } diff --git a/src/test/compile-fail/issue-17431-1.rs b/src/test/compile-fail/issue-17431-1.rs index 896a9c06873..bd3f2835058 100644 --- a/src/test/compile-fail/issue-17431-1.rs +++ b/src/test/compile-fail/issue-17431-1.rs @@ -9,7 +9,7 @@ // except according to those terms. struct Foo { foo: Option<Option<Foo>> } -//~^ ERROR illegal recursive struct type; wrap the inner value in a box to make it representable +//~^ ERROR invalid recursive struct type impl Foo { fn bar(&self) {} } diff --git a/src/test/compile-fail/issue-17431-2.rs b/src/test/compile-fail/issue-17431-2.rs index 886fe8d771a..4e1c0d6571d 100644 --- a/src/test/compile-fail/issue-17431-2.rs +++ b/src/test/compile-fail/issue-17431-2.rs @@ -9,10 +9,10 @@ // except according to those terms. struct Baz { q: Option<Foo> } -//~^ ERROR illegal recursive struct type; wrap the inner value in a box to make it representable +//~^ ERROR invalid recursive struct type struct Foo { q: Option<Baz> } -//~^ ERROR illegal recursive struct type; wrap the inner value in a box to make it representable +//~^ ERROR invalid recursive struct type impl Foo { fn bar(&self) {} } diff --git a/src/test/compile-fail/issue-17431-3.rs b/src/test/compile-fail/issue-17431-3.rs index c1c450935f6..07c5f106456 100644 --- a/src/test/compile-fail/issue-17431-3.rs +++ b/src/test/compile-fail/issue-17431-3.rs @@ -11,7 +11,7 @@ use std::sync::Mutex; struct Foo { foo: Mutex<Option<Foo>> } -//~^ ERROR illegal recursive struct type; wrap the inner value in a box to make it representable +//~^ ERROR invalid recursive struct type impl Foo { fn bar(&self) {} } diff --git a/src/test/compile-fail/issue-17431-4.rs b/src/test/compile-fail/issue-17431-4.rs index 22aaa796ad0..74952d9ca2b 100644 --- a/src/test/compile-fail/issue-17431-4.rs +++ b/src/test/compile-fail/issue-17431-4.rs @@ -11,7 +11,7 @@ use std::marker; struct Foo<T> { foo: Option<Option<Foo<T>>>, marker: marker::PhantomData<T> } -//~^ ERROR illegal recursive struct type; wrap the inner value in a box to make it representable +//~^ ERROR invalid recursive struct type impl<T> Foo<T> { fn bar(&self) {} } diff --git a/src/test/compile-fail/issue-17431-5.rs b/src/test/compile-fail/issue-17431-5.rs index cc9cc2e3c03..157b5ed434e 100644 --- a/src/test/compile-fail/issue-17431-5.rs +++ b/src/test/compile-fail/issue-17431-5.rs @@ -12,7 +12,7 @@ use std::marker; struct Foo { foo: Bar<Foo> } struct Bar<T> { x: Bar<Foo> , marker: marker::PhantomData<T> } -//~^ ERROR illegal recursive struct type; wrap the inner value in a box to make it representable +//~^ ERROR invalid recursive struct type impl Foo { fn foo(&self) {} } diff --git a/src/test/compile-fail/issue-17431-6.rs b/src/test/compile-fail/issue-17431-6.rs index 8eac295353d..b2037378d37 100644 --- a/src/test/compile-fail/issue-17431-6.rs +++ b/src/test/compile-fail/issue-17431-6.rs @@ -11,7 +11,7 @@ use std::sync::Mutex; enum Foo { X(Mutex<Option<Foo>>) } -//~^ ERROR illegal recursive enum type; wrap the inner value in a box to make it representable +//~^ ERROR invalid recursive enum type impl Foo { fn bar(self) {} } diff --git a/src/test/compile-fail/issue-17431-7.rs b/src/test/compile-fail/issue-17431-7.rs index c64c040aa44..9ad81e030aa 100644 --- a/src/test/compile-fail/issue-17431-7.rs +++ b/src/test/compile-fail/issue-17431-7.rs @@ -9,7 +9,7 @@ // except according to those terms. enum Foo { Voo(Option<Option<Foo>>) } -//~^ ERROR illegal recursive enum type; wrap the inner value in a box to make it representable +//~^ ERROR invalid recursive enum type impl Foo { fn bar(&self) {} } diff --git a/src/test/compile-fail/issue-17444.rs b/src/test/compile-fail/issue-17444.rs index a079161d42e..c1d5827eb90 100644 --- a/src/test/compile-fail/issue-17444.rs +++ b/src/test/compile-fail/issue-17444.rs @@ -14,5 +14,6 @@ enum Test { fn main() { let _x = Test::Foo as *const isize; - //~^ ERROR illegal cast; cast through a usize first: `Test` as `*const isize` + //~^ ERROR casting `Test` as `*const isize` is invalid + //~^^ HELP cast through a usize first } diff --git a/src/test/compile-fail/issue-21554.rs b/src/test/compile-fail/issue-21554.rs index 16ce84715b1..741707a47b6 100644 --- a/src/test/compile-fail/issue-21554.rs +++ b/src/test/compile-fail/issue-21554.rs @@ -11,5 +11,7 @@ struct Inches(i32); fn main() { - Inches as f32; //~ ERROR illegal cast; cast through a usize first + Inches as f32; + //~^ ERROR casting + //~^^ cast through a usize first } diff --git a/src/test/compile-fail/issue-2718-a.rs b/src/test/compile-fail/issue-2718-a.rs index 3ba8dd4fefe..37daf76c0b9 100644 --- a/src/test/compile-fail/issue-2718-a.rs +++ b/src/test/compile-fail/issue-2718-a.rs @@ -16,7 +16,7 @@ mod pingpong { use send_packet; pub type ping = send_packet<pong>; pub struct pong(send_packet<ping>); - //~^ ERROR illegal recursive struct type; wrap the inner value in a box to make it representable + //~^ ERROR invalid recursive struct type } fn main() {} diff --git a/src/test/compile-fail/issue-3008-1.rs b/src/test/compile-fail/issue-3008-1.rs index d2d7d800470..eb684208326 100644 --- a/src/test/compile-fail/issue-3008-1.rs +++ b/src/test/compile-fail/issue-3008-1.rs @@ -10,7 +10,7 @@ enum foo { foo_(bar) } enum bar { bar_none, bar_some(bar) } -//~^ ERROR illegal recursive enum type; wrap the inner value in a box to make it representable +//~^ ERROR invalid recursive enum type fn main() { } diff --git a/src/test/compile-fail/issue-3008-2.rs b/src/test/compile-fail/issue-3008-2.rs index 2f1fa6780ab..f934e0771c2 100644 --- a/src/test/compile-fail/issue-3008-2.rs +++ b/src/test/compile-fail/issue-3008-2.rs @@ -12,7 +12,7 @@ enum foo { foo_(bar) } struct bar { x: bar } -//~^ ERROR illegal recursive struct type; wrap the inner value in a box to make it representable +//~^ ERROR invalid recursive struct type fn main() { } diff --git a/src/test/compile-fail/issue-3008-3.rs b/src/test/compile-fail/issue-3008-3.rs index af6cee1f107..f8756b83f23 100644 --- a/src/test/compile-fail/issue-3008-3.rs +++ b/src/test/compile-fail/issue-3008-3.rs @@ -12,7 +12,7 @@ use std::marker; enum E1 { V1(E2<E1>), } enum E2<T> { V2(E2<E1>, marker::PhantomData<T>), } -//~^ ERROR illegal recursive enum type; wrap the inner value in a box to make it representable +//~^ ERROR invalid recursive enum type impl E1 { fn foo(&self) {} } diff --git a/src/test/compile-fail/issue-3779.rs b/src/test/compile-fail/issue-3779.rs index 19a7ed05bf4..66d8fb40cd1 100644 --- a/src/test/compile-fail/issue-3779.rs +++ b/src/test/compile-fail/issue-3779.rs @@ -9,7 +9,7 @@ // except according to those terms. struct S { - //~^ ERROR illegal recursive struct type; wrap the inner value in a box to make it representable + //~^ ERROR invalid recursive struct type element: Option<S> } diff --git a/src/test/compile-fail/old-suffixes-are-really-forbidden.rs b/src/test/compile-fail/old-suffixes-are-really-forbidden.rs index b18741d3932..9a71dc98014 100644 --- a/src/test/compile-fail/old-suffixes-are-really-forbidden.rs +++ b/src/test/compile-fail/old-suffixes-are-really-forbidden.rs @@ -9,6 +9,6 @@ // except according to those terms. fn main() { - let a = 1_is; //~ ERROR illegal suffix - let b = 2_us; //~ ERROR illegal suffix + let a = 1_is; //~ ERROR invalid suffix + let b = 2_us; //~ ERROR invalid suffix } diff --git a/src/test/compile-fail/recursive-enum.rs b/src/test/compile-fail/recursive-enum.rs index 119f6dae9e5..33dcbdf74d2 100644 --- a/src/test/compile-fail/recursive-enum.rs +++ b/src/test/compile-fail/recursive-enum.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern: illegal recursive enum type +// error-pattern: invalid recursive enum type enum list<T> { cons(T, list<T>), nil } diff --git a/src/test/compile-fail/regions-name-static.rs b/src/test/compile-fail/regions-name-static.rs index 29896aa486b..69d63f3820c 100644 --- a/src/test/compile-fail/regions-name-static.rs +++ b/src/test/compile-fail/regions-name-static.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -struct Foo<'static> { //~ ERROR illegal lifetime parameter name: `'static` +struct Foo<'static> { //~ ERROR invalid lifetime parameter name: `'static` x: &'static isize } diff --git a/src/test/compile-fail/type-recursive.rs b/src/test/compile-fail/type-recursive.rs index b972934d060..3b08d900733 100644 --- a/src/test/compile-fail/type-recursive.rs +++ b/src/test/compile-fail/type-recursive.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:illegal recursive struct type +// error-pattern:invalid recursive struct type struct t1 { foo: isize, foolish: t1 diff --git a/src/test/compile-fail/typeck-cast-pointer-to-float.rs b/src/test/compile-fail/typeck-cast-pointer-to-float.rs index e10a76c65bc..2277b1bad77 100644 --- a/src/test/compile-fail/typeck-cast-pointer-to-float.rs +++ b/src/test/compile-fail/typeck-cast-pointer-to-float.rs @@ -11,5 +11,6 @@ fn main() { let x : i16 = 22; ((&x) as *const i16) as f32; - //~^ ERROR illegal cast; cast through a usize first: `*const i16` as `f32` + //~^ ERROR casting `*const i16` as `f32` is invalid + //~^^ HELP cast through a usize first } diff --git a/src/test/compile-fail/unsupported-cast.rs b/src/test/compile-fail/unsupported-cast.rs index b4246f2ed87..8b63dd51729 100644 --- a/src/test/compile-fail/unsupported-cast.rs +++ b/src/test/compile-fail/unsupported-cast.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:illegal cast +// error-pattern:casting #![feature(libc)] diff --git a/src/test/compile-fail/vector-cast-weirdness.rs b/src/test/compile-fail/vector-cast-weirdness.rs index 10227f1820d..26c59c440d4 100644 --- a/src/test/compile-fail/vector-cast-weirdness.rs +++ b/src/test/compile-fail/vector-cast-weirdness.rs @@ -28,7 +28,7 @@ fn main() { let mut x1 = X { y: [0, 0] }; // This is still an error since we don't allow casts from &mut [T; n] to *mut T. - let p1: *mut u8 = &mut x1.y as *mut _; //~ ERROR illegal cast + let p1: *mut u8 = &mut x1.y as *mut _; //~ ERROR casting let t1: *mut [u8; 2] = &mut x1.y as *mut _; let h1: *mut [u8; 2] = &mut x1.y as *mut [u8; 2]; } diff --git a/src/test/parse-fail/bad-lit-suffixes.rs b/src/test/parse-fail/bad-lit-suffixes.rs index a64ee6a9ce2..a2ee2f6e88c 100644 --- a/src/test/parse-fail/bad-lit-suffixes.rs +++ b/src/test/parse-fail/bad-lit-suffixes.rs @@ -12,28 +12,28 @@ extern - "C"suffix //~ ERROR ABI spec with a suffix is illegal + "C"suffix //~ ERROR ABI spec with a suffix is invalid fn foo() {} extern - "C"suffix //~ ERROR ABI spec with a suffix is illegal + "C"suffix //~ ERROR ABI spec with a suffix is invalid {} fn main() { - ""suffix; //~ ERROR str literal with a suffix is illegal - b""suffix; //~ ERROR binary str literal with a suffix is illegal - r#""#suffix; //~ ERROR str literal with a suffix is illegal - br#""#suffix; //~ ERROR binary str literal with a suffix is illegal - 'a'suffix; //~ ERROR char literal with a suffix is illegal - b'a'suffix; //~ ERROR byte literal with a suffix is illegal + ""suffix; //~ ERROR str literal with a suffix is invalid + b""suffix; //~ ERROR binary str literal with a suffix is invalid + r#""#suffix; //~ ERROR str literal with a suffix is invalid + br#""#suffix; //~ ERROR binary str literal with a suffix is invalid + 'a'suffix; //~ ERROR char literal with a suffix is invalid + b'a'suffix; //~ ERROR byte literal with a suffix is invalid - 1234u1024; //~ ERROR illegal width `1024` for integer literal - 1234i1024; //~ ERROR illegal width `1024` for integer literal - 1234f1024; //~ ERROR illegal width `1024` for float literal - 1234.5f1024; //~ ERROR illegal width `1024` for float literal + 1234u1024; //~ ERROR invalid width `1024` for integer literal + 1234i1024; //~ ERROR invalid width `1024` for integer literal + 1234f1024; //~ ERROR invalid width `1024` for float literal + 1234.5f1024; //~ ERROR invalid width `1024` for float literal - 1234suffix; //~ ERROR illegal suffix `suffix` for numeric literal - 0b101suffix; //~ ERROR illegal suffix `suffix` for numeric literal - 1.0suffix; //~ ERROR illegal suffix `suffix` for float literal - 1.0e10suffix; //~ ERROR illegal suffix `suffix` for float literal + 1234suffix; //~ ERROR invalid suffix `suffix` for numeric literal + 0b101suffix; //~ ERROR invalid suffix `suffix` for numeric literal + 1.0suffix; //~ ERROR invalid suffix `suffix` for float literal + 1.0e10suffix; //~ ERROR invalid suffix `suffix` for float literal } diff --git a/src/test/parse-fail/byte-literals.rs b/src/test/parse-fail/byte-literals.rs index 6685a29bb42..3321f2450c1 100644 --- a/src/test/parse-fail/byte-literals.rs +++ b/src/test/parse-fail/byte-literals.rs @@ -17,7 +17,7 @@ static FOO: u8 = b'\f'; //~ ERROR unknown byte escape pub fn main() { b'\f'; //~ ERROR unknown byte escape - b'\x0Z'; //~ ERROR illegal character in numeric character escape: Z + b'\x0Z'; //~ ERROR invalid character in numeric character escape: Z b' '; //~ ERROR byte constant must be escaped b'''; //~ ERROR byte constant must be escaped b'é'; //~ ERROR byte constant must be ASCII diff --git a/src/test/parse-fail/byte-string-literals.rs b/src/test/parse-fail/byte-string-literals.rs index 7049363c21b..22f123416f2 100644 --- a/src/test/parse-fail/byte-string-literals.rs +++ b/src/test/parse-fail/byte-string-literals.rs @@ -17,7 +17,7 @@ static FOO: &'static [u8] = b"\f"; //~ ERROR unknown byte escape pub fn main() { b"\f"; //~ ERROR unknown byte escape - b"\x0Z"; //~ ERROR illegal character in numeric character escape: Z + b"\x0Z"; //~ ERROR invalid character in numeric character escape: Z b"é"; //~ ERROR byte constant must be ASCII b"a //~ ERROR unterminated double quote byte string } diff --git a/src/test/parse-fail/issue-23620-invalid-escapes.rs b/src/test/parse-fail/issue-23620-invalid-escapes.rs index 1790b9164b7..d2f78ef897b 100644 --- a/src/test/parse-fail/issue-23620-invalid-escapes.rs +++ b/src/test/parse-fail/issue-23620-invalid-escapes.rs @@ -23,25 +23,25 @@ fn main() { //~^ ERROR numeric character escape is too short let _ = b'\xxy'; - //~^ ERROR illegal character in numeric character escape: x - //~^^ ERROR illegal character in numeric character escape: y + //~^ ERROR invalid character in numeric character escape: x + //~^^ ERROR invalid character in numeric character escape: y let _ = '\x5'; //~^ ERROR numeric character escape is too short let _ = '\xxy'; - //~^ ERROR illegal character in numeric character escape: x - //~^^ ERROR illegal character in numeric character escape: y + //~^ ERROR invalid character in numeric character escape: x + //~^^ ERROR invalid character in numeric character escape: y let _ = b"\u{a4a4} \xf \u"; //~^ ERROR unicode escape sequences cannot be used as a byte or in a byte string - //~^^ ERROR illegal character in numeric character escape: + //~^^ ERROR invalid character in numeric character escape: //~^^^ ERROR incorrect unicode escape sequence //~^^^^ ERROR unicode escape sequences cannot be used as a byte or in a byte string let _ = "\u{ffffff} \xf \u"; - //~^ ERROR illegal unicode character escape - //~^^ ERROR illegal character in numeric character escape: + //~^ ERROR invalid unicode character escape + //~^^ ERROR invalid character in numeric character escape: //~^^^ ERROR form of character escape may only be used with characters in the range [\x00-\x7f] //~^^^^ ERROR incorrect unicode escape sequence } diff --git a/src/test/parse-fail/issue-8537.rs b/src/test/parse-fail/issue-8537.rs index 5996b744566..e152a369290 100644 --- a/src/test/parse-fail/issue-8537.rs +++ b/src/test/parse-fail/issue-8537.rs @@ -11,7 +11,7 @@ // compile-flags: -Z parse-only pub extern - "invalid-ab_isize" //~ ERROR illegal ABI + "invalid-ab_isize" //~ ERROR invalid ABI fn foo() {} fn main() {} diff --git a/src/test/parse-fail/new-unicode-escapes-3.rs b/src/test/parse-fail/new-unicode-escapes-3.rs index 5e8bc16ac6e..d12bb63111b 100644 --- a/src/test/parse-fail/new-unicode-escapes-3.rs +++ b/src/test/parse-fail/new-unicode-escapes-3.rs @@ -11,5 +11,5 @@ // compile-flags: -Z parse-only pub fn main() { - let s = "\u{d805}"; //~ ERROR illegal unicode character escape + let s = "\u{d805}"; //~ ERROR invalid unicode character escape } diff --git a/src/test/parse-fail/new-unicode-escapes-4.rs b/src/test/parse-fail/new-unicode-escapes-4.rs index 896751bd4a7..fe125da1755 100644 --- a/src/test/parse-fail/new-unicode-escapes-4.rs +++ b/src/test/parse-fail/new-unicode-escapes-4.rs @@ -12,7 +12,7 @@ pub fn main() { let s = "\u{lol}"; - //~^ ERROR illegal character in unicode escape: l - //~^^ ERROR illegal character in unicode escape: o - //~^^^ ERROR illegal character in unicode escape: l + //~^ ERROR invalid character in unicode escape: l + //~^^ ERROR invalid character in unicode escape: o + //~^^^ ERROR invalid character in unicode escape: l } diff --git a/src/test/parse-fail/raw-str-delim.rs b/src/test/parse-fail/raw-str-delim.rs index c7ef91f14f5..3fc5f8aae18 100644 --- a/src/test/parse-fail/raw-str-delim.rs +++ b/src/test/parse-fail/raw-str-delim.rs @@ -11,5 +11,5 @@ // compile-flags: -Z parse-only static s: &'static str = - r#x"#"x# //~ ERROR only `#` is allowed in raw string delimitation; found illegal character + r#x"#"x# //~ ERROR found invalid character; only `#` is allowed in raw string delimitation ; |
