hir_typeck: Don't ICE on closures without drop location in closure capture lint - #161548
Conversation
|
r? @Enselic rustbot has assigned @Enselic. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
Reminder, once the PR becomes ready for a review, use |
d1439d4 to
21060d4
Compare
|
@rustbot ready |
This comment has been minimized.
This comment has been minimized.
21060d4 to
5280e63
Compare
|
This PR changes a file inside |
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
5280e63 to
623f6f7
Compare
|
@rustbot ready |
623f6f7 to
158a310
Compare
|
@rustbot ready |
158a310 to
20cbc85
Compare
…pture lint `drop_location_span` assumed that every closure had a valid drop location, which could cause an ICE for closures in unsupported contexts. This changes `drop_location_span` to return `Option<Span>`. If there is no valid drop location, the migration lint is not emitted because its drop-order diagnostic would be misleading. The span is computed before creating `MigrationLint` and stored there so it can be reused for the drop-order labels.
20cbc85 to
1699fba
Compare
|
@rustbot ready |
…e, r=Enselic hir_typeck: Don't ICE on closures without drop location in closure capture lint Resolves rust-lang#156288. `drop_location_span` assumed that every closure had a valid drop location, which could cause an ICE for closures in unsupported contexts. This changes `drop_location_span` to return `Option<Span>`. If there is no valid drop location, the migration lint is not emitted because its drop-order diagnostic would be misleading. The span is computed before creating `MigrationLint` and stored there so it can be reused for the drop-order labels.
Rollup of 10 pull requests Successful merges: - #160911 (Remove d32 feature from 32-bit Arm targets) - #162771 (Filter do_not_recommend impls before handling a single candidate) - #162779 (rustdoc: Revert "fix bare urls split text") - #161548 (hir_typeck: Don't ICE on closures without drop location in closure capture lint) - #161612 (std: make a lot of items crate private) - #162204 (Suggest keyword order for `extern "C" const unsafe fn`) - #162372 (Clean up `test/rustdoc-html` folder by moving tests where appropriate) - #162638 (dont suggest changing the mutability of a borrow that comes from a macro) - #162643 (Fix `path_trailing_sep` methods for Windows verbatim paths) - #162784 (AGENTS.md: Permit local experimentation, per the online policy.)
Rollup of 10 pull requests Successful merges: - #160911 (Remove d32 feature from 32-bit Arm targets) - #162771 (Filter do_not_recommend impls before handling a single candidate) - #162779 (rustdoc: Revert "fix bare urls split text") - #161548 (hir_typeck: Don't ICE on closures without drop location in closure capture lint) - #161612 (std: make a lot of items crate private) - #162204 (Suggest keyword order for `extern "C" const unsafe fn`) - #162372 (Clean up `test/rustdoc-html` folder by moving tests where appropriate) - #162638 (dont suggest changing the mutability of a borrow that comes from a macro) - #162643 (Fix `path_trailing_sep` methods for Windows verbatim paths) - #162784 (AGENTS.md: Permit local experimentation, per the online policy.)
…uwer Rollup of 12 pull requests Successful merges: - #160911 (Remove d32 feature from 32-bit Arm targets) - #161868 (libtest: never iterate over all tests in `--exact` mode) - #162771 (Filter do_not_recommend impls before handling a single candidate) - #162779 (rustdoc: Revert "fix bare urls split text") - #161548 (hir_typeck: Don't ICE on closures without drop location in closure capture lint) - #161612 (std: make a lot of items crate private) - #162204 (Suggest keyword order for `extern "C" const unsafe fn`) - #162372 (Clean up `test/rustdoc-html` folder by moving tests where appropriate) - #162638 (dont suggest changing the mutability of a borrow that comes from a macro) - #162643 (Fix `path_trailing_sep` methods for Windows verbatim paths) - #162654 (Improve Armv7-R documentation) - #162784 (AGENTS.md: Permit local experimentation, per the online policy.)
Rollup merge of #161548 - malezjaa:fix-drop-location-span-ice, r=Enselic hir_typeck: Don't ICE on closures without drop location in closure capture lint Resolves #156288. `drop_location_span` assumed that every closure had a valid drop location, which could cause an ICE for closures in unsupported contexts. This changes `drop_location_span` to return `Option<Span>`. If there is no valid drop location, the migration lint is not emitted because its drop-order diagnostic would be misleading. The span is computed before creating `MigrationLint` and stored there so it can be reused for the drop-order labels.
…uwer Rollup of 12 pull requests Successful merges: - rust-lang/rust#160911 (Remove d32 feature from 32-bit Arm targets) - rust-lang/rust#161868 (libtest: never iterate over all tests in `--exact` mode) - rust-lang/rust#162771 (Filter do_not_recommend impls before handling a single candidate) - rust-lang/rust#162779 (rustdoc: Revert "fix bare urls split text") - rust-lang/rust#161548 (hir_typeck: Don't ICE on closures without drop location in closure capture lint) - rust-lang/rust#161612 (std: make a lot of items crate private) - rust-lang/rust#162204 (Suggest keyword order for `extern "C" const unsafe fn`) - rust-lang/rust#162372 (Clean up `test/rustdoc-html` folder by moving tests where appropriate) - rust-lang/rust#162638 (dont suggest changing the mutability of a borrow that comes from a macro) - rust-lang/rust#162643 (Fix `path_trailing_sep` methods for Windows verbatim paths) - rust-lang/rust#162654 (Improve Armv7-R documentation) - rust-lang/rust#162784 (AGENTS.md: Permit local experimentation, per the online policy.)
View all comments
Resolves #156288.
drop_location_spanassumed that every closure had a valid drop location, which could cause an ICE for closures in unsupported contexts. This changesdrop_location_spanto returnOption<Span>. If there is no valid drop location, the migration lint is not emitted because its drop-order diagnostic would be misleading. The span is computed before creatingMigrationLintand stored there so it can be reused for the drop-order labels.