diff options
| author | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2018-08-09 23:50:04 +0300 |
|---|---|---|
| committer | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2018-08-14 01:18:05 +0300 |
| commit | 5218a5cf356b65e8fc1014cdf0e299c6c2ab6e01 (patch) | |
| tree | 2f35a39e7d6f03779b9f9278bd071ede362b998b | |
| parent | d5a448b3f47b22c9cb010198bdcc49d4392b090b (diff) | |
| download | rust-5218a5cf356b65e8fc1014cdf0e299c6c2ab6e01.tar.gz rust-5218a5cf356b65e8fc1014cdf0e299c6c2ab6e01.zip | |
syntax: add `uniform_paths` feature-gate.
| -rw-r--r-- | src/libsyntax/feature_gate.rs | 3 | ||||
| -rw-r--r-- | src/test/ui/feature-gate-uniform-paths.rs | 22 | ||||
| -rw-r--r-- | src/test/ui/feature-gate-uniform-paths.stderr | 9 |
3 files changed, 34 insertions, 0 deletions
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index b779b2eb689..56e69b9df9e 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -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! ( diff --git a/src/test/ui/feature-gate-uniform-paths.rs b/src/test/ui/feature-gate-uniform-paths.rs new file mode 100644 index 00000000000..140655d52bd --- /dev/null +++ b/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; +} diff --git a/src/test/ui/feature-gate-uniform-paths.stderr b/src/test/ui/feature-gate-uniform-paths.stderr new file mode 100644 index 00000000000..68faacfcbe7 --- /dev/null +++ b/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`. |
