Skip to content

Commit

Permalink
syntax: add uniform_paths feature-gate.
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyb committed Aug 13, 2018
1 parent d5a448b commit 5218a5c
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/libsyntax/feature_gate.rs
Expand Up @@ -507,6 +507,9 @@ declare_features! (

// Support for arbitrary delimited token streams in non-macro attributes.
(active, unrestricted_attribute_tokens, "1.30.0", Some(44690), None),

// Allows `use x::y;` to resolve through `self::x`, not just `::x`.
(active, uniform_paths, "1.30.0", Some(53130), None),
);

declare_features! (
Expand Down
22 changes: 22 additions & 0 deletions src/test/ui/feature-gate-uniform-paths.rs
@@ -0,0 +1,22 @@
// Copyright 2018 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.

pub mod foo {
pub use bar::Bar;
//~^ ERROR unresolved import `bar`

pub mod bar {
pub struct Bar;
}
}

fn main() {
let _ = foo::Bar;
}
9 changes: 9 additions & 0 deletions src/test/ui/feature-gate-uniform-paths.stderr
@@ -0,0 +1,9 @@
error[E0432]: unresolved import `bar`
--> $DIR/feature-gate-uniform-paths.rs:12:13
|
LL | pub use bar::Bar;
| ^^^ Did you mean `self::bar`?

error: aborting due to previous error

For more information about this error, try `rustc --explain E0432`.

0 comments on commit 5218a5c

Please sign in to comment.