diff options
| author | Aaron Turon <aturon@mozilla.com> | 2014-07-16 13:50:33 -0700 |
|---|---|---|
| committer | Aaron Turon <aturon@mozilla.com> | 2014-07-16 13:53:06 -0700 |
| commit | 81b69d153869062af6992dc2c99c5536c7ff99f0 (patch) | |
| tree | 0ad4391d3ee95745acdef3365a60da0148c429e6 /src/test/compile-fail | |
| parent | 06c7ee9c56f7c768be94c89f699527b44be664ab (diff) | |
| download | rust-81b69d153869062af6992dc2c99c5536c7ff99f0.tar.gz rust-81b69d153869062af6992dc2c99c5536c7ff99f0.zip | |
stability lint: ignore code from macro expansion
This small patch causes the stability lint to bail out when traversing any AST produced via a macro expansion. Ultimately, we would like to lint the contents of the macro at the place where the macro is defined, but regardless we should not be linting it at the use site. Closes #15703
Diffstat (limited to 'src/test/compile-fail')
| -rw-r--r-- | src/test/compile-fail/lint-stability.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/test/compile-fail/lint-stability.rs b/src/test/compile-fail/lint-stability.rs index 5d06ad79c9b..3a9380befbc 100644 --- a/src/test/compile-fail/lint-stability.rs +++ b/src/test/compile-fail/lint-stability.rs @@ -11,13 +11,14 @@ // aux-build:lint_stability.rs // aux-build:inherited_stability.rs -#![feature(globs)] +#![feature(globs, phase)] #![deny(unstable)] #![deny(deprecated)] #![deny(experimental)] #![allow(dead_code)] mod cross_crate { + #[phase(plugin, link)] extern crate lint_stability; use self::lint_stability::*; @@ -76,7 +77,6 @@ mod cross_crate { foo.method_locked_text(); foo.trait_locked_text(); - let _ = DeprecatedStruct { i: 0 }; //~ ERROR use of deprecated item let _ = ExperimentalStruct { i: 0 }; //~ ERROR use of experimental item let _ = UnstableStruct { i: 0 }; //~ ERROR use of unstable item @@ -108,6 +108,13 @@ mod cross_crate { let _ = StableTupleStruct (1); let _ = FrozenTupleStruct (1); let _ = LockedTupleStruct (1); + + // At the moment, the following just checks that the stability + // level of expanded code does not trigger the + // lint. Eventually, we will want to lint the contents of the + // macro in the module *defining* it. Also, stability levels + // on macros themselves are not yet linted. + macro_test!(); } fn test_method_param<F: Trait>(foo: F) { |
