Skip to content

Commit 8389b66

Browse files
committed
Increase test coverage of use_nested_groups
1 parent 21882aa commit 8389b66

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

src/test/run-pass/use-nested-groups.rs

+7
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,19 @@ mod a {
2424
}
2525
}
2626

27+
// Test every possible part of the syntax
2728
use a::{B, d::{self, *, g::H}};
2829

30+
// Test a more common use case
31+
use std::sync::{Arc, atomic::{AtomicBool, Ordering}};
32+
2933
fn main() {
3034
let _: B;
3135
let _: E;
3236
let _: F;
3337
let _: H;
3438
let _: d::g::I;
39+
40+
let _: Arc<AtomicBool>;
41+
let _: Ordering;
3542
}
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Copyright 2018 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+
#![feature(use_nested_groups)]
12+
13+
mod a {
14+
pub mod b1 {
15+
pub enum C2 {}
16+
}
17+
18+
pub enum B2 {}
19+
}
20+
21+
use a::{b1::{C1, C2}, B2};
22+
//~^ ERROR unresolved import `a::b1::C1`
23+
24+
fn main() {
25+
let _: C2;
26+
let _: B2;
27+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error[E0432]: unresolved import `a::b1::C1`
2+
--> $DIR/use-nested-groups-error.rs:21:14
3+
|
4+
21 | use a::{b1::{C1, C2}, B2};
5+
| ^^ no `C1` in `a::b1`. Did you mean to use `C2`?
6+
7+
error: aborting due to previous error
8+

0 commit comments

Comments
 (0)