Skip to content

Commit 6757779

Browse files
committed
Auto merge of rust-lang#119981 - matthiaskrgr:rollup-v82kpkl, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - rust-lang#119508 (coverage: Simplify building the coverage graph with `CoverageSuccessors`) - rust-lang#119818 (Silence some follow-up errors [3/x]) - rust-lang#119870 (std: Doc blocking behavior of LazyLock) - rust-lang#119963 (Fix `allow_internal_unstable` for `(min_)specialization`) - rust-lang#119968 (Remove unused/unnecessary features) - rust-lang#119971 (Use `zip_eq` to enforce that things being zipped have equal sizes) - rust-lang#119974 (Minor `trimmed_def_paths` improvements) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 9567c3e + 1b27677 commit 6757779

File tree

73 files changed

+276
-349
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+276
-349
lines changed

Cargo.lock

+3
Original file line numberDiff line numberDiff line change
@@ -3879,6 +3879,7 @@ dependencies = [
38793879
name = "rustc_hir_analysis"
38803880
version = "0.0.0"
38813881
dependencies = [
3882+
"itertools",
38823883
"rustc_arena",
38833884
"rustc_ast",
38843885
"rustc_attr",
@@ -3917,6 +3918,7 @@ dependencies = [
39173918
name = "rustc_hir_typeck"
39183919
version = "0.0.0"
39193920
dependencies = [
3921+
"itertools",
39203922
"rustc_ast",
39213923
"rustc_attr",
39223924
"rustc_data_structures",
@@ -4200,6 +4202,7 @@ name = "rustc_mir_build"
42004202
version = "0.0.0"
42014203
dependencies = [
42024204
"either",
4205+
"itertools",
42034206
"rustc_apfloat",
42044207
"rustc_arena",
42054208
"rustc_ast",

compiler/rustc_ast/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,11 @@
1313
#![feature(rustdoc_internals)]
1414
#![feature(associated_type_bounds)]
1515
#![feature(box_patterns)]
16-
#![feature(const_trait_impl)]
1716
#![feature(if_let_guard)]
1817
#![feature(let_chains)]
1918
#![feature(min_specialization)]
2019
#![feature(negative_impls)]
2120
#![feature(stmt_expr_attributes)]
22-
#![recursion_limit = "256"]
2321
#![deny(rustc::untranslatable_diagnostic)]
2422
#![deny(rustc::diagnostic_outside_of_impl)]
2523

compiler/rustc_ast_lowering/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,8 @@
3333
#![allow(internal_features)]
3434
#![feature(rustdoc_internals)]
3535
#![doc(rust_logo)]
36-
#![feature(if_let_guard)]
3736
#![feature(box_patterns)]
3837
#![feature(let_chains)]
39-
#![recursion_limit = "256"]
4038
#![deny(rustc::untranslatable_diagnostic)]
4139
#![deny(rustc::diagnostic_outside_of_impl)]
4240

compiler/rustc_ast_passes/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#![feature(if_let_guard)]
1212
#![feature(iter_is_partitioned)]
1313
#![feature(let_chains)]
14-
#![recursion_limit = "256"]
1514
#![deny(rustc::untranslatable_diagnostic)]
1615
#![deny(rustc::diagnostic_outside_of_impl)]
1716

compiler/rustc_ast_pretty/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
#![deny(rustc::untranslatable_diagnostic)]
55
#![deny(rustc::diagnostic_outside_of_impl)]
66
#![feature(box_patterns)]
7-
#![feature(let_chains)]
8-
#![recursion_limit = "256"]
97

108
mod helpers;
119
pub mod pp;

compiler/rustc_borrowck/src/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,9 @@
88
#![feature(let_chains)]
99
#![feature(min_specialization)]
1010
#![feature(never_type)]
11-
#![feature(lazy_cell)]
1211
#![feature(rustc_attrs)]
1312
#![feature(stmt_expr_attributes)]
14-
#![feature(trusted_step)]
1513
#![feature(try_blocks)]
16-
#![recursion_limit = "256"]
1714

1815
#[macro_use]
1916
extern crate rustc_middle;

compiler/rustc_borrowck/src/type_check/input_output.rs

+10-3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//! `RETURN_PLACE` the MIR arguments) are always fully normalized (and
88
//! contain revealed `impl Trait` values).
99
10+
use itertools::Itertools;
1011
use rustc_infer::infer::BoundRegionConversionTime;
1112
use rustc_middle::mir::*;
1213
use rustc_middle::ty::{self, Ty};
@@ -39,9 +40,15 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
3940
user_provided_sig,
4041
);
4142

42-
for (&user_ty, arg_decl) in user_provided_sig.inputs().iter().zip(
43-
// In MIR, closure args begin with an implicit `self`. Skip it!
44-
body.args_iter().skip(1).map(|local| &body.local_decls[local]),
43+
let is_coroutine_with_implicit_resume_ty = self.tcx().is_coroutine(mir_def_id.to_def_id())
44+
&& user_provided_sig.inputs().is_empty();
45+
46+
for (&user_ty, arg_decl) in user_provided_sig.inputs().iter().zip_eq(
47+
// In MIR, closure args begin with an implicit `self`.
48+
// Also, coroutines have a resume type which may be implicitly `()`.
49+
body.args_iter()
50+
.skip(1 + if is_coroutine_with_implicit_resume_ty { 1 } else { 0 })
51+
.map(|local| &body.local_decls[local]),
4552
) {
4653
self.ascribe_user_type_skip_wf(
4754
arg_decl.ty,

compiler/rustc_builtin_macros/src/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,13 @@
55
#![feature(rustdoc_internals)]
66
#![doc(rust_logo)]
77
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
8-
#![feature(array_windows)]
98
#![feature(box_patterns)]
109
#![feature(decl_macro)]
1110
#![feature(if_let_guard)]
12-
#![feature(is_sorted)]
1311
#![feature(let_chains)]
1412
#![feature(lint_reasons)]
1513
#![feature(proc_macro_internals)]
1614
#![feature(proc_macro_quote)]
17-
#![recursion_limit = "256"]
1815

1916
extern crate proc_macro;
2017

compiler/rustc_codegen_llvm/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
#![feature(iter_intersperse)]
1515
#![feature(let_chains)]
1616
#![feature(min_specialization)]
17-
#![feature(never_type)]
1817
#![feature(impl_trait_in_assoc_type)]
19-
#![recursion_limit = "256"]
2018
#![deny(rustc::untranslatable_diagnostic)]
2119
#![deny(rustc::diagnostic_outside_of_impl)]
2220

compiler/rustc_codegen_ssa/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@
77
#![feature(if_let_guard)]
88
#![feature(let_chains)]
99
#![feature(negative_impls)]
10-
#![feature(never_type)]
1110
#![feature(strict_provenance)]
1211
#![feature(try_blocks)]
13-
#![recursion_limit = "256"]
1412

1513
//! This crate contains codegen code that is used by all codegen backends (LLVM and others).
1614
//! The backend-agnostic functions of this crate use functions defined in various traits that

compiler/rustc_const_eval/src/lib.rs

-7
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,13 @@ Rust MIR: a lowered representation of Rust.
1111
#![feature(assert_matches)]
1212
#![feature(box_patterns)]
1313
#![feature(decl_macro)]
14-
#![feature(exact_size_is_empty)]
1514
#![feature(let_chains)]
16-
#![feature(map_try_insert)]
17-
#![feature(min_specialization)]
1815
#![feature(slice_ptr_get)]
19-
#![feature(option_get_or_insert_default)]
2016
#![feature(never_type)]
2117
#![feature(trait_alias)]
22-
#![feature(trusted_len)]
23-
#![feature(trusted_step)]
2418
#![feature(try_blocks)]
2519
#![feature(yeet_expr)]
2620
#![feature(if_let_guard)]
27-
#![recursion_limit = "256"]
2821

2922
#[macro_use]
3023
extern crate tracing;

compiler/rustc_data_structures/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#![feature(allocator_api)]
1919
#![feature(array_windows)]
2020
#![feature(auto_traits)]
21-
#![feature(cell_leak)]
2221
#![feature(cfg_match)]
2322
#![feature(core_intrinsics)]
2423
#![feature(extend_one)]

compiler/rustc_driver_impl/src/lib.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@
99
#![feature(rustdoc_internals)]
1010
#![allow(internal_features)]
1111
#![feature(decl_macro)]
12-
#![feature(lazy_cell)]
1312
#![feature(let_chains)]
1413
#![feature(panic_update_hook)]
1514
#![feature(result_flattening)]
16-
#![recursion_limit = "256"]
1715
#![deny(rustc::untranslatable_diagnostic)]
1816
#![deny(rustc::diagnostic_outside_of_impl)]
1917

@@ -35,7 +33,7 @@ use rustc_lint::unerased_lint_store;
3533
use rustc_metadata::creader::MetadataLoader;
3634
use rustc_metadata::locator;
3735
use rustc_session::config::{nightly_options, CG_OPTIONS, Z_OPTIONS};
38-
use rustc_session::config::{ErrorOutputType, Input, OutFileName, OutputType, TrimmedDefPaths};
36+
use rustc_session::config::{ErrorOutputType, Input, OutFileName, OutputType};
3937
use rustc_session::getopts::{self, Matches};
4038
use rustc_session::lint::{Lint, LintId};
4139
use rustc_session::{config, EarlyDiagCtxt, Session};
@@ -204,7 +202,7 @@ impl Callbacks for TimePassesCallbacks {
204202
//
205203
self.time_passes = (config.opts.prints.is_empty() && config.opts.unstable_opts.time_passes)
206204
.then(|| config.opts.unstable_opts.time_passes_format);
207-
config.opts.trimmed_def_paths = TrimmedDefPaths::GoodPath;
205+
config.opts.trimmed_def_paths = true;
208206
}
209207
}
210208

compiler/rustc_error_messages/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![doc(rust_logo)]
22
#![feature(rustdoc_internals)]
3-
#![feature(let_chains)]
43
#![feature(lazy_cell)]
54
#![feature(rustc_attrs)]
65
#![feature(type_alias_impl_trait)]

compiler/rustc_errors/src/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,14 @@
88
#![feature(array_windows)]
99
#![feature(associated_type_defaults)]
1010
#![feature(box_into_inner)]
11+
#![feature(box_patterns)]
1112
#![feature(extract_if)]
12-
#![feature(if_let_guard)]
1313
#![feature(let_chains)]
1414
#![feature(negative_impls)]
1515
#![feature(never_type)]
1616
#![feature(rustc_attrs)]
1717
#![feature(yeet_expr)]
1818
#![feature(try_blocks)]
19-
#![feature(box_patterns)]
2019
#![feature(error_reporter)]
2120
#![allow(incomplete_features)]
2221
#![allow(internal_features)]

compiler/rustc_expand/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
#![feature(proc_macro_diagnostic)]
1010
#![feature(proc_macro_internals)]
1111
#![feature(proc_macro_span)]
12-
#![feature(rustc_attrs)]
1312
#![feature(try_blocks)]
14-
#![recursion_limit = "256"]
1513
#![deny(rustc::untranslatable_diagnostic)]
1614
#![allow(internal_features)]
1715

compiler/rustc_hir/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#![feature(never_type)]
1010
#![feature(rustc_attrs)]
1111
#![feature(variant_count)]
12-
#![recursion_limit = "256"]
1312
#![deny(rustc::untranslatable_diagnostic)]
1413
#![deny(rustc::diagnostic_outside_of_impl)]
1514
#![allow(internal_features)]

compiler/rustc_hir_analysis/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ doctest = false
99

1010
[dependencies]
1111
# tidy-alphabetical-start
12+
itertools = "0.11"
1213
rustc_arena = { path = "../rustc_arena" }
1314
rustc_ast = { path = "../rustc_ast" }
1415
rustc_attr = { path = "../rustc_attr" }

compiler/rustc_hir_analysis/src/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ This API is completely unstable and subject to change.
6060
#![doc(rust_logo)]
6161
#![feature(rustdoc_internals)]
6262
#![allow(internal_features)]
63-
#![feature(box_patterns)]
6463
#![feature(control_flow_enum)]
6564
#![feature(if_let_guard)]
6665
#![feature(is_sorted)]
@@ -71,8 +70,6 @@ This API is completely unstable and subject to change.
7170
#![feature(lazy_cell)]
7271
#![feature(slice_partition_dedup)]
7372
#![feature(try_blocks)]
74-
#![feature(type_alias_impl_trait)]
75-
#![recursion_limit = "256"]
7673

7774
#[macro_use]
7875
extern crate tracing;

compiler/rustc_hir_analysis/src/variance/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//!
44
//! [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/variance.html
55
6+
use itertools::Itertools;
67
use rustc_arena::DroplessArena;
78
use rustc_hir::def::DefKind;
89
use rustc_hir::def_id::{DefId, LocalDefId};
@@ -91,7 +92,7 @@ fn variance_of_opaque(tcx: TyCtxt<'_>, item_def_id: LocalDefId) -> &[ty::Varianc
9192
fn visit_opaque(&mut self, def_id: DefId, args: GenericArgsRef<'tcx>) -> ControlFlow<!> {
9293
if def_id != self.root_def_id && self.tcx.is_descendant_of(def_id, self.root_def_id) {
9394
let child_variances = self.tcx.variances_of(def_id);
94-
for (a, v) in args.iter().zip(child_variances) {
95+
for (a, v) in args.iter().zip_eq(child_variances) {
9596
if *v != ty::Bivariant {
9697
a.visit_with(self)?;
9798
}

compiler/rustc_hir_typeck/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ edition = "2021"
55

66
[dependencies]
77
# tidy-alphabetical-start
8+
itertools = "0.11"
89
rustc_ast = { path = "../rustc_ast" }
910
rustc_attr = { path = "../rustc_attr" }
1011
rustc_data_structures = { path = "../rustc_data_structures" }

compiler/rustc_hir_typeck/src/autoderef.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
use super::method::MethodCallee;
33
use super::{FnCtxt, PlaceOp};
44

5+
use itertools::Itertools;
56
use rustc_hir_analysis::autoderef::{Autoderef, AutoderefKind};
67
use rustc_infer::infer::InferOk;
78
use rustc_middle::ty::adjustment::{Adjust, Adjustment, OverloadedDeref};
@@ -32,8 +33,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
3233
&self,
3334
autoderef: &Autoderef<'a, 'tcx>,
3435
) -> InferOk<'tcx, Vec<Adjustment<'tcx>>> {
35-
let mut obligations = vec![];
3636
let steps = autoderef.steps();
37+
if steps.is_empty() {
38+
return InferOk { obligations: vec![], value: vec![] };
39+
}
40+
41+
let mut obligations = vec![];
3742
let targets =
3843
steps.iter().skip(1).map(|&(ty, _)| ty).chain(iter::once(autoderef.final_ty(false)));
3944
let steps: Vec<_> = steps
@@ -54,7 +59,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
5459
None
5560
}
5661
})
57-
.zip(targets)
62+
.zip_eq(targets)
5863
.map(|(autoderef, target)| Adjustment { kind: Adjust::Deref(autoderef), target })
5964
.collect();
6065

compiler/rustc_hir_typeck/src/check.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ pub(super) fn check_fn<'a, 'tcx>(
7373
let inputs_fn = fn_sig.inputs().iter().copied();
7474
for (idx, (param_ty, param)) in inputs_fn.chain(maybe_va_list).zip(body.params).enumerate() {
7575
// Check the pattern.
76-
let ty: Option<&hir::Ty<'_>> = try { inputs_hir?.get(idx)? };
76+
let ty: Option<&hir::Ty<'_>> = inputs_hir.and_then(|h| h.get(idx));
7777
let ty_span = ty.map(|ty| ty.span);
7878
fcx.check_pat_top(param.pat, param_ty, ty_span, None, None);
7979

compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use crate::{
99
struct_span_code_err, BreakableCtxt, Diverges, Expectation, FnCtxt, Needs, RawTy,
1010
TupleArgumentsFlag,
1111
};
12+
use itertools::Itertools;
1213
use rustc_ast as ast;
1314
use rustc_data_structures::fx::FxIndexSet;
1415
use rustc_errors::{
@@ -421,7 +422,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
421422
formal_input_tys
422423
.iter()
423424
.copied()
424-
.zip(expected_input_tys.iter().copied())
425+
.zip_eq(expected_input_tys.iter().copied())
425426
.map(|vars| self.resolve_vars_if_possible(vars)),
426427
);
427428

compiler/rustc_hir_typeck/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#![feature(box_patterns)]
66
#![feature(min_specialization)]
77
#![feature(control_flow_enum)]
8-
#![recursion_limit = "256"]
98

109
#[macro_use]
1110
extern crate tracing;

compiler/rustc_incremental/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#![doc(rust_logo)]
66
#![feature(rustdoc_internals)]
77
#![allow(internal_features)]
8-
#![recursion_limit = "256"]
98
#![deny(rustc::untranslatable_diagnostic)]
109
#![deny(rustc::diagnostic_outside_of_impl)]
1110

compiler/rustc_index/src/lib.rs

+2-9
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,9 @@
22
#![deny(rustc::diagnostic_outside_of_impl)]
33
#![cfg_attr(
44
feature = "nightly",
5-
feature(
6-
allow_internal_unstable,
7-
extend_one,
8-
min_specialization,
9-
new_uninit,
10-
step_trait,
11-
stmt_expr_attributes,
12-
test
13-
)
5+
feature(extend_one, min_specialization, new_uninit, step_trait, test)
146
)]
7+
#![cfg_attr(all(feature = "nightly", test), feature(stmt_expr_attributes))]
158
#![cfg_attr(feature = "nightly", allow(internal_features))]
169

1710
pub mod bit_set;

compiler/rustc_index_macros/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ mod newtype;
3939
feature = "nightly",
4040
allow_internal_unstable(step_trait, rustc_attrs, trusted_step, spec_option_partial_eq)
4141
)]
42+
// FIXME: Remove the above comment about `min_specialization` once bootstrap is bumped,
43+
// and the corresponding one on SpecOptionPartialEq
44+
#[cfg_attr(all(feature = "nightly", not(bootstrap)), allow_internal_unstable(min_specialization))]
4245
pub fn newtype_index(input: TokenStream) -> TokenStream {
4346
newtype::newtype(input)
4447
}

0 commit comments

Comments
 (0)