Update tests for less noisy error messages
This commit is contained in:
parent
779886f182
commit
ae6a9e6fd2
@ -13,5 +13,5 @@ mod foo {
|
||||
struct S1(pub(in foo) (), pub(T), pub(crate) (), pub(((), T)));
|
||||
struct S2(pub((foo)) ());
|
||||
//~^ ERROR expected `,`, found `(`
|
||||
//~| ERROR expected one of `;` or `where`, found `(`
|
||||
//~| ERROR cannot find type `foo` in this scope
|
||||
}
|
||||
|
@ -14,7 +14,6 @@ macro_rules! define_struct {
|
||||
struct S2(pub (in foo) ());
|
||||
struct S3(pub $t ());
|
||||
//~^ ERROR expected `,`, found `(`
|
||||
//~| ERROR expected one of `;` or `where`, found `(`
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,6 @@ macro_rules! define_struct {
|
||||
struct S2(pub (in foo) ());
|
||||
struct S3(pub($t) ());
|
||||
//~^ ERROR expected `,`, found `(`
|
||||
//~| ERROR expected one of `;` or `where`, found `(`
|
||||
}
|
||||
}
|
||||
|
||||
|
19
src/test/ui/similar-tokens.rs
Normal file
19
src/test/ui/similar-tokens.rs
Normal file
@ -0,0 +1,19 @@
|
||||
// Copyright 2017 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.
|
||||
|
||||
mod x {
|
||||
pub struct A;
|
||||
pub struct B;
|
||||
}
|
||||
|
||||
// `.` is similar to `,` so list parsing should continue to closing `}`
|
||||
use x::{A. B};
|
||||
|
||||
fn main() {}
|
8
src/test/ui/similar-tokens.stderr
Normal file
8
src/test/ui/similar-tokens.stderr
Normal file
@ -0,0 +1,8 @@
|
||||
error: expected one of `,` or `as`, found `.`
|
||||
--> $DIR/similar-tokens.rs:17:10
|
||||
|
|
||||
17 | use x::{A. B};
|
||||
| ^ expected one of `,` or `as` here
|
||||
|
||||
error: aborting due to previous error
|
||||
|
Loading…
Reference in New Issue
Block a user