Skip to content

Commit e846a86

Browse files
Revert "Remove missing_fragment_specifier lint"
This reverts commit 5ba9610.
1 parent ab80426 commit e846a86

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/doc/rustc/src/lints/listing/deny-by-default.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@ error: defaults for type parameters are only allowed in `struct`, `enum`, `type`
4545
= note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887>
4646
```
4747

48+
## missing-fragment-specifier
49+
50+
The missing_fragment_specifier warning is issued when an unused pattern in a
51+
`macro_rules!` macro definition has a meta-variable (e.g. `$e`) that is not
52+
followed by a fragment specifier (e.g. `:expr`).
53+
54+
This warning can always be fixed by removing the unused pattern in the
55+
`macro_rules!` macro definition.
56+
4857
## mutable-transmutes
4958

5059
This lint catches transmuting from `&T` to `&mut T` because it is undefined

src/librustc_session/lint/builtin.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,16 @@ declare_lint! {
252252
};
253253
}
254254

255+
declare_lint! {
256+
pub MISSING_FRAGMENT_SPECIFIER,
257+
Deny,
258+
"detects missing fragment specifiers in unused `macro_rules!` patterns",
259+
@future_incompatible = FutureIncompatibleInfo {
260+
reference: "issue #40107 <https://github.com/rust-lang/rust/issues/40107>",
261+
edition: None,
262+
};
263+
}
264+
255265
declare_lint! {
256266
pub LATE_BOUND_LIFETIME_ARGUMENTS,
257267
Warn,
@@ -574,6 +584,7 @@ declare_lint_pass! {
574584
UNALIGNED_REFERENCES,
575585
SAFE_PACKED_BORROWS,
576586
PATTERNS_IN_FNS_WITHOUT_BODY,
587+
MISSING_FRAGMENT_SPECIFIER,
577588
LATE_BOUND_LIFETIME_ARGUMENTS,
578589
ORDER_DEPENDENT_TRAIT_OBJECTS,
579590
COHERENCE_LEAK_CHECK,

0 commit comments

Comments
 (0)