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

Rollup of 8 pull requests #93891

Merged
merged 18 commits into from
Feb 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
1458687
Erase regions before calculating layout for packed field capture
compiler-errors Dec 24, 2021
5f7b989
Add comment on stable_hash_impl for OwnerNodes
spastorino Jan 28, 2022
8742baf
Drop rustc-docs from complete profile
Mark-Simulacrum Feb 7, 2022
89ac81a
Make all hir::Map methods consistently by-value
steffahn Feb 10, 2022
7eff2fe
Remove further usage of `&hir::Map`
steffahn Feb 10, 2022
8e12b4e
Remove support for multi-query search
GuillaumeGomez Feb 10, 2022
6bc28c8
Fix ICE if no trait assoc const eq
JulianKnodt Feb 10, 2022
203b622
Remove unnecessary update_symbols call
bjorn3 Feb 10, 2022
6097847
Unconditionally update symbols
bjorn3 Feb 10, 2022
a023be9
Split x86_64 apple builder into two
Mark-Simulacrum Feb 10, 2022
664255b
Rollup merge of #92242 - compiler-errors:layout-modulo-regions, r=mat…
matthiaskrgr Feb 11, 2022
8611e29
Rollup merge of #93443 - spastorino:add-stable-hash-impl-doc, r=cjgillot
matthiaskrgr Feb 11, 2022
b8da6f4
Rollup merge of #93742 - Mark-Simulacrum:skip-rustc-docs-complete, r=…
matthiaskrgr Feb 11, 2022
b97cceb
Rollup merge of #93852 - GuillaumeGomez:remove-multi-query, r=jsha
matthiaskrgr Feb 11, 2022
ddba967
Rollup merge of #93853 - steffahn:map_by_value, r=wesleywiser
matthiaskrgr Feb 11, 2022
a59d312
Rollup merge of #93861 - JulianKnodt:notraitace, r=wesleywiser
matthiaskrgr Feb 11, 2022
219fc8f
Rollup merge of #93862 - Mark-Simulacrum:apple-split, r=pietroalbini
matthiaskrgr Feb 11, 2022
c543f7d
Rollup merge of #93864 - bjorn3:cleanup_archive_handling, r=petrochenkov
matthiaskrgr Feb 11, 2022
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
15 changes: 13 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,20 @@ jobs:
NO_DEBUG_ASSERTIONS: 1
NO_OVERFLOW_CHECKS: 1
os: macos-latest
- name: x86_64-apple
- name: x86_64-apple-1
env:
SCRIPT: "./x.py --stage 2 test"
SCRIPT: "./x.py --stage 2 test --exclude src/test/ui --exclude src/test/rustdoc --exclude src/test/run-make-fulldeps"
RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false"
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
MACOSX_DEPLOYMENT_TARGET: 10.8
MACOSX_STD_DEPLOYMENT_TARGET: 10.7
NO_LLVM_ASSERTIONS: 1
NO_DEBUG_ASSERTIONS: 1
NO_OVERFLOW_CHECKS: 1
os: macos-latest
- name: x86_64-apple-2
env:
SCRIPT: "./x.py --stage 2 test src/test/ui src/test/rustdoc src/test/run-make-fulldeps"
RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false"
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
MACOSX_DEPLOYMENT_TARGET: 10.8
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
HirId, ImplItem, ImplItemKind, Item, ItemKind,
};

