Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion compiler/rustc_lint/src/non_local_def.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ declare_lint! {
/// ### Example
///
/// ```rust
/// #![warn(non_local_definitions)]
/// trait MyTrait {}
/// struct MyStruct;
///
Expand All @@ -36,7 +37,7 @@ declare_lint! {
/// All nested bodies (functions, enum discriminant, array length, consts) (expect for
/// `const _: Ty = { ... }` in top-level module, which is still undecided) are checked.
pub NON_LOCAL_DEFINITIONS,
Warn,
Allow,
"checks for non-local definitions",
report_in_external_macro
}
Expand Down
1 change: 1 addition & 0 deletions tests/ui/lint/non_local_definitions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//@ rustc-env:CARGO=/usr/bin/cargo

#![feature(inline_const)]
#![warn(non_local_definitions)]

extern crate non_local_macro;

Expand Down
Loading