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

Add a way to decouple the implementation and the declaration of a TyCtxt method. #116052

Merged
merged 4 commits into from
Sep 23, 2023

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Sep 22, 2023

properly addresses #115819

accepted MCP: rust-lang/compiler-team#395

@rustbot
Copy link
Collaborator

rustbot commented Sep 22, 2023

r? @WaffleLapkin

(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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Sep 22, 2023
@rustbot
Copy link
Collaborator

rustbot commented Sep 22, 2023

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

Some changes occurred in compiler/rustc_codegen_gcc

cc @antoyo

Copy link
Member

@WaffleLapkin WaffleLapkin left a comment

Choose a reason for hiding this comment

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

r=me, modulo the nit which I'm not sure makes sense
@rustbot author

src/librustdoc/core.rs Outdated Show resolved Hide resolved
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 22, 2023
@rustbot
Copy link
Collaborator

rustbot commented Sep 22, 2023

The Miri subtree was changed

cc @rust-lang/miri

@rust-log-analyzer

This comment has been minimized.

Copy link
Member

@WaffleLapkin WaffleLapkin left a comment

Choose a reason for hiding this comment

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

r=me with the CI failure fixed

@oli-obk
Copy link
Contributor Author

oli-obk commented Sep 22, 2023

@bors r=WaffleLapkin

@bors
Copy link
Contributor

bors commented Sep 22, 2023

📌 Commit 4ed4913 has been approved by WaffleLapkin

It is now in the queue for this repository.

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 22, 2023
@bors
Copy link
Contributor

bors commented Sep 23, 2023

⌛ Testing commit 4ed4913 with merge bf98263...

use crate::ty::{Ty, TyCtxt};
use rustc_span::DUMMY_SP;

macro_rules! declare_hooks {
Copy link
Member

Choose a reason for hiding this comment

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

Would be good to have some docs in this file that explain hat a "hook" is and how it differs from a "query".

/// Tries to destructure an `mir::Const` ADT or array into its variant index
/// and its field values. This should only be used for pretty printing.
query try_destructure_mir_constant_for_diagnostics(
key: (mir::ConstValue<'tcx>, Ty<'tcx>)
Copy link
Member

Choose a reason for hiding this comment

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

So can we now remove the faulty StableHash implementation(s) that were previously needed to make this work as a query?

Copy link
Member

Choose a reason for hiding this comment

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

What "faulty StableHash implementationt(s)" are you thinking about?

Copy link
Member

@RalfJung RalfJung Oct 2, 2023

Choose a reason for hiding this comment

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

I'm quoting things @oli-obk said (potentially quoting them incorrectly), I don't actually understand the underlying issue here. Also see Zulip.

Copy link
Member

Choose a reason for hiding this comment

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

Read the zulip, still don't get it 👍🏻

Also the "hash eq implies eq" is very scary...

@bors
Copy link
Contributor

bors commented Sep 23, 2023

☀️ Test successful - checks-actions
Approved by: WaffleLapkin
Pushing bf98263 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 23, 2023
@bors bors merged commit bf98263 into rust-lang:master Sep 23, 2023
12 checks passed
@rustbot rustbot added this to the 1.74.0 milestone Sep 23, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (bf98263): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

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

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)
1.6% [1.6%, 1.6%] 1
Regressions ❌
(secondary)
2.7% [1.8%, 3.5%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.6% [1.6%, 1.6%] 1

Cycles

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)
3.9% [3.3%, 4.9%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 632.772s -> 635.361s (0.41%)
Artifact size: 317.54 MiB -> 317.70 MiB (0.05%)

flip1995 pushed a commit to flip1995/rust that referenced this pull request Sep 25, 2023
…affleLapkin

Add a way to decouple the implementation and the declaration of a TyCtxt method.

properly addresses rust-lang#115819

accepted MCP: rust-lang/compiler-team#395
@oli-obk oli-obk deleted the ceci_nest_pas_une_query branch September 25, 2023 19:34
@oli-obk oli-obk added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Sep 25, 2023
@oli-obk
Copy link
Contributor Author

oli-obk commented Sep 25, 2023

We need to either backport this PR or just apply #115819 to beta without applying it to master

@apiraino
Copy link
Contributor

backport declined in favor of #115819 as per compiler team on Zulip

@rustbot label -beta-nominated

@rustbot rustbot removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Sep 28, 2023
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. T-rustdoc Relevant to the rustdoc 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