Skip to content

Rollup of 7 pull requests #138974

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

Merged
merged 21 commits into from
Mar 26, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
6ccaea1
Target modifiers fix for bool flags without value
azhogin Mar 6, 2025
8cab8e0
Don't produce debug information for compiler-introduced-vars when des…
khuey Mar 22, 2025
848b0da
Remove fields that are dead since the removal of type ascription syntax
fmease Mar 23, 2025
6df2d58
Add function for linearizing `BuildStep` substeps
Kobzol Mar 25, 2025
82796dd
Brace-ident-colon can certainly no longer start a block
fmease Mar 23, 2025
9f336ce
Remove now unreachable parse recovery code
fmease Mar 23, 2025
598f865
Combine several test files into one
fmease Mar 24, 2025
b501e58
Incorporate issue-111692.rs into the larger test file and add more te…
fmease Mar 24, 2025
813783e
Add diff of bootstrap steps
Kobzol Mar 25, 2025
4b22ac5
Ensure define_opaque is accounted for in HIR hash
compiler-errors Mar 26, 2025
0c162b1
Revert "Make `MatchPairTree::place` non-optional"
meithecatte Mar 26, 2025
c8a5b36
MatchPairTree: update invariant comment
meithecatte Mar 26, 2025
1524060
Add a regression test for TestCase::Or without place
meithecatte Mar 26, 2025
a475f5d
Fix typo in error message
thaliaarchi Mar 16, 2025
7eb27a9
Rollup merge of #138483 - azhogin:azhogin/target-modifiers-bool-fix, …
Zalathar Mar 26, 2025
ff325e0
Rollup merge of #138818 - khuey:138198, r=jieyouxu
Zalathar Mar 26, 2025
30344f7
Rollup merge of #138898 - fmease:decrustify-parser-post-ty-ascr, r=co…
Zalathar Mar 26, 2025
2ae5d34
Rollup merge of #138930 - Kobzol:analyze-bootstrap-diffs, r=marcoieni
Zalathar Mar 26, 2025
19a53b7
Rollup merge of #138954 - compiler-errors:hash-opaques, r=oli-obk
Zalathar Mar 26, 2025
33c9023
Rollup merge of #138959 - meithecatte:matchpair-place-option, r=Zalathar
Zalathar Mar 26, 2025
46a40be
Rollup merge of #138967 - thaliaarchi:error-typo, r=Noratrieb
Zalathar Mar 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Ensure define_opaque is accounted for in HIR hash
  • Loading branch information
compiler-errors committed Mar 26, 2025
commit 4b22ac5296a7a40aebfc997eec122fbfe50164da
2 changes: 1 addition & 1 deletion compiler/rustc_ast_lowering/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {

// Don't hash unless necessary, because it's expensive.
let (opt_hash_including_bodies, attrs_hash) =
self.tcx.hash_owner_nodes(node, &bodies, &attrs);
self.tcx.hash_owner_nodes(node, &bodies, &attrs, define_opaque);
let num_nodes = self.item_local_id_counter.as_usize();
let (nodes, parenting) = index::index_hir(self.tcx, node, &bodies, num_nodes);
let nodes = hir::OwnerNodes { opt_hash_including_bodies, nodes, bodies };
Expand Down
7 changes: 6 additions & 1 deletion compiler/rustc_middle/src/hir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use rustc_hir::def::DefKind;
use rustc_hir::def_id::{DefId, LocalDefId, LocalModDefId};
use rustc_hir::*;
use rustc_macros::{Decodable, Encodable, HashStable};
use rustc_span::{ErrorGuaranteed, ExpnId};
use rustc_span::{ErrorGuaranteed, ExpnId, Span};

use crate::query::Providers;
use crate::ty::{EarlyBinder, ImplSubject, TyCtxt};
Expand Down Expand Up @@ -157,6 +157,7 @@ impl<'tcx> TyCtxt<'tcx> {
node: OwnerNode<'_>,
bodies: &SortedMap<ItemLocalId, &Body<'_>>,
attrs: &SortedMap<ItemLocalId, &[Attribute]>,
define_opaque: Option<&[(Span, LocalDefId)]>,
) -> (Option<Fingerprint>, Option<Fingerprint>) {
if self.needs_crate_hash() {
self.with_stable_hashing_context(|mut hcx| {
Expand All @@ -168,6 +169,10 @@ impl<'tcx> TyCtxt<'tcx> {

let mut stable_hasher = StableHasher::new();
attrs.hash_stable(&mut hcx, &mut stable_hasher);

// Hash the defined opaque types, which are not present in the attrs.
define_opaque.hash_stable(&mut hcx, &mut stable_hasher);

let h2 = stable_hasher.finish();
(Some(h1), Some(h2))
})
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_middle/src/ty/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,8 @@ impl<'tcx> TyCtxtFeed<'tcx, LocalDefId> {
let bodies = Default::default();
let attrs = hir::AttributeMap::EMPTY;

let (opt_hash_including_bodies, _) = self.tcx.hash_owner_nodes(node, &bodies, &attrs.map);
let (opt_hash_including_bodies, _) =
self.tcx.hash_owner_nodes(node, &bodies, &attrs.map, attrs.define_opaque);
let node = node.into();
self.opt_hir_owner_nodes(Some(self.tcx.arena.alloc(hir::OwnerNodes {
opt_hash_including_bodies,
Expand Down
19 changes: 19 additions & 0 deletions tests/incremental/define-opaques.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//@ revisions: rpass1 cfail2

#![feature(type_alias_impl_trait)]

pub type Foo = impl Sized;

#[cfg_attr(rpass1, define_opaque())]
#[cfg_attr(cfail2, define_opaque(Foo))]
fn a() {
//[cfail2]~^ ERROR item does not constrain `Foo::{opaque#0}`
let _: Foo = b();
}

#[define_opaque(Foo)]
fn b() -> Foo {
()
}

fn main() {}
Loading