Skip to content

Commit ae6a9e6

Browse files
committed
Update tests for less noisy error messages
1 parent 779886f commit ae6a9e6

File tree

5 files changed

+28
-3
lines changed

5 files changed

+28
-3
lines changed

src/test/compile-fail/privacy/restricted/tuple-struct-fields/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ mod foo {
1313
struct S1(pub(in foo) (), pub(T), pub(crate) (), pub(((), T)));
1414
struct S2(pub((foo)) ());
1515
//~^ ERROR expected `,`, found `(`
16-
//~| ERROR expected one of `;` or `where`, found `(`
16+
//~| ERROR cannot find type `foo` in this scope
1717
}

src/test/compile-fail/privacy/restricted/tuple-struct-fields/test2.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ macro_rules! define_struct {
1414
struct S2(pub (in foo) ());
1515
struct S3(pub $t ());
1616
//~^ ERROR expected `,`, found `(`
17-
//~| ERROR expected one of `;` or `where`, found `(`
1817
}
1918
}
2019

src/test/compile-fail/privacy/restricted/tuple-struct-fields/test3.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ macro_rules! define_struct {
1414
struct S2(pub (in foo) ());
1515
struct S3(pub($t) ());
1616
//~^ ERROR expected `,`, found `(`
17-
//~| ERROR expected one of `;` or `where`, found `(`
1817
}
1918
}
2019

src/test/ui/similar-tokens.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
mod x {
12+
pub struct A;
13+
pub struct B;
14+
}
15+
16+
// `.` is similar to `,` so list parsing should continue to closing `}`
17+
use x::{A. B};
18+
19+
fn main() {}

src/test/ui/similar-tokens.stderr

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected one of `,` or `as`, found `.`
2+
--> $DIR/similar-tokens.rs:17:10
3+
|
4+
17 | use x::{A. B};
5+
| ^ expected one of `,` or `as` here
6+
7+
error: aborting due to previous error
8+

0 commit comments

Comments
 (0)