Skip to content

Commit b3fc5d5

Browse files
committed
split test into failing and passing components
1 parent 51c8c12 commit b3fc5d5

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/names/name-resolution.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ Names may not be resolved through ambiguous glob imports. Glob imports are allow
152152

153153
For example:
154154

155-
```rust
155+
```rust,compile_fail,E0659
156156
mod foo {
157157
pub struct Qux;
158158
}
@@ -165,10 +165,21 @@ use foo::*;
165165
use bar::*; // OK, no name conflict.
166166
167167
fn ambiguous_use() {
168-
// This would be an error, due to the ambiguity.
169-
//let x = Qux;
168+
let x = Qux; // ERROR: `Qux` is ambiguous
170169
}
170+
```
171171

172+
```rust
173+
# mod foo {
174+
# pub struct Qux;
175+
# }
176+
#
177+
# mod bar {
178+
# pub struct Qux;
179+
# }
180+
#
181+
# use foo::*;
182+
# use bar::*; // OK, no name conflict.
172183
fn ambiguous_shadow() {
173184
// This is permitted, since resolution is not through the ambiguous globs.
174185
struct Qux;

0 commit comments

Comments
 (0)