Skip to content

Commit 1d4360a

Browse files
authored
Rollup merge of #122107 - Urgau:non_local_def-allow, r=WaffleLapkin
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](#121621 (comment)) for detecting non-local `impl` definitions given the [numerous reports](#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`
2 parents 814077e + 6fc45b8 commit 1d4360a

6 files changed

+68
-56
lines changed

compiler/rustc_lint/src/non_local_def.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ declare_lint! {
1414
/// ### Example
1515
///
1616
/// ```rust
17+
/// #![warn(non_local_definitions)]
1718
/// trait MyTrait {}
1819
/// struct MyStruct;
1920
///
@@ -36,7 +37,7 @@ declare_lint! {
3637
/// All nested bodies (functions, enum discriminant, array length, consts) (expect for
3738
/// `const _: Ty = { ... }` in top-level module, which is still undecided) are checked.
3839
pub NON_LOCAL_DEFINITIONS,
39-
Warn,
40+
Allow,
4041
"checks for non-local definitions",
4142
report_in_external_macro
4243
}

tests/ui/lint/non_local_definitions.rs

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
//@ rustc-env:CARGO=/usr/bin/cargo
55

66
#![feature(inline_const)]
7+
#![warn(non_local_definitions)]
78

89
extern crate non_local_macro;
910

0 commit comments

Comments
 (0)