Skip to content

Commit 78450d2

Browse files
committed
Auto merge of #93891 - matthiaskrgr:rollup-xadut8w, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - #92242 (Erase regions before calculating layout for packed field capture) - #93443 (Add comment on stable_hash_impl for OwnerNodes) - #93742 (Drop rustc-docs from complete profile) - #93852 (rustdoc: remove support for multi-query search) - #93853 (Make all `hir::Map` methods consistently by-value) - #93861 (Fix ICE if no trait assoc const eq) - #93862 (Split x86_64-apple builder into two) - #93864 (Remove ArchiveBuilder::update_symbols) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents e273fca + c543f7d commit 78450d2

File tree

23 files changed

+226
-256
lines changed

23 files changed

+226
-256
lines changed

.github/workflows/ci.yml

+13-2
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,20 @@ jobs:
319319
NO_DEBUG_ASSERTIONS: 1
320320
NO_OVERFLOW_CHECKS: 1
321321
os: macos-latest
322-
- name: x86_64-apple
322+
- name: x86_64-apple-1
323323
env:
324-
SCRIPT: "./x.py --stage 2 test"
324+
SCRIPT: "./x.py --stage 2 test --exclude src/test/ui --exclude src/test/rustdoc --exclude src/test/run-make-fulldeps"
325+
RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false"
326+
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
327+
MACOSX_DEPLOYMENT_TARGET: 10.8
328+
MACOSX_STD_DEPLOYMENT_TARGET: 10.7
329+
NO_LLVM_ASSERTIONS: 1
330+
NO_DEBUG_ASSERTIONS: 1
331+
NO_OVERFLOW_CHECKS: 1
332+
os: macos-latest
333+
- name: x86_64-apple-2
334+
env:
335+
SCRIPT: "./x.py --stage 2 test src/test/ui src/test/rustdoc src/test/run-make-fulldeps"
325336
RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false"
326337
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
327338
MACOSX_DEPLOYMENT_TARGET: 10.8

compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
763763
HirId, ImplItem, ImplItemKind, Item, ItemKind,
764764
};
765765

