Uh oh!
There was an error while loading. Please reload this page.
Stabilize shorter-tail-lifetimes - #131983
Conversation
rustbot
commented
Oct 20, 2024
dingxiangfei2009
commented
Oct 20, 2024
@rustbot labels +A-edition-2024 |
| /// ### Example | ||
| /// ```rust,edition2024 | ||
| /// #![feature(shorter_tail_lifetimes)] | ||
| /// ```rust,edition2021 |
There was a problem hiding this comment.
existing, but "The tail_expr_drop_order lint looks for those values generated at the tail expression location, that of type with a significant Drop implementation, such as locks." seems wrong to me.
/// The `tail_expr_drop_order` lint looks for those values generated at the tail expression location,/// whose type has a significant `Drop` implementation, such as locks.There was a problem hiding this comment.
I have tweaked the wording for clarity
lcnr
left a comment
There was a problem hiding this comment.
you're also flipping the editions for which the lint fires from only linting in edition 2024+ to instead only lint in older editions.
Linting in editions <2024 seems correct to me, as the lint is supposed to warn of changes to drop order when switching to edition 2024. Do I understand this correctly?
| fn check_block_inner(&mut self, block: &Block<'tcx>) { | ||
| if !block.span.at_least_rust_2024() { | ||
| if block.span.at_least_rust_2024() { | ||
| // We only lint for Edition 2024 onwards |
| @@ -1,15 +1,8 @@ | |||
| // This test ensures that `tail_expr_drop_order` does not activate in case Edition 2024 is not used | |||
| // or the feature gate `shorter_tail_lifetimes` is disabled. | |||
There was a problem hiding this comment.
given that you're removing the reasoning behind this test, shouldn't the whole test be removed entirely? alternatively keep this comment
lcnr
left a comment
There was a problem hiding this comment.
some nits, then r=me cc @nikomatsakis
27b60a8 to
d51b702Comparedingxiangfei2009
commented
Oct 21, 2024
Yes, it was not corrected even after learning that we should fire the lint for code targeting Edition 2021 and before. It fell through the crack somehow. Let me check the comments again to see if there is any outdated wording. |
| /// Allows `Self` struct constructor (RFC 2302). | ||
| (accepted, self_struct_ctor, "1.32.0", Some(51994)), | ||
| /// Shortern the tail expression lifetime | ||
| (accepted, shorter_tail_lifetimes, "1.79.0", Some(123739)), |
There was a problem hiding this comment.
I think this should be CURRENT_RUSTC_VERSION, correct?
Uh oh!
There was an error while loading. Please reload this page.
lcnr
commented
Oct 23, 2024
@bors r+ rollup |
bors
commented
Oct 23, 2024
…-tail-lifetimes, r=lcnr Stabilize shorter-tail-lifetimes Closerust-lang#131445 Tracked by rust-lang#123739 We found a test case `tests/ui/drop/drop_order.rs` that had not been covered by the change. The test fixture is fixed now with the correct expectation.
bors
commented
Oct 23, 2024
☔ The latest upstream changes (presumably #132027) made this pull request unmergeable. Please resolve the merge conflicts. |
43803df to
0689b21Comparedingxiangfei2009
commented
Oct 23, 2024
lcnr
commented
Oct 24, 2024
@bors r+ |
bors
commented
Oct 24, 2024
…iaskrgr Rollup of 4 pull requests Successful merges: - rust-lang#131790 (Document textual format of SocketAddrV{4,6}) - rust-lang#131983 (Stabilize shorter-tail-lifetimes) - rust-lang#132097 (sanitizer.md: LeakSanitizer is not supported on aarch64 macOS) - rust-lang#132107 (Remove visit_expr_post from ast Visitor) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#131983 - dingxiangfei2009:stabilize-shorter-tail-lifetimes, r=lcnr Stabilize shorter-tail-lifetimes Closerust-lang#131445 Tracked by rust-lang#123739 We found a test case `tests/ui/drop/drop_order.rs` that had not been covered by the change. The test fixture is fixed now with the correct expectation.
Close#131445
Tracked by #123739
We found a test case
tests/ui/drop/drop_order.rsthat had not been covered by the change. The test fixture is fixed now with the correct expectation.