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 13 pull requests #103049

Closed
wants to merge 54 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
bf135de
Clean up rustdoc startup.
nnethercote Oct 7, 2022
c461f3a
Merge `main_options` into `main_args`.
nnethercote Oct 7, 2022
d156a90
Inline and remove `scoped_thread`.
nnethercote Oct 7, 2022
226387a
Reduce visibility of some functions.
nnethercote Oct 7, 2022
c00937f
Inline and remove `create_compiler_and_run`.
nnethercote Oct 7, 2022
8067016
Apply `Lrc` later to `sess` and `codegen_backend`.
nnethercote Oct 7, 2022
1f0463a
Replace a `spawn_unchecked` with `spawn_scoped`.
nnethercote Oct 7, 2022
ee97f7f
Allow LTO for dylibs
bjorn3 Sep 4, 2022
88bb4e4
impl AsFd for io::{Stdin, Stdout, Stderr}, not the sys versions
joshtriplett Oct 9, 2022
ef68327
Consolidate AsFd instances for stdio types into `library/std/src/os/f…
joshtriplett Oct 10, 2022
202ccc5
Migrate highlight style to CSS variables
GuillaumeGomez Oct 4, 2022
bca1005
Add GUI test for source code pages highlighting
GuillaumeGomez Oct 4, 2022
5c38950
Rollup merge of #102623 - davidtwco:translation-eager, r=compiler-errors
Dylan-DPC Oct 12, 2022
f1807cc
Rollup merge of #102769 - nnethercote:rustdoc-startup, r=jyn514
Dylan-DPC Oct 12, 2022
aa538e6
Rollup merge of #102830 - compiler-errors:constness-parity, r=fee1-dead
Dylan-DPC Oct 12, 2022
a51f145
Rollup merge of #102847 - joshtriplett:bugfix-impl-fd-traits-for-io-t…
Dylan-DPC Oct 12, 2022
f7f2ae4
Rollup merge of #102883 - Urgau:fix-stabilization-half_open_range_pat…
Dylan-DPC Oct 12, 2022
678fe0f
Rollup merge of #102936 - notriddle:notriddle/nav-sum, r=Dylan-DPC
Dylan-DPC Oct 12, 2022
6f1de0b
Rollup merge of #102940 - ehuss:update-books, r=ehuss
Dylan-DPC Oct 12, 2022
2d2c9e4
std: use `sync::Mutex` for internal statics
joboet Sep 3, 2022
600ac69
sync thread_local key conditions exactly with what the macro uses
RalfJung Oct 7, 2022
594838d
smarter way to avoid 'unused' warning when building for tests
RalfJung Oct 8, 2022
dbc8f51
Move some tests to more reasonable directories
c410-f3r Oct 13, 2022
5191256
fix a typo
whentojump Oct 13, 2022
112ce80
Report duplicate definition in impls with overlap check.
cjgillot Aug 13, 2022
513f699
rustdoc: remove unused CSS `.search-container > *`
notriddle Oct 13, 2022
eab41a1
Suppress irrefutable let patterns lint for prefixes in match guards
est31 Oct 13, 2022
b841848
check if the self type is `ty::Float` before getting second substs
TaKO8Ki Oct 13, 2022
5378677
normalize stderr
TaKO8Ki Oct 13, 2022
7122aba
more dupe word typos
Rageking8 Oct 13, 2022
dbb4271
checktools: fix comments
RalfJung Oct 14, 2022
5218e24
wasm-ignore some tests that access thread-local private details
RalfJung Oct 14, 2022
b8bb406
remove leading newlines from integer primitive doc examples
Oct 14, 2022
b03bece
Rollup merge of #102847 - joshtriplett:bugfix-impl-fd-traits-for-io-t…
Dylan-DPC Oct 14, 2022
b4906ac
Rollup merge of #102856 - cjgillot:impl-single-check, r=petrochenkov
Dylan-DPC Oct 14, 2022
20e1268
Rollup merge of #102914 - GuillaumeGomez:migrate-css-highlight-withou…
Dylan-DPC Oct 14, 2022
3017341
Rollup merge of #102938 - c410-f3r:here-we-go-again, r=petrochenkov
Dylan-DPC Oct 14, 2022
8c9ecbb
Rollup merge of #103015 - whentojump:patch, r=compiler-errors
Dylan-DPC Oct 14, 2022
77064b7
Rollup merge of #103018 - Rageking8:more-dupe-word-typos, r=TaKO8Ki
Dylan-DPC Oct 14, 2022
587b9c1
Rollup merge of #103025 - notriddle:notriddle/search-container-star, …
Dylan-DPC Oct 14, 2022
7cf09c5
Rollup merge of #103031 - est31:match_guard_irrefutable_let, r=oli-obk
Dylan-DPC Oct 14, 2022
42ce39d
Rollup merge of #100579 - joboet:sync_mutex_everywhere, r=thomcc
albertlarsan68 Oct 14, 2022
3f3fcc6
Rollup merge of #101403 - bjorn3:dylib_lto, r=Mark-Simulacrum
albertlarsan68 Oct 14, 2022
43381a2
Rollup merge of #102783 - RalfJung:tls, r=thomcc
albertlarsan68 Oct 14, 2022
909d03d
Rollup merge of #102914 - GuillaumeGomez:migrate-css-highlight-withou…
albertlarsan68 Oct 14, 2022
74cbeef
Rollup merge of #102960 - Dylan-DPC:rollup-ud1dlfl, r=Dylan-DPC
albertlarsan68 Oct 14, 2022
639095b
Rollup merge of #103003 - TaKO8Ki:fix-102989, r=compiler-errors
albertlarsan68 Oct 14, 2022
ecb1bfd
Rollup merge of #103015 - whentojump:patch, r=compiler-errors
albertlarsan68 Oct 14, 2022
18d52f9
Rollup merge of #103018 - Rageking8:more-dupe-word-typos, r=TaKO8Ki
albertlarsan68 Oct 14, 2022
283bd2f
Rollup merge of #103025 - notriddle:notriddle/search-container-star, …
albertlarsan68 Oct 14, 2022
03e206e
Rollup merge of #103031 - est31:match_guard_irrefutable_let, r=oli-obk
albertlarsan68 Oct 14, 2022
362f3da
Rollup merge of #103039 - RalfJung:checktools, r=Dylan-DPC
albertlarsan68 Oct 14, 2022
c6f23ed
Rollup merge of #103045 - lukas-code:blank-lines, r=GuillaumeGomez
albertlarsan68 Oct 14, 2022
97b0ece
Rollup merge of #103048 - Dylan-DPC:rollup-47r62js, r=Dylan-DPC
albertlarsan68 Oct 14, 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
2 changes: 1 addition & 1 deletion compiler/rustc_borrowck/src/universal_regions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> {

let typeck_root_def_id = self.infcx.tcx.typeck_root_def_id(self.mir_def.did.to_def_id());

// If this is is a 'root' body (not a closure/generator/inline const), then
// If this is a 'root' body (not a closure/generator/inline const), then
// there are no extern regions, so the local regions start at the same
// position as the (empty) sub-list of extern regions
let first_local_index = if self.mir_def.did.to_def_id() == typeck_root_def_id {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pub(crate) fn get_file_name(crate_name: &str, crate_type: &str) -> String {
}

/// Similar to `get_file_name`, but converts any dashes (`-`) in the `crate_name` to
/// underscores (`_`). This is specially made for the the rustc and cargo wrappers
/// underscores (`_`). This is specially made for the rustc and cargo wrappers
/// which have a dash in the name, and that is not allowed in a crate name.
pub(crate) fn get_wrapper_file_name(crate_name: &str, crate_type: &str) -> String {
let crate_name = crate_name.replace('-', "_");
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_cranelift/src/abi/pass_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ pub(super) fn from_casted_value<'tcx>(
kind: StackSlotKind::ExplicitSlot,
// FIXME Don't force the size to a multiple of 16 bytes once Cranelift gets a way to
// specify stack slot alignment.
// Stack slot size may be bigger for for example `[u8; 3]` which is packed into an `i32`.
// Stack slot size may be bigger for example `[u8; 3]` which is packed into an `i32`.
// It may also be smaller for example when the type is a wrapper around an integer with a
// larger alignment than the integer.
size: (std::cmp::max(abi_param_size, layout_size) + 15) / 16 * 16,
Expand Down
31 changes: 18 additions & 13 deletions compiler/rustc_codegen_llvm/src/back/lto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ pub const THIN_LTO_KEYS_INCR_COMP_FILE_NAME: &str = "thin-lto-past-keys.bin";

pub fn crate_type_allows_lto(crate_type: CrateType) -> bool {
match crate_type {
CrateType::Executable | CrateType::Staticlib | CrateType::Cdylib => true,
CrateType::Dylib | CrateType::Rlib | CrateType::ProcMacro => false,
CrateType::Executable | CrateType::Dylib | CrateType::Staticlib | CrateType::Cdylib => true,
CrateType::Rlib | CrateType::ProcMacro => false,
}
}

Expand Down Expand Up @@ -73,17 +73,6 @@ fn prepare_lto(
// with either fat or thin LTO
let mut upstream_modules = Vec::new();
if cgcx.lto != Lto::ThinLocal {
if cgcx.opts.cg.prefer_dynamic {
diag_handler
.struct_err("cannot prefer dynamic linking when performing LTO")
.note(
"only 'staticlib', 'bin', and 'cdylib' outputs are \
supported with LTO",
)
.emit();
return Err(FatalError);
}

// Make sure we actually can run LTO
for crate_type in cgcx.crate_types.iter() {
if !crate_type_allows_lto(*crate_type) {
Expand All @@ -92,9 +81,25 @@ fn prepare_lto(
static library outputs",
);
return Err(e);
} else if *crate_type == CrateType::Dylib {
if !cgcx.opts.unstable_opts.dylib_lto {
return Err(diag_handler
.fatal("lto cannot be used for `dylib` crate type without `-Zdylib-lto`"));
}
}
}

if cgcx.opts.cg.prefer_dynamic && !cgcx.opts.unstable_opts.dylib_lto {
diag_handler
.struct_err("cannot prefer dynamic linking when performing LTO")
.note(
"only 'staticlib', 'bin', and 'cdylib' outputs are \
supported with LTO",
)
.emit();
return Err(FatalError);
}

for &(cnum, ref path) in cgcx.each_linked_rlib_for_lto.iter() {
let exported_symbols =
cgcx.exported_symbols.as_ref().expect("needs exported symbols for LTO");
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ pub(crate) fn link(
mut modules: Vec<ModuleCodegen<ModuleLlvm>>,
) -> Result<ModuleCodegen<ModuleLlvm>, FatalError> {
use super::lto::{Linker, ModuleBuffer};
// Sort the modules by name to ensure to ensure deterministic behavior.
// Sort the modules by name to ensure deterministic behavior.
modules.sort_by(|a, b| a.name.cmp(&b.name));
let (first, elements) =
modules.split_first().expect("Bug! modules must contain at least one module.");
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ impl CoverageMapGenerator {
// LLVM Coverage Mapping Format version 6 (zero-based encoded as 5)
// requires setting the first filename to the compilation directory.
// Since rustc generates coverage maps with relative paths, the
// compilation directory can be combined with the the relative paths
// compilation directory can be combined with the relative paths
// to get absolute paths, if needed.
let working_dir = tcx
.sess
Expand Down
24 changes: 22 additions & 2 deletions compiler/rustc_codegen_ssa/src/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use rustc_metadata::find_native_static_library;
use rustc_metadata::fs::{emit_metadata, METADATA_FILENAME};
use rustc_middle::middle::dependency_format::Linkage;
use rustc_middle::middle::exported_symbols::SymbolExportKind;
use rustc_session::config::{self, CFGuard, CrateType, DebugInfo, LdImpl, Strip};
use rustc_session::config::{self, CFGuard, CrateType, DebugInfo, LdImpl, Lto, Strip};
use rustc_session::config::{OutputFilenames, OutputType, PrintRequest, SplitDwarfKind};
use rustc_session::cstore::DllImport;
use rustc_session::output::{check_file_is_writeable, invalid_output_for_target, out_filename};
Expand Down Expand Up @@ -39,6 +39,7 @@ use cc::windows_registry;
use regex::Regex;
use tempfile::Builder as TempFileBuilder;

use itertools::Itertools;
use std::borrow::Borrow;
use std::cell::OnceCell;
use std::collections::BTreeSet;
Expand Down Expand Up @@ -208,11 +209,26 @@ pub fn link_binary<'a>(
}

pub fn each_linked_rlib(
sess: &Session,
info: &CrateInfo,
f: &mut dyn FnMut(CrateNum, &Path),
) -> Result<(), errors::LinkRlibError> {
let crates = info.used_crates.iter();
let mut fmts = None;

let lto_active = matches!(sess.lto(), Lto::Fat | Lto::Thin);
if lto_active {
for combination in info.dependency_formats.iter().combinations(2) {
let (ty1, list1) = combination[0];
let (ty2, list2) = combination[1];
if list1 != list2 {
return Err(format!(
"{ty1:?} and {ty2:?} do not have equivalent dependency formats (`{list1:?}` vs `{list2:?}`)"
));
}
}
}

for (ty, list) in info.dependency_formats.iter() {
match ty {
CrateType::Executable
Expand All @@ -222,6 +238,10 @@ pub fn each_linked_rlib(
fmts = Some(list);
break;
}
CrateType::Dylib if lto_active => {
fmts = Some(list);
break;
}
_ => {}
}
}
Expand Down Expand Up @@ -490,7 +510,7 @@ fn link_staticlib<'a>(
)?;
let mut all_native_libs = vec![];

let res = each_linked_rlib(&codegen_results.crate_info, &mut |cnum, path| {
let res = each_linked_rlib(sess, &codegen_results.crate_info, &mut |cnum, path| {
let name = codegen_results.crate_info.crate_name[&cnum];
let native_libs = &codegen_results.crate_info.native_libraries[&cnum];

Expand Down
11 changes: 10 additions & 1 deletion compiler/rustc_codegen_ssa/src/back/symbol_export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use rustc_middle::ty::query::{ExternProviders, Providers};
use rustc_middle::ty::subst::{GenericArgKind, SubstsRef};
use rustc_middle::ty::Instance;
use rustc_middle::ty::{self, SymbolName, TyCtxt};
use rustc_session::config::CrateType;
use rustc_session::config::{CrateType, OomStrategy};
use rustc_target::spec::SanitizerSet;

pub fn threshold(tcx: TyCtxt<'_>) -> SymbolExportLevel {
Expand Down Expand Up @@ -206,6 +206,15 @@ fn exported_symbols_provider_local<'tcx>(
},
));
}

symbols.push((
ExportedSymbol::NoDefId(SymbolName::new(tcx, OomStrategy::SYMBOL)),
SymbolExportInfo {
level: SymbolExportLevel::Rust,
kind: SymbolExportKind::Text,
used: false,
},
));
}

if tcx.sess.instrument_coverage() || tcx.sess.opts.cg.profile_generate.enabled() {
Expand Down
18 changes: 9 additions & 9 deletions compiler/rustc_codegen_ssa/src/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,14 @@ fn start_executing_work<B: ExtraBackendMethods>(
let coordinator_send = tx_to_llvm_workers;
let sess = tcx.sess;

let mut each_linked_rlib_for_lto = Vec::new();
drop(link::each_linked_rlib(sess, crate_info, &mut |cnum, path| {
if link::ignored_for_lto(sess, crate_info, cnum) {
return;
}
each_linked_rlib_for_lto.push((cnum, path.to_path_buf()));
}));

// Compute the set of symbols we need to retain when doing LTO (if we need to)
let exported_symbols = {
let mut exported_symbols = FxHashMap::default();
Expand All @@ -1020,7 +1028,7 @@ fn start_executing_work<B: ExtraBackendMethods>(
}
Lto::Fat | Lto::Thin => {
exported_symbols.insert(LOCAL_CRATE, copy_symbols(LOCAL_CRATE));
for &cnum in tcx.crates(()).iter() {
for &(cnum, ref _path) in &each_linked_rlib_for_lto {
exported_symbols.insert(cnum, copy_symbols(cnum));
}
Some(Arc::new(exported_symbols))
Expand All @@ -1040,14 +1048,6 @@ fn start_executing_work<B: ExtraBackendMethods>(
})
.expect("failed to spawn helper thread");

let mut each_linked_rlib_for_lto = Vec::new();
drop(link::each_linked_rlib(crate_info, &mut |cnum, path| {
if link::ignored_for_lto(sess, crate_info, cnum) {
return;
}
each_linked_rlib_for_lto.push((cnum, path.to_path_buf()));
}));

let ol =
if tcx.sess.opts.unstable_opts.no_codegen || !tcx.sess.opts.output_types.should_codegen() {
// If we know that we won’t be doing codegen, create target machines without optimisation.
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_const_eval/src/const_eval/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub struct ConstEvalErr<'tcx> {
impl<'tcx> ConstEvalErr<'tcx> {
/// Turn an interpreter error into something to report to the user.
/// As a side-effect, if RUSTC_CTFE_BACKTRACE is set, this prints the backtrace.
/// Should be called only if the error is actually going to to be reported!
/// Should be called only if the error is actually going to be reported!
pub fn new<'mir, M: Machine<'mir, 'tcx>>(
ecx: &InterpCx<'mir, 'tcx, M>,
error: InterpErrorInfo<'tcx>,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_const_eval/src/interpret/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
todo.extend(static_roots);
while let Some(id) = todo.pop() {
if reachable.insert(id) {
// This is a new allocation, add the allocation it points to to `todo`.
// This is a new allocation, add the allocation it points to `todo`.
if let Some((_, alloc)) = self.memory.alloc_map.get(id) {
todo.extend(
alloc.provenance().values().filter_map(|prov| prov.get_alloc_id()),
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_data_structures/src/graph/vec_graph/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ impl<N: Idx + Ord> VecGraph<N> {
// Store the *target* of each edge into `edge_targets`.
let edge_targets: Vec<N> = edge_pairs.iter().map(|&(_, target)| target).collect();

// Create the *edge starts* array. We are iterating over over
// the (sorted) edge pairs. We maintain the invariant that the
// Create the *edge starts* array. We are iterating over the
// (sorted) edge pairs. We maintain the invariant that the
// length of the `node_starts` array is enough to store the
// current source node -- so when we see that the source node
// for an edge is greater than the current length, we grow the
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_expand/src/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ impl InvocationKind {
fn placeholder_visibility(&self) -> Option<ast::Visibility> {
// HACK: For unnamed fields placeholders should have the same visibility as the actual
// fields because for tuple structs/variants resolve determines visibilities of their
// constructor using these field visibilities before attributes on them are are expanded.
// constructor using these field visibilities before attributes on them are expanded.
// The assumption is that the attribute expansion cannot change field visibilities,
// and it holds because only inert attributes are supported in this position.
match self {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_analysis/src/check/fallback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ impl<'tcx> FnCtxt<'_, 'tcx> {
//
// - Unconstrained ints are replaced with `i32`.
//
// - Unconstrained floats are replaced with with `f64`.
// - Unconstrained floats are replaced with `f64`.
//
// - Non-numerics may get replaced with `()` or `!`, depending on
// how they were categorized by `calculate_diverging_fallback`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ impl<'a, 'tcx> DropRangeVisitor<'a, 'tcx> {
}

/// For an expression with an uninhabited return type (e.g. a function that returns !),
/// this adds a self edge to to the CFG to model the fact that the function does not
/// this adds a self edge to the CFG to model the fact that the function does not
/// return.
fn handle_uninhabited_return(&mut self, expr: &Expr<'tcx>) {
let ty = self.typeck_results.expr_ty(expr);
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_analysis/src/check/upvar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
/// and that the path can be captured with required capture kind (depending on use in closure,
/// move closure etc.)
///
/// Returns the set of of adjusted information along with the inferred closure kind and span
/// Returns the set of adjusted information along with the inferred closure kind and span
/// associated with the closure kind inference.
///
/// Note that we *always* infer a minimal kind, even if
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,37 @@ impl<'tcx> InherentOverlapChecker<'tcx> {
== item2.ident(self.tcx).normalize_to_macros_2_0()
}

fn check_for_duplicate_items_in_impl(&self, impl_: DefId) {
let impl_items = self.tcx.associated_items(impl_);

let mut seen_items = FxHashMap::default();
for impl_item in impl_items.in_definition_order() {
let span = self.tcx.def_span(impl_item.def_id);
let ident = impl_item.ident(self.tcx);

let norm_ident = ident.normalize_to_macros_2_0();
match seen_items.entry(norm_ident) {
Entry::Occupied(entry) => {
let former = entry.get();
let mut err = struct_span_err!(
self.tcx.sess,
span,
E0592,
"duplicate definitions with name `{}`",
ident,
);
err.span_label(span, format!("duplicate definitions for `{}`", ident));
err.span_label(*former, format!("other definition for `{}`", ident));

err.emit();
}
Entry::Vacant(entry) => {
entry.insert(span);
}
}
}
}

fn check_for_common_items_in_impls(
&self,
impl1: DefId,
Expand Down Expand Up @@ -133,12 +164,6 @@ impl<'tcx> InherentOverlapChecker<'tcx> {

let impls = self.tcx.inherent_impls(id.def_id);

// If there is only one inherent impl block,
// there is nothing to overlap check it with
if impls.len() <= 1 {
return;
}

let overlap_mode = OverlapMode::get(self.tcx, id.def_id.to_def_id());

let impls_items = impls
Expand All @@ -152,6 +177,8 @@ impl<'tcx> InherentOverlapChecker<'tcx> {
const ALLOCATING_ALGO_THRESHOLD: usize = 500;
if impls.len() < ALLOCATING_ALGO_THRESHOLD {
for (i, &(&impl1_def_id, impl_items1)) in impls_items.iter().enumerate() {
self.check_for_duplicate_items_in_impl(impl1_def_id);

for &(&impl2_def_id, impl_items2) in &impls_items[(i + 1)..] {
if self.impls_have_common_items(impl_items1, impl_items2) {
self.check_for_overlapping_inherent_impls(
Expand Down Expand Up @@ -290,6 +317,8 @@ impl<'tcx> InherentOverlapChecker<'tcx> {
impl_blocks.sort_unstable();
for (i, &impl1_items_idx) in impl_blocks.iter().enumerate() {
let &(&impl1_def_id, impl_items1) = &impls_items[impl1_items_idx];
self.check_for_duplicate_items_in_impl(impl1_def_id);

for &impl2_items_idx in impl_blocks[(i + 1)..].iter() {
let &(&impl2_def_id, impl_items2) = &impls_items[impl2_items_idx];
if self.impls_have_common_items(impl_items1, impl_items2) {
Expand Down
Loading