about summary refs log tree commit diff
path: root/src/libsyntax/lib.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-07-20 02:39:04 +0000
committerbors <bors@rust-lang.org>2019-07-20 02:39:04 +0000
commite9d22273283dce210b26362aa0dcc3fc10bf7e81 (patch)
tree89e913fc4ca5cf66a4ef0bc0e1bd47e2f3f648b3 /src/libsyntax/lib.rs
parent5c26b523686497a46d10104c7295f366099a298c (diff)
parent6ec4584d8482f51249d78efc340aaead76251859 (diff)
downloadrust-e9d22273283dce210b26362aa0dcc3fc10bf7e81.tar.gz
rust-e9d22273283dce210b26362aa0dcc3fc10bf7e81.zip
Auto merge of #62008 - ia0:issues_61053, r=petrochenkov
Add meta-variable checks in macro definitions

This is an implementation of #61053. It is not sound (some errors are not reported) and not complete (reports may not be actual errors). This is due to the possibility to define macros in macros in indirect ways. See module documentation of `macro_check` for more details.

What remains to be done:
- [x] Migrate from an error to an allow-by-default lint.
- [x] Add more comments in particular for the handling of nested macros.
- [x] Add more tests if needed.
- [x] Try to avoid cloning too much (one idea is to use lists on the stack).
- [ ] Run crater with deny-by-default lint (measure rate of false positives).
    - [ ] Remove extra commit for deny-by-default lint
- [x] Create a PR to remove the old `question_mark_macro_sep` lint #62160
Diffstat (limited to 'src/libsyntax/lib.rs')
-rw-r--r--src/libsyntax/lib.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs
index 591f2fb599b..3dea1977c4d 100644
--- a/src/libsyntax/lib.rs
+++ b/src/libsyntax/lib.rs
@@ -174,6 +174,7 @@ pub mod ext {
 
     pub mod tt {
         pub mod transcribe;
+        pub mod macro_check;
         pub mod macro_parser;
         pub mod macro_rules;
         pub mod quoted;