Skip to content

Commit df71a99

Browse files
committed
Rename lint
1 parent bbfb857 commit df71a99

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

compiler/rustc_lint/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ fn register_builtins(store: &mut LintStore, no_interleave_lints: bool) {
325325
store.register_renamed("redundant_semicolon", "redundant_semicolons");
326326
store.register_renamed("overlapping_patterns", "overlapping_range_endpoints");
327327
store.register_renamed("safe_packed_borrows", "unaligned_references");
328+
store.register_renamed("disjoint_capture_migration", "rust_2021_incompatible_closure_captures");
328329

329330
// These were moved to tool lints, but rustc still sees them when compiling normally, before
330331
// tool lints are registered, so `check_tool_name_for_backwards_compat` doesn't work. Use
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// check-pass
2+
3+
// Ensure that the old name for `rust_2021_incompatible_closure_captures` is still
4+
// accepted by the compiler
5+
6+
#![allow(disjoint_capture_migration)]
7+
//~^ WARN lint `disjoint_capture_migration` has been renamed
8+
9+
fn main() {}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
warning: lint `disjoint_capture_migration` has been renamed to `rust_2021_incompatible_closure_captures`
2+
--> $DIR/old_name.rs:6:10
3+
|
4+
LL | #![allow(disjoint_capture_migration)]
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `rust_2021_incompatible_closure_captures`
6+
|
7+
= note: `#[warn(renamed_and_removed_lints)]` on by default
8+
9+
warning: 1 warning emitted
10+

0 commit comments

Comments
 (0)