Skip to content

Commit

Permalink
Rollup merge of rust-lang#122107 - Urgau:non_local_def-allow, r=Waffl…
Browse files Browse the repository at this point in the history
…eLapkin

Temporarily make allow-by-default the `non_local_definitions` lint

T-lang [decided in their triage meeting](https://hackmd.io/U-CKiZx_RKiaANAPXtWf7g#non_local_definitions-common-issues-impl-for-ampLocal-FromltLocalgt-for-Global-%E2%80%A6-rust121621) to try to use a [better logic](rust-lang#121621 (comment)) for detecting non-local `impl` definitions given the [numerous reports](rust-lang#121621) we got.

Until that is done and also because the beta cut is next week, switch the lint to allow-by-default until it's implemented.

r? `@WaffleLapkin`
  • Loading branch information
matthiaskrgr authored Mar 6, 2024
2 parents 814077e + 6fc45b8 commit 1d4360a
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 1d4360a

Please sign in to comment.