Skip to content
/ rust Public
forked from rust-lang/rust

Commit

Permalink
Rollup merge of rust-lang#134368 - ehuss:edition-links, r=jieyouxu
Browse files Browse the repository at this point in the history
Use links to edition guide for edition migrations

This switches the migration lints for the 2024 edition to point to the edition guide documentation instead of the tracking issues. I expect the documentation should be easier to understand for a user, compared to most of the issues which don't have any direct information, and can be a bit confusing to navigate, or have outdated information.
  • Loading branch information
jhpratt authored Dec 17, 2024
2 parents cc5392a + 3e80697 commit c1a739a
Show file tree
Hide file tree
Showing 42 changed files with 200 additions and 190 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1814,7 +1814,7 @@ declare_lint! {
"detects edition keywords being used as an identifier",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::EditionError(Edition::Edition2024),
reference: "issue #49716 <https://github.com/rust-lang/rust/issues/49716>",
reference: "<https://doc.rust-lang.org/nightly/edition-guide/rust-2024/gen-keyword.html>",
};
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/if_let_rescope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ declare_lint! {
rewriting in `match` is an option to preserve the semantics up to Edition 2021",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::EditionSemanticsChange(Edition::Edition2024),
reference: "issue #124085 <https://github.com/rust-lang/rust/issues/124085>",
reference: "<https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-if-let-scope.html>",
};
}

Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_lint/src/shadowed_into_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ declare_lint! {
"detects calling `into_iter` on boxed slices in Rust 2015, 2018, and 2021",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::EditionSemanticsChange(Edition::Edition2024),
reference: "<https://doc.rust-lang.org/nightly/edition-guide/rust-2024/intoiterator-box-slice.html>"
};
}

Expand Down
18 changes: 9 additions & 9 deletions compiler/rustc_lint_defs/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1677,7 +1677,7 @@ declare_lint! {
"detects patterns whose meaning will change in Rust 2024",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::EditionSemanticsChange(Edition::Edition2024),
reference: "123076",
reference: "<https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>",
};
}

Expand Down Expand Up @@ -2606,7 +2606,7 @@ declare_lint! {
"unsafe operations in unsafe functions without an explicit unsafe block are deprecated",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::EditionSemanticsChange(Edition::Edition2024),
reference: "issue #71668 <https://github.com/rust-lang/rust/issues/71668>",
reference: "<https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html>",
explain_reason: false
};
@edition Edition2024 => Warn;
Expand Down Expand Up @@ -4189,7 +4189,7 @@ declare_lint! {
"never type fallback affecting unsafe function calls",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::EditionAndFutureReleaseSemanticsChange(Edition::Edition2024),
reference: "issue #123748 <https://github.com/rust-lang/rust/issues/123748>",
reference: "<https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html>",
};
@edition Edition2024 => Deny;
report_in_external_macro
Expand Down Expand Up @@ -4243,7 +4243,7 @@ declare_lint! {
"never type fallback affecting unsafe function calls",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::EditionAndFutureReleaseError(Edition::Edition2024),
reference: "issue #123748 <https://github.com/rust-lang/rust/issues/123748>",
reference: "<https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html>",
};
report_in_external_macro
}
Expand Down Expand Up @@ -4790,7 +4790,7 @@ declare_lint! {
"detects unsafe functions being used as safe functions",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::EditionError(Edition::Edition2024),
reference: "issue #27970 <https://github.com/rust-lang/rust/issues/27970>",
reference: "<https://doc.rust-lang.org/nightly/edition-guide/rust-2024/newly-unsafe-functions.html>",
};
}

Expand Down Expand Up @@ -4826,7 +4826,7 @@ declare_lint! {
"detects missing unsafe keyword on extern declarations",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::EditionError(Edition::Edition2024),
reference: "issue #123743 <https://github.com/rust-lang/rust/issues/123743>",
reference: "<https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-extern.html>",
};
}

