Skip to content

Commit e5038e2

Browse files
committed
Auto merge of #91455 - matthiaskrgr:rollup-gix2hy6, r=matthiaskrgr
Rollup of 4 iffy pull requests Successful merges: - #89234 (Disallow non-c-like but "fieldless" ADTs from being casted to integer if they use arbitrary enum discriminant) - #91045 (Issue 90702 fix: Stop treating some crate loading failures as fatal errors) - #91394 (Bump stage0 compiler) - #91411 (Enable svh tests on msvc) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 18bb8c6 + 822a058 commit e5038e2

File tree

69 files changed

+713
-599
lines changed

Some content is hidden

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

69 files changed

+713
-599
lines changed

compiler/rustc_attr/src/builtin.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,8 +519,10 @@ pub fn eval_condition(
519519
[NestedMetaItem::Literal(Lit { kind: LitKind::Str(sym, ..), span, .. })] => {
520520
(sym, span)
521521
}
522-
[NestedMetaItem::Literal(Lit { span, .. })
523-
| NestedMetaItem::MetaItem(MetaItem { span, .. })] => {
522+
[
523+
NestedMetaItem::Literal(Lit { span, .. })
524+
| NestedMetaItem::MetaItem(MetaItem { span, .. }),
525+
] => {
524526
sess.span_diagnostic
525527
.struct_span_err(*span, "expected a version literal")
526528
.emit();

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -977,9 +977,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
977977
Some(ref name),
978978
BorrowExplanation::MustBeValidFor {
979979
category:
980-
category
981-
@
982-
(ConstraintCategory::Return(_)
980+
category @ (ConstraintCategory::Return(_)
983981
| ConstraintCategory::CallArgument
984982
| ConstraintCategory::OpaqueType),
985983
from_closure: false,

compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,13 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
165165
PlaceRef {
166166
local: _,
167167
projection:
168-
[.., ProjectionElem::Index(_)
169-
| ProjectionElem::ConstantIndex { .. }
170-
| ProjectionElem::Subslice { .. }
171-
| ProjectionElem::Downcast(..)],
168+
[
169+
..,
170+
ProjectionElem::Index(_)
171+
| ProjectionElem::ConstantIndex { .. }
172+
| ProjectionElem::Subslice { .. }
173+
| ProjectionElem::Downcast(..),
174+
],
172175
} => bug!("Unexpected immutable place."),
173176
}
174177

@@ -217,7 +220,12 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
217220
PlaceRef {
218221
local,
219222
projection:
220-
[proj_base @ .., ProjectionElem::Deref, ProjectionElem::Field(field, _), ProjectionElem::Deref],
223+
[
224+
proj_base @ ..,
225+
ProjectionElem::Deref,
226+
ProjectionElem::Field(field, _),
227+
ProjectionElem::Deref,
228+
],
221229
} => {
222230
err.span_label(span, format!("cannot {ACT}", ACT = act));
223231

@@ -763,11 +771,14 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
763771
kind:
764772
Call(
765773
_,
766-
[Expr {
767-
kind: MethodCall(path_segment, ..),
768-
hir_id,
769-
..
770-
}, ..],
774+
[
775+
Expr {
776+
kind: MethodCall(path_segment, ..),
777+
hir_id,
778+
..
779+
},
780+
..,
781+
],
771782
),
772783
..
773784
},

compiler/rustc_borrowck/src/diagnostics/region_name.rs

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -769,20 +769,24 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
769769
let opaque_ty = hir.item(id);
770770
if let hir::ItemKind::OpaqueTy(hir::OpaqueTy {
771771
bounds:
772-
[hir::GenericBound::LangItemTrait(
773-
hir::LangItem::Future,
774-
_,
775-
_,
776-
hir::GenericArgs {
777-
bindings:
778-
[hir::TypeBinding {
779-
ident: Ident { name: sym::Output, .. },
780-
kind: hir::TypeBindingKind::Equality { ty },
781-
..
782-
}],
783-
..
784-
},
785-
)],
772+
[
773+
hir::GenericBound::LangItemTrait(
774+
hir::LangItem::Future,
775+
_,
776+
_,
777+
hir::GenericArgs {
778+
bindings:
779+
[
780+
hir::TypeBinding {
781+
ident: Ident { name: sym::Output, .. },
782+
kind: hir::TypeBindingKind::Equality { ty },
783+
..
784+
},
785+
],
786+
..
787+
},
788+
),
789+
],
786790
..
787791
}) = opaque_ty.kind
788792
{

compiler/rustc_borrowck/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#![feature(bool_to_option)]
44
#![feature(box_patterns)]
55
#![feature(crate_visibility_modifier)]
6-
#![cfg_attr(bootstrap, feature(format_args_capture))]
76
#![feature(in_band_lifetimes)]
87
#![feature(iter_zip)]
98
#![feature(let_else)]

compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,14 +1525,12 @@ fn generator_layout_and_saved_local_names(
15251525
// Deref of the `Pin<&mut Self>` state argument.
15261526
mir::ProjectionElem::Field(..),
15271527
mir::ProjectionElem::Deref,
1528-
15291528
// Field of a variant of the state.
15301529
mir::ProjectionElem::Downcast(_, variant),
15311530
mir::ProjectionElem::Field(field, _),
15321531
] => {
1533-
let name = &mut generator_saved_local_names[
1534-
generator_layout.variant_fields[variant][field]
1535-
];
1532+
let name = &mut generator_saved_local_names
1533+
[generator_layout.variant_fields[variant][field]];
15361534
if name.is_none() {
15371535
name.replace(var.name);
15381536
}

compiler/rustc_errors/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#![feature(crate_visibility_modifier)]
77
#![feature(backtrace)]
88
#![feature(if_let_guard)]
9-
#![cfg_attr(bootstrap, feature(format_args_capture))]
109
#![feature(iter_zip)]
1110
#![feature(let_else)]
1211
#![feature(nll)]

compiler/rustc_expand/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#![feature(crate_visibility_modifier)]
22
#![feature(decl_macro)]
33
#![feature(destructuring_assignment)]
4-
#![cfg_attr(bootstrap, feature(format_args_capture))]
54
#![feature(if_let_guard)]
65
#![feature(iter_zip)]
76
#![feature(let_else)]

compiler/rustc_expand/src/mbe/macro_parser.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -584,9 +584,7 @@ fn inner_parse_loop<'root, 'tt>(
584584
//
585585
// At the beginning of the loop, if we reach the end of the delimited submatcher,
586586
// we pop the stack to backtrack out of the descent.
587-
seq
588-
@
589-
(TokenTree::Delimited(..)
587+
seq @ (TokenTree::Delimited(..)
590588
| TokenTree::Token(Token { kind: DocComment(..), .. })) => {
591589
let lower_elts = mem::replace(&mut item.top_elts, Tt(seq));
592590
let idx = item.idx;

compiler/rustc_expand/src/parse/tests.rs

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,24 +65,33 @@ fn string_to_tts_macro() {
6565
let tts: &[TokenTree] = &tts[..];
6666

6767
match tts {
68-
[TokenTree::Token(Token { kind: token::Ident(name_macro_rules, false), .. }), TokenTree::Token(Token { kind: token::Not, .. }), TokenTree::Token(Token { kind: token::Ident(name_zip, false), .. }), TokenTree::Delimited(_, macro_delim, macro_tts)]
69-
if name_macro_rules == &kw::MacroRules && name_zip.as_str() == "zip" =>
70-
{
68+
[
69+
TokenTree::Token(Token { kind: token::Ident(name_macro_rules, false), .. }),
70+
TokenTree::Token(Token { kind: token::Not, .. }),
71+
TokenTree::Token(Token { kind: token::Ident(name_zip, false), .. }),
72+
TokenTree::Delimited(_, macro_delim, macro_tts),
73+
] if name_macro_rules == &kw::MacroRules && name_zip.as_str() == "zip" => {
7174
let tts = &macro_tts.trees().collect::<Vec<_>>();
7275
match &tts[..] {
73-
[TokenTree::Delimited(_, first_delim, first_tts), TokenTree::Token(Token { kind: token::FatArrow, .. }), TokenTree::Delimited(_, second_delim, second_tts)]
74-
if macro_delim == &token::Paren =>
75-
{
76+
[
77+
TokenTree::Delimited(_, first_delim, first_tts),
78+
TokenTree::Token(Token { kind: token::FatArrow, .. }),
79+
TokenTree::Delimited(_, second_delim, second_tts),
80+
] if macro_delim == &token::Paren => {
7681
let tts = &first_tts.trees().collect::<Vec<_>>();
7782
match &tts[..] {
78-
[TokenTree::Token(Token { kind: token::Dollar, .. }), TokenTree::Token(Token { kind: token::Ident(name, false), .. })]
79-
if first_delim == &token::Paren && name.as_str() == "a" => {}
83+
[
84+
TokenTree::Token(Token { kind: token::Dollar, .. }),
85+
TokenTree::Token(Token { kind: token::Ident(name, false), .. }),
86+
] if first_delim == &token::Paren && name.as_str() == "a" => {}
8087
_ => panic!("value 3: {:?} {:?}", first_delim, first_tts),
8188
}
8289
let tts = &second_tts.trees().collect::<Vec<_>>();
8390
match &tts[..] {
84-
[TokenTree::Token(Token { kind: token::Dollar, .. }), TokenTree::Token(Token { kind: token::Ident(name, false), .. })]
85-
if second_delim == &token::Paren && name.as_str() == "a" => {}
91+
[
92+
TokenTree::Token(Token { kind: token::Dollar, .. }),
93+
TokenTree::Token(Token { kind: token::Ident(name, false), .. }),
94+
] if second_delim == &token::Paren && name.as_str() == "a" => {}
8695
_ => panic!("value 4: {:?} {:?}", second_delim, second_tts),
8796
}
8897
}

0 commit comments

Comments
 (0)