Skip to content

Commit 5218a5c

Browse files
committed
syntax: add uniform_paths feature-gate.
1 parent d5a448b commit 5218a5c

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

src/libsyntax/feature_gate.rs

+3
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,9 @@ declare_features! (
507507

508508
// Support for arbitrary delimited token streams in non-macro attributes.
509509
(active, unrestricted_attribute_tokens, "1.30.0", Some(44690), None),
510+
511+
// Allows `use x::y;` to resolve through `self::x`, not just `::x`.
512+
(active, uniform_paths, "1.30.0", Some(53130), None),
510513
);
511514

512515
declare_features! (
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
pub mod foo {
12+
pub use bar::Bar;
13+
//~^ ERROR unresolved import `bar`
14+
15+
pub mod bar {
16+
pub struct Bar;
17+
}
18+
}
19+
20+
fn main() {
21+
let _ = foo::Bar;
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error[E0432]: unresolved import `bar`
2+
--> $DIR/feature-gate-uniform-paths.rs:12:13
3+
|
4+
LL | pub use bar::Bar;
5+
| ^^^ Did you mean `self::bar`?
6+
7+
error: aborting due to previous error
8+
9+
For more information about this error, try `rustc --explain E0432`.

0 commit comments

Comments
 (0)