Expand Down Expand Up @@ -4867,7 +4867,7 @@ declare_lint! {
"detects unsafe attributes outside of unsafe",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::EditionError(Edition::Edition2024),
reference: "issue #123757 <https://github.com/rust-lang/rust/issues/123757>",
reference: "<https://doc.rust-lang.org/nightly/edition-guide/rust-2024/unsafe-attributes.html>",
};
}

Expand Down Expand Up @@ -5069,7 +5069,7 @@ declare_lint! {
"Detect and warn on significant change in drop order in tail expression location",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::EditionSemanticsChange(Edition::Edition2024),
reference: "issue #123739 <https://github.com/rust-lang/rust/issues/123739>",
reference: "<https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-tail-expr-scope.html>",
};
}

Expand Down Expand Up @@ -5108,7 +5108,7 @@ declare_lint! {
"will be parsed as a guarded string in Rust 2024",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::EditionError(Edition::Edition2024),
reference: "issue #123735 <https://github.com/rust-lang/rust/issues/123735>",
reference: "<https://doc.rust-lang.org/nightly/edition-guide/rust-2024/reserved-syntax.html>",
};
crate_level_only
}
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/drop/lint-if-let-rescope-gated.edition2021.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LL | if let Some(_value) = Droppy.get() {
| this value has a significant drop implementation which may observe a major change in drop order and requires your discretion
|
= warning: this changes meaning in Rust 2024
= note: for more information, see issue #124085 <https://github.com/rust-lang/rust/issues/124085>
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-if-let-scope.html>
help: the value is now dropped here in Edition 2024
--> $DIR/lint-if-let-rescope-gated.rs:30:5
|
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/drop/lint-if-let-rescope-with-macro.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ LL | | };
| |_____- in this macro invocation
|
= warning: this changes meaning in Rust 2024
= note: for more information, see issue #124085 <https://github.com/rust-lang/rust/issues/124085>
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-if-let-scope.html>
help: the value is now dropped here in Edition 2024
--> $DIR/lint-if-let-rescope-with-macro.rs:12:38
|
Expand Down
14 changes: 7 additions & 7 deletions tests/ui/drop/lint-if-let-rescope.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LL | if let Some(_value) = droppy().get() {
| this value has a significant drop implementation which may observe a major change in drop order and requires your discretion
|
= warning: this changes meaning in Rust 2024
= note: for more information, see issue #124085 <https://github.com/rust-lang/rust/issues/124085>
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-if-let-scope.html>
help: the value is now dropped here in Edition 2024
--> $DIR/lint-if-let-rescope.rs:32:5
|
Expand Down Expand Up @@ -42,7 +42,7 @@ LL | } else if let Some(_value) = droppy().get() {
| -------- this value has a significant drop implementation which may observe a major change in drop order and requires your discretion
|
= warning: this changes meaning in Rust 2024
= note: for more information, see issue #124085 <https://github.com/rust-lang/rust/issues/124085>
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-if-let-scope.html>
help: the value is now dropped here in Edition 2024
--> $DIR/lint-if-let-rescope.rs:42:5
|
Expand Down Expand Up @@ -74,7 +74,7 @@ LL | } else if let Some(_value) = droppy().get() {
| this value has a significant drop implementation which may observe a major change in drop order and requires your discretion
|
= warning: this changes meaning in Rust 2024
= note: for more information, see issue #124085 <https://github.com/rust-lang/rust/issues/124085>
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-if-let-scope.html>
help: the value is now dropped here in Edition 2024
--> $DIR/lint-if-let-rescope.rs:54:5
|
Expand All @@ -100,7 +100,7 @@ LL | if let Some(1) = { if let Some(_value) = Droppy.get() { Some(1) } else
| this value has a significant drop implementation which may observe a major change in drop order and requires your discretion
|
= warning: this changes meaning in Rust 2024
= note: for more information, see issue #124085 <https://github.com/rust-lang/rust/issues/124085>
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-if-let-scope.html>
help: the value is now dropped here in Edition 2024
--> $DIR/lint-if-let-rescope.rs:58:69
|
Expand All @@ -120,7 +120,7 @@ LL | if (if let Some(_value) = droppy().get() { true } else { false }) {
| this value has a significant drop implementation which may observe a major change in drop order and requires your discretion
|
= warning: this changes meaning in Rust 2024
= note: for more information, see issue #124085 <https://github.com/rust-lang/rust/issues/124085>
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-if-let-scope.html>
help: the value is now dropped here in Edition 2024
--> $DIR/lint-if-let-rescope.rs:72:53
|
Expand All @@ -140,7 +140,7 @@ LL | } else if (((if let Some(_value) = droppy().get() { true } else { false
| this value has a significant drop implementation which may observe a major change in drop order and requires your discretion
|
= warning: this changes meaning in Rust 2024
= note: for more information, see issue #124085 <https://github.com/rust-lang/rust/issues/124085>
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-if-let-scope.html>
help: the value is now dropped here in Edition 2024
--> $DIR/lint-if-let-rescope.rs:78:62
|
Expand All @@ -160,7 +160,7 @@ LL | while (if let Some(_value) = droppy().get() { false } else { true }) {
| this value has a significant drop implementation which may observe a major change in drop order and requires your discretion
|
= warning: this changes meaning in Rust 2024
= note: for more information, see issue #124085 <https://github.com/rust-lang/rust/issues/124085>
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-if-let-scope.html>
help: the value is now dropped here in Edition 2024
--> $DIR/lint-if-let-rescope.rs:90:57
|
Expand Down
16 changes: 8 additions & 8 deletions tests/ui/drop/lint-tail-expr-drop-order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fn should_lint() -> i32 {
//~| NOTE: up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024
//~| WARN: this changes meaning in Rust 2024
//~| NOTE: most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects
//~| NOTE: for more information, see issue #123739
//~| NOTE: for more information, see
}
//~^ NOTE: now the temporary value is dropped here, before the local variables in the block or statement

Expand All @@ -70,7 +70,7 @@ fn should_lint_in_nested_items() {
//~| NOTE: up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024
//~| WARN: this changes meaning in Rust 2024
//~| NOTE: most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects
//~| NOTE: for more information, see issue #123739
//~| NOTE: for more information, see
}
//~^ NOTE: now the temporary value is dropped here, before the local variables in the block or statement
}
Expand All @@ -97,7 +97,7 @@ fn should_lint_in_nested_block() -> i32 {
//~| NOTE: up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024
//~| WARN: this changes meaning in Rust 2024
//~| NOTE: most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects
//~| NOTE: for more information, see issue #123739
//~| NOTE: for more information, see
}
//~^ NOTE: now the temporary value is dropped here, before the local variables in the block or statement

Expand Down Expand Up @@ -150,7 +150,7 @@ fn should_lint_into_async_body() -> i32 {
//~| NOTE: this value will be stored in a temporary; let us call it `#1`
//~| NOTE: up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024
//~| NOTE: most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects
//~| NOTE: for more information, see issue #123739
//~| NOTE: for more information, see
}
//~^ NOTE: now the temporary value is dropped here, before the local variables in the block or statement

Expand All @@ -167,7 +167,7 @@ fn should_lint_generics<T: Default>() -> &'static str {
//~| NOTE: this value will be stored in a temporary; let us call it `#1`
//~| NOTE: up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024
//~| NOTE: most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects
//~| NOTE: for more information, see issue #123739
//~| NOTE: for more information, see
}
//~^ NOTE: now the temporary value is dropped here, before the local variables in the block or statement

Expand All @@ -181,7 +181,7 @@ fn should_lint_adt() -> i32 {
//~| NOTE: this value will be stored in a temporary; let us call it `#1`
//~| NOTE: up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024
//~| NOTE: most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects
//~| NOTE: for more information, see issue #123739
//~| NOTE: for more information, see
}
//~^ NOTE: now the temporary value is dropped here, before the local variables in the block or statement

Expand Down Expand Up @@ -225,7 +225,7 @@ fn should_lint_with_dtor_span() -> i32 {
//~| NOTE: up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024
//~| WARN: this changes meaning in Rust 2024
//~| NOTE: most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects
//~| NOTE: for more information, see issue #123739
//~| NOTE: for more information, see
}
//~^ NOTE: now the temporary value is dropped here, before the local variables in the block or statement

Expand All @@ -238,7 +238,7 @@ fn should_lint_with_transient_drops() {
//~| NOTE: up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024
//~| WARN: this changes meaning in Rust 2024
//~| NOTE: most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects
//~| NOTE: for more information, see issue #123739
//~| NOTE: for more information, see
},
{
let _x = LoudDropper;
Expand Down
16 changes: 8 additions & 8 deletions tests/ui/drop/lint-tail-expr-drop-order.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ LL | }
| - now the temporary value is dropped here, before the local variables in the block or statement
|
= warning: this changes meaning in Rust 2024
= note: for more information, see issue #123739 <https://github.com/rust-lang/rust/issues/123739>
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-tail-expr-scope.html>
note: `#1` invokes this custom destructor
--> $DIR/lint-tail-expr-drop-order.rs:11:1
|
Expand Down Expand Up @@ -58,7 +58,7 @@ LL | }
| - now the temporary value is dropped here, before the local variables in the block or statement
|
= warning: this changes meaning in Rust 2024
= note: for more information, see issue #123739 <https://github.com/rust-lang/rust/issues/123739>
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-tail-expr-scope.html>
note: `#1` invokes this custom destructor
--> $DIR/lint-tail-expr-drop-order.rs:11:1
|
Expand Down Expand Up @@ -94,7 +94,7 @@ LL | }
| - now the temporary value is dropped here, before the local variables in the block or statement
|
= warning: this changes meaning in Rust 2024
= note: for more information, see issue #123739 <https://github.com/rust-lang/rust/issues/123739>
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-tail-expr-scope.html>
note: `#1` invokes this custom destructor
--> $DIR/lint-tail-expr-drop-order.rs:11:1
|
Expand Down Expand Up @@ -130,7 +130,7 @@ LL | }
| - now the temporary value is dropped here, before the local variables in the block or statement
|
= warning: this changes meaning in Rust 2024
= note: for more information, see issue #123739 <https://github.com/rust-lang/rust/issues/123739>
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-tail-expr-scope.html>
note: `#1` invokes this custom destructor
--> $DIR/lint-tail-expr-drop-order.rs:11:1
|
Expand Down Expand Up @@ -166,7 +166,7 @@ LL | }
| - now the temporary value is dropped here, before the local variables in the block or statement
|
= warning: this changes meaning in Rust 2024
= note: for more information, see issue #123739 <https://github.com/rust-lang/rust/issues/123739>
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-tail-expr-scope.html>
= note: most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects like releasing locks or sending messages

error: relative drop order changing in Rust 2024
Expand All @@ -188,7 +188,7 @@ LL | }
| - now the temporary value is dropped here, before the local variables in the block or statement
|
= warning: this changes meaning in Rust 2024
= note: for more information, see issue #123739 <https://github.com/rust-lang/rust/issues/123739>
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-tail-expr-scope.html>
note: `#1` invokes this custom destructor
--> $DIR/lint-tail-expr-drop-order.rs:11:1
|
Expand Down Expand Up @@ -224,7 +224,7 @@ LL | }
| - now the temporary value is dropped here, before the local variables in the block or statement
|
= warning: this changes meaning in Rust 2024
= note: for more information, see issue #123739 <https://github.com/rust-lang/rust/issues/123739>
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-tail-expr-scope.html>
note: `#1` invokes this custom destructor
--> $DIR/lint-tail-expr-drop-order.rs:195:5
|
Expand Down Expand Up @@ -266,7 +266,7 @@ LL | ));
| - now the temporary value is dropped here, before the local variables in the block or statement
|
= warning: this changes meaning in Rust 2024
= note: for more information, see issue #123739 <https://github.com/rust-lang/rust/issues/123739>
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/temporary-tail-expr-scope.html>
note: `#1` invokes this custom destructor
--> $DIR/lint-tail-expr-drop-order.rs:11:1
|
Expand Down
Loading

0 comments on commit c1a739a

Please sign in to comment.