forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#129627 - dingxiangfei2009:ensure-tail-expr-…
…in-let-block-works, r=jieyouxu Ensure that tail expr receive lifetime extension cc `@jieyouxu` `@traviscross` It just came to me that we should add a test to make sure that we honor the contract from the temporary lifetime rule rust-lang#121346. We should continue to implement this rule in Edition 2021 onward and shorter tail expression lifetime should not override it. This is a small PR to improve our assurance and establish a stronger contract. Tracked by rust-lang#123739
- Loading branch information
Showing
3 changed files
with
21 additions
and
6 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
tests/ui/lifetimes/temporary-lifetime-extension.edition2021.run.stdout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
("Hello", 1) [(("Hello", 1),)] "Hello" "Hello" "Hello" ("Hello", 1) ("Hello", 1) ("Hello", 1) |
1 change: 1 addition & 0 deletions
1
tests/ui/lifetimes/temporary-lifetime-extension.edition2024.run.stdout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
("Hello", 1) [(("Hello", 1),)] "Hello" "Hello" "Hello" ("Hello", 1) ("Hello", 1) ("Hello", 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters