Skip to content

Commit

Permalink
Temporarily make allow-by-default the non_local_definitions lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Urgau committed Mar 6, 2024
1 parent 1547c07 commit 6fc45b8
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 56 deletions.
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

0 comments on commit 6fc45b8

Please sign in to comment.