diff options
| author | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2016-10-23 02:44:36 +0000 |
|---|---|---|
| committer | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2016-10-25 20:26:00 +0000 |
| commit | 04ca378b897012026fb5a4ebe8e04263e32c236b (patch) | |
| tree | 5ccf59588f95b9ea96fde1039c20fca137e15bed /src/test | |
| parent | 199ed20aa6aa64ca58b4a924395bf9e1e71cf8a8 (diff) | |
| download | rust-04ca378b897012026fb5a4ebe8e04263e32c236b.tar.gz rust-04ca378b897012026fb5a4ebe8e04263e32c236b.zip | |
Support `use $crate;` with a future compatibility warning.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/compile-fail/auxiliary/import_crate_var.rs | 12 | ||||
| -rw-r--r-- | src/test/compile-fail/import-crate-var.rs | 21 |
2 files changed, 33 insertions, 0 deletions
diff --git a/src/test/compile-fail/auxiliary/import_crate_var.rs b/src/test/compile-fail/auxiliary/import_crate_var.rs new file mode 100644 index 00000000000..1dfc7a128aa --- /dev/null +++ b/src/test/compile-fail/auxiliary/import_crate_var.rs @@ -0,0 +1,12 @@ +// Copyright 2016 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. + +#[macro_export] +macro_rules! m { () => { use $crate; } } diff --git a/src/test/compile-fail/import-crate-var.rs b/src/test/compile-fail/import-crate-var.rs new file mode 100644 index 00000000000..9f573945483 --- /dev/null +++ b/src/test/compile-fail/import-crate-var.rs @@ -0,0 +1,21 @@ +// Copyright 2016 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. + +// aux-build:import_crate_var.rs +// error-pattern: `$crate` may not be imported +// error-pattern: `use $crate;` was erroneously allowed and will become a hard error + +#![feature(rustc_attrs)] + +#[macro_use] extern crate import_crate_var; +m!(); + +#[rustc_error] +fn main() {} |