766-
fn maybe_body_id_of_fn(hir_map: &Map<'_>, id: HirId) -> Option<BodyId> {
766+
fn maybe_body_id_of_fn(hir_map: Map<'_>, id: HirId) -> Option<BodyId> {
767767
match hir_map.find(id) {
768768
Some(Node::Item(Item { kind: ItemKind::Fn(_, _, body_id), .. }))
769769
| Some(Node::ImplItem(ImplItem { kind: ImplItemKind::Fn(_, body_id), .. })) => {
@@ -774,7 +774,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
774774
}
775775
let hir_map = self.infcx.tcx.hir();
776776
let mir_body_hir_id = self.mir_hir_id();
777-
if let Some(fn_body_id) = maybe_body_id_of_fn(&hir_map, mir_body_hir_id) {
777+
if let Some(fn_body_id) = maybe_body_id_of_fn(hir_map, mir_body_hir_id) {
778778
if let Block(
779779
hir::Block {
780780
expr:

compiler/rustc_codegen_cranelift/src/archive.rs

-2
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,6 @@ impl<'a> ArchiveBuilder<'a> for ArArchiveBuilder<'a> {
105105
Ok(())
106106
}
107107

108-
fn update_symbols(&mut self) {}
109-
110108
fn build(mut self) {
111109
enum BuilderKind {
112110
Bsd(ar::Builder<File>),

compiler/rustc_codegen_gcc/src/archive.rs

-3
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,6 @@ impl<'a> ArchiveBuilder<'a> for ArArchiveBuilder<'a> {
113113
Ok(())
114114
}
115115

116-
fn update_symbols(&mut self) {
117-
}
118-
119116
fn build(mut self) {
120117
use std::process::Command;
121118

compiler/rustc_codegen_llvm/src/back/archive.rs

+1-10
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ pub struct LlvmArchiveBuilder<'a> {
2727
config: ArchiveConfig<'a>,
2828
removals: Vec<String>,
2929
additions: Vec<Addition>,
30-
should_update_symbols: bool,
3130
src_archive: Option<Option<ArchiveRO>>,
3231
}
3332

@@ -75,7 +74,6 @@ impl<'a> ArchiveBuilder<'a> for LlvmArchiveBuilder<'a> {
7574
config,
7675
removals: Vec::new(),
7776
additions: Vec::new(),
78-
should_update_symbols: false,
7977
src_archive: None,
8078
}
8179
}
@@ -129,12 +127,6 @@ impl<'a> ArchiveBuilder<'a> for LlvmArchiveBuilder<'a> {
129127
.push(Addition::File { path: file.to_path_buf(), name_in_archive: name.to_owned() });
130128
}
131129

132-
/// Indicate that the next call to `build` should update all symbols in
133-
/// the archive (equivalent to running 'ar s' over it).
134-
fn update_symbols(&mut self) {
135-
self.should_update_symbols = true;
136-
}
137-
138130
/// Combine the provided files, rlibs, and native libraries into a single
139131
/// `Archive`.
140132
fn build(mut self) {
@@ -313,7 +305,6 @@ impl<'a> LlvmArchiveBuilder<'a> {
313305
let mut members = Vec::new();
314306

315307
let dst = CString::new(self.config.dst.to_str().unwrap())?;
316-
let should_update_symbols = self.should_update_symbols;
317308

318309
unsafe {
319310
if let Some(archive) = self.src_archive() {
@@ -385,7 +376,7 @@ impl<'a> LlvmArchiveBuilder<'a> {
385376
dst.as_ptr(),
386377
members.len() as libc::size_t,
387378
members.as_ptr() as *const &_,
388-
should_update_symbols,
379+
true,
389380
kind,
390381
);
391382
let ret = if r.into_result().is_err() {

compiler/rustc_codegen_ssa/src/back/archive.rs

-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ pub trait ArchiveBuilder<'a> {
5151
fn add_archive<F>(&mut self, archive: &Path, skip: F) -> io::Result<()>
5252
where
5353
F: FnMut(&str) -> bool + 'static;
54-
fn update_symbols(&mut self);
5554

5655
fn build(self);
5756

compiler/rustc_codegen_ssa/src/back/link.rs

+1-13
Original file line numberDiff line numberDiff line change
@@ -333,10 +333,6 @@ fn link_rlib<'a, B: ArchiveBuilder<'a>>(
333333
ab.inject_dll_import_lib(&raw_dylib_name, &raw_dylib_imports, tmpdir);
334334
}
335335

336-
// After adding all files to the archive, we need to update the
337-
// symbol table of the archive.
338-
ab.update_symbols();
339-
340336
// Note that it is important that we add all of our non-object "magical
341337
// files" *after* all of the object files in the archive. The reason for
342338
// this is as follows:
@@ -365,13 +361,6 @@ fn link_rlib<'a, B: ArchiveBuilder<'a>>(
365361
// normal linkers for the platform.
366362
let metadata = create_rmeta_file(sess, codegen_results.metadata.raw_data());
367363
ab.add_file(&emit_metadata(sess, &metadata, tmpdir));
368-
369-
// After adding all files to the archive, we need to update the
370-
// symbol table of the archive. This currently dies on macOS (see
371-
// #11162), and isn't necessary there anyway
372-
if !sess.target.is_like_osx {
373-
ab.update_symbols();
374-
}
375364
}
376365

377366
RlibFlavor::StaticlibBase => {
@@ -381,6 +370,7 @@ fn link_rlib<'a, B: ArchiveBuilder<'a>>(
381370
}
382371
}
383372
}
373+
384374
return Ok(ab);
385375
}
386376

@@ -509,7 +499,6 @@ fn link_staticlib<'a, B: ArchiveBuilder<'a>>(
509499
sess.fatal(&e);
510500
}
511501

512-
ab.update_symbols();
513502
ab.build();
514503

515504
if !all_native_libs.is_empty() {
@@ -2310,7 +2299,6 @@ fn add_upstream_rust_crates<'a, B: ArchiveBuilder<'a>>(
23102299

23112300
sess.prof.generic_activity_with_arg("link_altering_rlib", name).run(|| {
23122301
let mut archive = <B as ArchiveBuilder>::new(sess, &dst, Some(cratepath));
2313-
archive.update_symbols();
23142302

23152303
let mut any_objects = false;
23162304
for f in archive.src_files() {

compiler/rustc_hir/src/intravisit.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -141,22 +141,22 @@ pub trait Map<'hir> {
141141
// Used when no map is actually available, forcing manual implementation of nested visitors.
142142
impl<'hir> Map<'hir> for ! {
143143
fn find(&self, _: HirId) -> Option<Node<'hir>> {
144-
unreachable!()
144+
*self;
145145
}
146146
fn body(&self, _: BodyId) -> &'hir Body<'hir> {
147-
unreachable!()
147+
*self;
148148
}
149149
fn item(&self, _: ItemId) -> &'hir Item<'hir> {
150-
unreachable!()
150+
*self;
151151
}
152152
fn trait_item(&self, _: TraitItemId) -> &'hir TraitItem<'hir> {
153-
unreachable!()
153+
*self;
154154
}
155155
fn impl_item(&self, _: ImplItemId) -> &'hir ImplItem<'hir> {
156-
unreachable!()
156+
*self;
157157
}
158158
fn foreign_item(&self, _: ForeignItemId) -> &'hir ForeignItem<'hir> {
159-
unreachable!()
159+
*self;
160160
}
161161
}
162162

compiler/rustc_hir/src/stable_hash_impls.rs

+3
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,9 @@ impl<'tcx, HirCtx: crate::HashStableContext> HashStable<HirCtx> for OwnerNodes<'
206206
fn hash_stable(&self, hcx: &mut HirCtx, hasher: &mut StableHasher) {
207207
// We ignore the `nodes` and `bodies` fields since these refer to information included in
208208
// `hash` which is hashed in the collector and used for the crate hash.
209+
// `local_id_to_def_id` is also ignored because is dependent on the body, then just hashing
210+
// the body satisfies the condition of two nodes being different have different
211+
// `hash_stable` results.
209212
let OwnerNodes {
210213
hash_including_bodies,
211214
hash_without_bodies: _,

compiler/rustc_infer/src/infer/error_reporting/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2226,7 +2226,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
22262226
bound_kind: GenericKind<'tcx>,
22272227
sub: Region<'tcx>,
22282228
) -> DiagnosticBuilder<'a> {
2229-
let hir = &self.tcx.hir();
2229+
let hir = self.tcx.hir();
22302230
// Attempt to obtain the span of the parameter so we can
22312231
// suggest adding an explicit lifetime bound to it.
22322232
let generics = self

0 commit comments

Comments
 (0)