Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't forget that the lifetime on hir types is 'tcx #120100

Merged
merged 1 commit into from
Jan 21, 2024

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Jan 18, 2024

This PR just tracks the 'tcx lifetime to wherever the original objects actually have that lifetime. This code is needed for #107606 (now #120131) so that ast_ty_to_ty can invoke lit_to_const on an argument passed to it. Currently the argument is &hir::Ty<'_>, but after this PR it is &'tcx hir::Ty<'tcx>.

@rustbot
Copy link
Collaborator

rustbot commented Jan 18, 2024

r? @cjgillot

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 18, 2024
@rustbot
Copy link
Collaborator

rustbot commented Jan 18, 2024

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

Comment on lines 1354 to +1362
args.args = &args.args[..args.args.len() - 1];
path_segments[last_segment].args = Some(&args);
path_segments[last_segment].args = Some(tcx.hir_arena.alloc(args));
let path = hir::Path {
span: ast_trait_ref.path.span,
res: ast_trait_ref.path.res,
segments: &path_segments,
segments: tcx.hir_arena.alloc_slice(&path_segments),
};
let trait_ref = hir::TraitRef { path: &path, hir_ref_id: ast_trait_ref.hir_ref_id };
icx.astconv().instantiate_mono_trait_ref(&trait_ref, selfty)
let trait_ref = tcx.hir_arena.alloc(hir::TraitRef { path: tcx.hir_arena.alloc(path), hir_ref_id: ast_trait_ref.hir_ref_id });
icx.astconv().instantiate_mono_trait_ref(trait_ref, selfty)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an error code path, so allocating random things is not an issue

@BoxyUwU
Copy link
Member

BoxyUwU commented Jan 19, 2024

r? @BoxyUwU
@bors r+ rollup=never

@bors
Copy link
Contributor

bors commented Jan 19, 2024

📌 Commit e532b0d has been approved by BoxyUwU

It is now in the queue for this repository.

@rustbot rustbot assigned BoxyUwU and unassigned cjgillot Jan 19, 2024
@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 19, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 20, 2024
Don't forget that the lifetime on hir types is `'tcx`

This PR just tracks the `'tcx` lifetime to wherever the original objects actually have that lifetime. This code is needed for rust-lang#107606 (now rust-lang#120131) so that `ast_ty_to_ty` can invoke `lit_to_const` on an argument passed to it. Currently the argument is `&hir::Ty<'_>`, but after this PR it is `&'tcx hir::Ty<'tcx>`.
@bors
Copy link
Contributor

bors commented Jan 20, 2024

⌛ Testing commit e532b0d with merge 5a9f6fc...

@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
[RUSTC-TIMING] rustc_ty_utils test:false 32.448
[RUSTC-TIMING] rustc_lint test:false 65.020
[RUSTC-TIMING] rustc_trait_selection test:false 122.020
[RUSTC-TIMING] rustc_hir_analysis test:false 94.249
##[error]The runner has received a shutdown signal. This can happen when the runner service is stopped, or a manually started runner is canceled.
##[group]Clock drift check
##[group]Clock drift check
Session terminated, killing shell... ...killed.
##[error]The operation was canceled.
Cleaning up orphan processes

@bors
Copy link
Contributor

bors commented Jan 21, 2024

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 21, 2024
@Mark-Simulacrum
Copy link
Member

@bors retry runner shutdown

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 21, 2024
@bors
Copy link
Contributor

bors commented Jan 21, 2024

⌛ Testing commit e532b0d with merge 867d39c...

@bors
Copy link
Contributor

bors commented Jan 21, 2024

☀️ Test successful - checks-actions
Approved by: BoxyUwU
Pushing 867d39c to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 21, 2024
@bors bors merged commit 867d39c into rust-lang:master Jan 21, 2024
12 checks passed
@rustbot rustbot added this to the 1.77.0 milestone Jan 21, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (867d39c): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.8% [-1.8%, -1.8%] 1
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.4% [-2.4%, -2.4%] 1
All ❌✅ (primary) - - 0

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 661.791s -> 662.887s (0.17%)
Artifact size: 308.38 MiB -> 308.36 MiB (-0.01%)

@oli-obk oli-obk deleted the astconv_lifetimes branch January 21, 2024 11:01
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jan 25, 2024
Don't forget that the lifetime on hir types is `'tcx`

This PR just tracks the `'tcx` lifetime to wherever the original objects actually have that lifetime. This code is needed for rust-lang#107606 (now rust-lang#120131) so that `ast_ty_to_ty` can invoke `lit_to_const` on an argument passed to it. Currently the argument is `&hir::Ty<'_>`, but after this PR it is `&'tcx hir::Ty<'tcx>`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants