Skip to content

Commit 933bdbc

Browse files
committed
Auto merge of rust-lang#3183 - rust-lang:rustup-2023-11-23, r=RalfJung
Automatic Rustup
2 parents 41d7012 + 03f19ab commit 933bdbc

File tree

515 files changed

+3079
-2558
lines changed

Some content is hidden

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

515 files changed

+3079
-2558
lines changed

Cargo.lock

+3-10
Original file line numberDiff line numberDiff line change
@@ -2060,9 +2060,9 @@ dependencies = [
20602060

20612061
[[package]]
20622062
name = "itertools"
2063-
version = "0.10.5"
2063+
version = "0.11.0"
20642064
source = "registry+https://github.com/rust-lang/crates.io-index"
2065-
checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473"
2065+
checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57"
20662066
dependencies = [
20672067
"either",
20682068
]
@@ -3471,6 +3471,7 @@ dependencies = [
34713471
name = "rustc_ast_pretty"
34723472
version = "0.0.0"
34733473
dependencies = [
3474+
"itertools",
34743475
"rustc_ast",
34753476
"rustc_span",
34763477
"thin-vec",
@@ -3523,7 +3524,6 @@ dependencies = [
35233524
"rustc_macros",
35243525
"rustc_middle",
35253526
"rustc_mir_dataflow",
3526-
"rustc_serialize",
35273527
"rustc_session",
35283528
"rustc_span",
35293529
"rustc_target",
@@ -3934,7 +3934,6 @@ dependencies = [
39343934
"rustc_lint",
39353935
"rustc_macros",
39363936
"rustc_middle",
3937-
"rustc_serialize",
39383937
"rustc_session",
39393938
"rustc_span",
39403939
"rustc_target",
@@ -3997,7 +3996,6 @@ dependencies = [
39973996
"rustc_index",
39983997
"rustc_macros",
39993998
"rustc_middle",
4000-
"rustc_serialize",
40013999
"rustc_span",
40024000
"rustc_target",
40034001
"smallvec",
@@ -4215,7 +4213,6 @@ dependencies = [
42154213
"rustc_infer",
42164214
"rustc_macros",
42174215
"rustc_middle",
4218-
"rustc_serialize",
42194216
"rustc_session",
42204217
"rustc_span",
42214218
"rustc_target",
@@ -4239,7 +4236,6 @@ dependencies = [
42394236
"rustc_index",
42404237
"rustc_macros",
42414238
"rustc_middle",
4242-
"rustc_serialize",
42434239
"rustc_span",
42444240
"rustc_target",
42454241
"smallvec",
@@ -4266,7 +4262,6 @@ dependencies = [
42664262
"rustc_middle",
42674263
"rustc_mir_build",
42684264
"rustc_mir_dataflow",
4269-
"rustc_serialize",
42704265
"rustc_session",
42714266
"rustc_span",
42724267
"rustc_target",
@@ -4340,7 +4335,6 @@ dependencies = [
43404335
"rustc_lexer",
43414336
"rustc_macros",
43424337
"rustc_middle",
4343-
"rustc_serialize",
43444338
"rustc_session",
43454339
"rustc_span",
43464340
"rustc_target",
@@ -4564,7 +4558,6 @@ dependencies = [
45644558
"rustc_middle",
45654559
"rustc_parse_format",
45664560
"rustc_query_system",
4567-
"rustc_serialize",
45684561
"rustc_session",
45694562
"rustc_span",
45704563
"rustc_target",

compiler/rustc_abi/src/layout.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ pub trait LayoutCalculator {
111111
alt_tail_space,
112112
layout.fields.count(),
113113
prefer_alt_layout,
114-
format_field_niches(&layout, &fields, &dl),
115-
format_field_niches(&alt_layout, &fields, &dl),
114+
format_field_niches(layout, fields, dl),
115+
format_field_niches(&alt_layout, fields, dl),
116116
);
117117

118118
if prefer_alt_layout {
@@ -1025,7 +1025,7 @@ fn univariant<
10251025
// At the bottom of this function, we invert `inverse_memory_index` to
10261026
// produce `memory_index` (see `invert_mapping`).
10271027
let mut sized = true;
1028-
let mut offsets = IndexVec::from_elem(Size::ZERO, &fields);
1028+
let mut offsets = IndexVec::from_elem(Size::ZERO, fields);
10291029
let mut offset = Size::ZERO;
10301030
let mut largest_niche = None;
10311031
let mut largest_niche_available = 0;

compiler/rustc_ast/src/ast.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2574,7 +2574,7 @@ pub enum AttrStyle {
25742574
}
25752575

25762576
rustc_index::newtype_index! {
2577-
#[custom_encodable]
2577+
#[orderable]
25782578
#[debug_format = "AttrId({})"]
25792579
pub struct AttrId {}
25802580
}

compiler/rustc_ast/src/attr/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ impl MetaItemKind {
391391
MetaItemKind::name_value_from_tokens(&mut inner_tokens.trees())
392392
}
393393
Some(TokenTree::Token(token, _)) => {
394-
MetaItemLit::from_token(&token).map(MetaItemKind::NameValue)
394+
MetaItemLit::from_token(token).map(MetaItemKind::NameValue)
395395
}
396396
_ => None,
397397
}

compiler/rustc_ast/src/node_id.rs

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ rustc_index::newtype_index! {
88
/// This is later turned into [`DefId`] and `HirId` for the HIR.
99
///
1010
/// [`DefId`]: rustc_span::def_id::DefId
11+
#[encodable]
12+
#[orderable]
1113
#[debug_format = "NodeId({})"]
1214
pub struct NodeId {
1315
/// The [`NodeId`] used to represent the root of the crate.

compiler/rustc_ast_lowering/src/expr.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
959959
e
960960
});
961961
let coroutine_option =
962-
this.coroutine_movability_for_fn(&decl, fn_decl_span, coroutine_kind, movability);
962+
this.coroutine_movability_for_fn(decl, fn_decl_span, coroutine_kind, movability);
963963
this.current_item = prev;
964964
(body_id, coroutine_option)
965965
});
@@ -1057,7 +1057,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
10571057
let body_id = this.lower_fn_body(&outer_decl, |this| {
10581058
let async_ret_ty = if let FnRetTy::Ty(ty) = &decl.output {
10591059
let itctx = ImplTraitContext::Disallowed(ImplTraitPosition::AsyncBlock);
1060-
Some(hir::FnRetTy::Return(this.lower_ty(&ty, &itctx)))
1060+
Some(hir::FnRetTy::Return(this.lower_ty(ty, &itctx)))
10611061
} else {
10621062
None
10631063
};
@@ -1156,7 +1156,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
11561156
.alloc_from_iter(std::iter::once(destructure_let).chain(assignments.into_iter()));
11571157

11581158
// Wrap everything in a block.
1159-
hir::ExprKind::Block(&self.block_all(whole_span, stmts, None), None)
1159+
hir::ExprKind::Block(self.block_all(whole_span, stmts, None), None)
11601160
}
11611161

11621162
/// If the given expression is a path to a tuple struct, returns that path.
@@ -1413,7 +1413,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
14131413
let fields = self.arena.alloc_from_iter(
14141414
e1.iter().map(|e| (sym::start, e)).chain(e2.iter().map(|e| (sym::end, e))).map(
14151415
|(s, e)| {
1416-
let expr = self.lower_expr(&e);
1416+
let expr = self.lower_expr(e);
14171417
let ident = Ident::new(s, self.lower_span(e.span));
14181418
self.expr_field(ident, expr, e.span)
14191419
},

compiler/rustc_ast_lowering/src/format.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,8 @@ fn make_format_spec<'hir>(
338338
| ((debug_hex == Some(FormatDebugHex::Lower)) as u32) << 4
339339
| ((debug_hex == Some(FormatDebugHex::Upper)) as u32) << 5;
340340
let flags = ctx.expr_u32(sp, flags);
341-
let precision = make_count(ctx, sp, &precision, argmap);
342-
let width = make_count(ctx, sp, &width, argmap);
341+
let precision = make_count(ctx, sp, precision, argmap);
342+
let width = make_count(ctx, sp, width, argmap);
343343
let format_placeholder_new = ctx.arena.alloc(ctx.expr_lang_item_type_relative(
344344
sp,
345345
hir::LangItem::FormatPlaceholder,

compiler/rustc_ast_lowering/src/index.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub(super) fn index_hir<'hir>(
4747

4848
match item {
4949
OwnerNode::Crate(citem) => {
50-
collector.visit_mod(&citem, citem.spans.inner_span, hir::CRATE_HIR_ID)
50+
collector.visit_mod(citem, citem.spans.inner_span, hir::CRATE_HIR_ID)
5151
}
5252
OwnerNode::Item(item) => collector.visit_item(item),
5353
OwnerNode::TraitItem(item) => collector.visit_trait_item(item),

compiler/rustc_ast_lowering/src/item.rs

+6-11
Original file line numberDiff line numberDiff line change
@@ -276,19 +276,14 @@ impl<'hir> LoweringContext<'_, 'hir> {
276276
// only cares about the input argument patterns in the function
277277
// declaration (decl), not the return types.
278278
let asyncness = header.asyncness;
279-
let body_id = this.lower_maybe_async_body(
280-
span,
281-
hir_id,
282-
&decl,
283-
asyncness,
284-
body.as_deref(),
285-
);
279+
let body_id =
280+
this.lower_maybe_async_body(span, hir_id, decl, asyncness, body.as_deref());
286281

287282
let itctx = ImplTraitContext::Universal;
288283
let (generics, decl) =
289284
this.lower_generics(generics, header.constness, id, &itctx, |this| {
290285
let ret_id = asyncness.opt_return_id();
291-
this.lower_fn_decl(&decl, id, *fn_sig_span, FnDeclKind::Fn, ret_id)
286+
this.lower_fn_decl(decl, id, *fn_sig_span, FnDeclKind::Fn, ret_id)
292287
});
293288
let sig = hir::FnSig {
294289
decl,
@@ -744,7 +739,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
744739
let (generics, kind, has_default) = match &i.kind {
745740
AssocItemKind::Const(box ConstItem { generics, ty, expr, .. }) => {
746741
let (generics, kind) = self.lower_generics(
747-
&generics,
742+
generics,
748743
Const::No,
749744
i.id,
750745
&ImplTraitContext::Disallowed(ImplTraitPosition::Generic),
@@ -775,7 +770,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
775770
AssocItemKind::Fn(box Fn { sig, generics, body: Some(body), .. }) => {
776771
let asyncness = sig.header.asyncness;
777772
let body_id =
778-
self.lower_maybe_async_body(i.span, hir_id, &sig.decl, asyncness, Some(&body));
773+
self.lower_maybe_async_body(i.span, hir_id, &sig.decl, asyncness, Some(body));
779774
let (generics, sig) = self.lower_method_sig(
780775
generics,
781776
sig,
@@ -857,7 +852,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
857852

858853
let (generics, kind) = match &i.kind {
859854
AssocItemKind::Const(box ConstItem { generics, ty, expr, .. }) => self.lower_generics(
860-
&generics,
855+
generics,
861856
Const::No,
862857
i.id,
863858
&ImplTraitContext::Disallowed(ImplTraitPosition::Generic),

compiler/rustc_ast_lowering/src/lib.rs

+7-9
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
11571157
itctx: &ImplTraitContext,
11581158
) -> hir::GenericArg<'hir> {
11591159
match arg {
1160-
ast::GenericArg::Lifetime(lt) => GenericArg::Lifetime(self.lower_lifetime(&lt)),
1160+
ast::GenericArg::Lifetime(lt) => GenericArg::Lifetime(self.lower_lifetime(lt)),
11611161
ast::GenericArg::Type(ty) => {
11621162
match &ty.kind {
11631163
TyKind::Infer if self.tcx.features().generic_arg_infer => {
@@ -1221,10 +1221,10 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
12211221
}
12221222
_ => {}
12231223
}
1224-
GenericArg::Type(self.lower_ty(&ty, itctx))
1224+
GenericArg::Type(self.lower_ty(ty, itctx))
12251225
}
12261226
ast::GenericArg::Const(ct) => GenericArg::Const(ConstArg {
1227-
value: self.lower_anon_const(&ct),
1227+
value: self.lower_anon_const(ct),
12281228
span: self.lower_span(ct.value.span),
12291229
is_desugared_from_effects: false,
12301230
}),
@@ -1267,7 +1267,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
12671267
let lifetime_bound = this.elided_dyn_bound(t.span);
12681268
(bounds, lifetime_bound)
12691269
});
1270-
let kind = hir::TyKind::TraitObject(bounds, &lifetime_bound, TraitObjectSyntax::None);
1270+
let kind = hir::TyKind::TraitObject(bounds, lifetime_bound, TraitObjectSyntax::None);
12711271
return hir::Ty { kind, span: self.lower_span(t.span), hir_id: self.next_id() };
12721272
}
12731273

@@ -1551,7 +1551,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
15511551
// in fn return position, like the `fn test<'a>() -> impl Debug + 'a`
15521552
// example, we only need to duplicate lifetimes that appear in the
15531553
// bounds, since those are the only ones that are captured by the opaque.
1554-
lifetime_collector::lifetimes_in_bounds(&self.resolver, bounds)
1554+
lifetime_collector::lifetimes_in_bounds(self.resolver, bounds)
15551555
}
15561556
}
15571557
hir::OpaqueTyOrigin::AsyncFn(..) => {
@@ -2067,10 +2067,8 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
20672067
(hir::ParamName::Plain(self.lower_ident(param.ident)), kind)
20682068
}
20692069
GenericParamKind::Const { ty, kw_span: _, default } => {
2070-
let ty = self.lower_ty(
2071-
&ty,
2072-
&ImplTraitContext::Disallowed(ImplTraitPosition::GenericDefault),
2073-
);
2070+
let ty = self
2071+
.lower_ty(ty, &ImplTraitContext::Disallowed(ImplTraitPosition::GenericDefault));
20742072
let default = default.as_ref().map(|def| self.lower_anon_const(def));
20752073
(
20762074
hir::ParamName::Plain(self.lower_ident(param.ident)),

compiler/rustc_ast_lowering/src/path.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -372,10 +372,10 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
372372
// ```
373373
FnRetTy::Ty(ty) if matches!(itctx, ImplTraitContext::ReturnPositionOpaqueTy { .. }) => {
374374
if self.tcx.features().impl_trait_in_fn_trait_return {
375-
self.lower_ty(&ty, itctx)
375+
self.lower_ty(ty, itctx)
376376
} else {
377377
self.lower_ty(
378-
&ty,
378+
ty,
379379
&ImplTraitContext::FeatureGated(
380380
ImplTraitPosition::FnTraitReturn,
381381
sym::impl_trait_in_fn_trait_return,
@@ -384,7 +384,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
384384
}
385385
}
386386
FnRetTy::Ty(ty) => {
387-
self.lower_ty(&ty, &ImplTraitContext::Disallowed(ImplTraitPosition::FnTraitReturn))
387+
self.lower_ty(ty, &ImplTraitContext::Disallowed(ImplTraitPosition::FnTraitReturn))
388388
}
389389
FnRetTy::Default(_) => self.arena.alloc(self.ty_tup(*span, &[])),
390390
};

compiler/rustc_ast_passes/Cargo.toml

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

66
[dependencies]
77
# tidy-alphabetical-start
8-
itertools = "0.10.1"
8+
itertools = "0.11"
99
rustc_ast = { path = "../rustc_ast" }
1010
rustc_ast_pretty = { path = "../rustc_ast_pretty" }
1111
rustc_attr = { path = "../rustc_attr" }

compiler/rustc_ast_passes/src/ast_validation.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ impl<'a> AstValidator<'a> {
221221
}
222222

223223
fn err_handler(&self) -> &rustc_errors::Handler {
224-
&self.session.diagnostic()
224+
self.session.diagnostic()
225225
}
226226

227227
fn check_lifetime(&self, ident: Ident) {
@@ -622,7 +622,7 @@ impl<'a> AstValidator<'a> {
622622
data: data.span,
623623
constraint_spans: errors::EmptyLabelManySpans(constraint_spans),
624624
arg_spans2: errors::EmptyLabelManySpans(arg_spans),
625-
suggestion: self.correct_generic_order_suggestion(&data),
625+
suggestion: self.correct_generic_order_suggestion(data),
626626
constraint_len,
627627
args_len,
628628
});
@@ -738,7 +738,7 @@ fn validate_generic_param_order(
738738

739739
if !bounds.is_empty() {
740740
ordered_params += ": ";
741-
ordered_params += &pprust::bounds_to_string(&bounds);
741+
ordered_params += &pprust::bounds_to_string(bounds);
742742
}
743743

744744
match kind {

compiler/rustc_ast_passes/src/feature_gate.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ impl<'a> PostExpansionVisitor<'a> {
8888
}
8989
}
9090

91-
match abi::is_enabled(&self.features, span, symbol_unescaped.as_str()) {
91+
match abi::is_enabled(self.features, span, symbol_unescaped.as_str()) {
9292
Ok(()) => (),
9393
Err(abi::AbiDisabled::Unstable { feature, explain }) => {
9494
feature_err_issue(
@@ -182,7 +182,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
182182
..
183183
}) = attr_info
184184
{
185-
gate_alt!(self, has_feature(&self.features), *name, attr.span, *descr);
185+
gate_alt!(self, has_feature(self.features), *name, attr.span, *descr);
186186
}
187187
// Check unstable flavors of the `#[doc]` attribute.
188188
if attr.has_name(sym::doc) {
@@ -300,7 +300,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
300300
}
301301

302302
ast::ItemKind::TyAlias(box ast::TyAlias { ty: Some(ty), .. }) => {
303-
self.check_impl_trait(&ty, false)
303+
self.check_impl_trait(ty, false)
304304
}
305305

306306
_ => {}

compiler/rustc_ast_pretty/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_span = { path = "../rustc_span" }
1011
thin-vec = "0.2.12"

compiler/rustc_ast_pretty/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
#![doc(rust_logo)]
44
#![deny(rustc::untranslatable_diagnostic)]
55
#![deny(rustc::diagnostic_outside_of_impl)]
6-
#![feature(associated_type_bounds)]
76
#![feature(box_patterns)]
8-
#![feature(with_negative_coherence)]
97
#![recursion_limit = "256"]
108

119
mod helpers;

0 commit comments

Comments
 (0)