fn maybe_body_id_of_fn(hir_map: &Map<'_>, id: HirId) -> Option<BodyId> {
fn maybe_body_id_of_fn(hir_map: Map<'_>, id: HirId) -> Option<BodyId> {
match hir_map.find(id) {
Some(Node::Item(Item { kind: ItemKind::Fn(_, _, body_id), .. }))
| Some(Node::ImplItem(ImplItem { kind: ImplItemKind::Fn(_, body_id), .. })) => {
Expand All @@ -774,7 +774,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
}
let hir_map = self.infcx.tcx.hir();
let mir_body_hir_id = self.mir_hir_id();
if let Some(fn_body_id) = maybe_body_id_of_fn(&hir_map, mir_body_hir_id) {
if let Some(fn_body_id) = maybe_body_id_of_fn(hir_map, mir_body_hir_id) {
if let Block(
hir::Block {
expr:
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_codegen_cranelift/src/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ impl<'a> ArchiveBuilder<'a> for ArArchiveBuilder<'a> {
Ok(())
}

fn update_symbols(&mut self) {}

fn build(mut self) {
enum BuilderKind {
Bsd(ar::Builder<File>),
Expand Down
3 changes: 0 additions & 3 deletions compiler/rustc_codegen_gcc/src/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,6 @@ impl<'a> ArchiveBuilder<'a> for ArArchiveBuilder<'a> {
Ok(())
}

fn update_symbols(&mut self) {
}

fn build(mut self) {
use std::process::Command;

Expand Down
11 changes: 1 addition & 10 deletions compiler/rustc_codegen_llvm/src/back/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ pub struct LlvmArchiveBuilder<'a> {
config: ArchiveConfig<'a>,
removals: Vec<String>,
additions: Vec<Addition>,
should_update_symbols: bool,
src_archive: Option<Option<ArchiveRO>>,
}

Expand Down Expand Up @@ -75,7 +74,6 @@ impl<'a> ArchiveBuilder<'a> for LlvmArchiveBuilder<'a> {
config,
removals: Vec::new(),
additions: Vec::new(),
should_update_symbols: false,
src_archive: None,
}
}
Expand Down Expand Up @@ -129,12 +127,6 @@ impl<'a> ArchiveBuilder<'a> for LlvmArchiveBuilder<'a> {
.push(Addition::File { path: file.to_path_buf(), name_in_archive: name.to_owned() });
}

/// Indicate that the next call to `build` should update all symbols in
/// the archive (equivalent to running 'ar s' over it).
fn update_symbols(&mut self) {
self.should_update_symbols = true;
}

/// Combine the provided files, rlibs, and native libraries into a single
/// `Archive`.
fn build(mut self) {
Expand Down Expand Up @@ -313,7 +305,6 @@ impl<'a> LlvmArchiveBuilder<'a> {
let mut members = Vec::new();

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

unsafe {
if let Some(archive) = self.src_archive() {
Expand Down Expand Up @@ -385,7 +376,7 @@ impl<'a> LlvmArchiveBuilder<'a> {
dst.as_ptr(),
members.len() as libc::size_t,
members.as_ptr() as *const &_,
should_update_symbols,
true,
kind,
);
let ret = if r.into_result().is_err() {
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_codegen_ssa/src/back/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ pub trait ArchiveBuilder<'a> {
fn add_archive<F>(&mut self, archive: &Path, skip: F) -> io::Result<()>
where
F: FnMut(&str) -> bool + 'static;
fn update_symbols(&mut self);

fn build(self);

Expand Down
14 changes: 1 addition & 13 deletions compiler/rustc_codegen_ssa/src/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,10 +333,6 @@ fn link_rlib<'a, B: ArchiveBuilder<'a>>(
ab.inject_dll_import_lib(&raw_dylib_name, &raw_dylib_imports, tmpdir);
}

// After adding all files to the archive, we need to update the
// symbol table of the archive.
ab.update_symbols();

// Note that it is important that we add all of our non-object "magical
// files" *after* all of the object files in the archive. The reason for
// this is as follows:
Expand Down Expand Up @@ -365,13 +361,6 @@ fn link_rlib<'a, B: ArchiveBuilder<'a>>(
// normal linkers for the platform.
let metadata = create_rmeta_file(sess, codegen_results.metadata.raw_data());
ab.add_file(&emit_metadata(sess, &metadata, tmpdir));

// After adding all files to the archive, we need to update the
// symbol table of the archive. This currently dies on macOS (see
// #11162), and isn't necessary there anyway
if !sess.target.is_like_osx {
ab.update_symbols();
}
}

RlibFlavor::StaticlibBase => {
Expand All @@ -381,6 +370,7 @@ fn link_rlib<'a, B: ArchiveBuilder<'a>>(
}
}
}

return Ok(ab);
}

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

ab.update_symbols();
ab.build();

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

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

let mut any_objects = false;
for f in archive.src_files() {
Expand Down
12 changes: 6 additions & 6 deletions compiler/rustc_hir/src/intravisit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,22 +141,22 @@ pub trait Map<'hir> {
// Used when no map is actually available, forcing manual implementation of nested visitors.
impl<'hir> Map<'hir> for ! {
fn find(&self, _: HirId) -> Option<Node<'hir>> {
unreachable!()
*self;
}
fn body(&self, _: BodyId) -> &'hir Body<'hir> {
unreachable!()
*self;
}
fn item(&self, _: ItemId) -> &'hir Item<'hir> {
unreachable!()
*self;
}
fn trait_item(&self, _: TraitItemId) -> &'hir TraitItem<'hir> {
unreachable!()
*self;
}
fn impl_item(&self, _: ImplItemId) -> &'hir ImplItem<'hir> {
unreachable!()
*self;
}
fn foreign_item(&self, _: ForeignItemId) -> &'hir ForeignItem<'hir> {
unreachable!()
*self;
}
}

Expand Down
3 changes: 3 additions & 0 deletions compiler/rustc_hir/src/stable_hash_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@ impl<'tcx, HirCtx: crate::HashStableContext> HashStable<HirCtx> for OwnerNodes<'
fn hash_stable(&self, hcx: &mut HirCtx, hasher: &mut StableHasher) {
// We ignore the `nodes` and `bodies` fields since these refer to information included in
// `hash` which is hashed in the collector and used for the crate hash.
// `local_id_to_def_id` is also ignored because is dependent on the body, then just hashing
// the body satisfies the condition of two nodes being different have different
// `hash_stable` results.
let OwnerNodes {
hash_including_bodies,
hash_without_bodies: _,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_infer/src/infer/error_reporting/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2226,7 +2226,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
bound_kind: GenericKind<'tcx>,
sub: Region<'tcx>,
) -> DiagnosticBuilder<'a> {
let hir = &self.tcx.hir();
let hir = self.tcx.hir();
// Attempt to obtain the span of the parameter so we can
// suggest adding an explicit lifetime bound to it.
let generics = self
Expand Down
Loading