Skip to content

Commit 6d4dd6e

Browse files
committed
Auto merge of #2723 - RalfJung:rustup, r=RalfJung
Rustup
2 parents 17b5fda + f25d8a6 commit 6d4dd6e

File tree

430 files changed

+7532
-3557
lines changed

Some content is hidden

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

430 files changed

+7532
-3557
lines changed

Cargo.lock

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4168,6 +4168,7 @@ dependencies = [
41684168
name = "rustc_parse_format"
41694169
version = "0.0.0"
41704170
dependencies = [
4171+
"rustc_data_structures",
41714172
"rustc_lexer",
41724173
]
41734174

@@ -4342,6 +4343,7 @@ dependencies = [
43424343
"rustc_feature",
43434344
"rustc_fs_util",
43444345
"rustc_hir",
4346+
"rustc_index",
43454347
"rustc_lint_defs",
43464348
"rustc_macros",
43474349
"rustc_serialize",
@@ -4402,6 +4404,7 @@ dependencies = [
44024404
"rustc_span",
44034405
"rustc_target",
44044406
"tracing",
4407+
"twox-hash",
44054408
]
44064409

44074410
[[package]]
@@ -5392,6 +5395,17 @@ dependencies = [
53925395
"tracing-subscriber",
53935396
]
53945397

5398+
[[package]]
5399+
name = "twox-hash"
5400+
version = "1.6.3"
5401+
source = "registry+https://github.com/rust-lang/crates.io-index"
5402+
checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675"
5403+
dependencies = [
5404+
"cfg-if 1.0.0",
5405+
"rand 0.8.5",
5406+
"static_assertions",
5407+
]
5408+
53955409
[[package]]
53965410
name = "type-map"
53975411
version = "0.4.0"

compiler/rustc_borrowck/src/invalidation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ impl<'cx, 'tcx> Visitor<'tcx> for InvalidationGenerator<'cx, 'tcx> {
106106
self.check_activations(location);
107107

108108
match &terminator.kind {
109-
TerminatorKind::SwitchInt { discr, switch_ty: _, targets: _ } => {
109+
TerminatorKind::SwitchInt { discr, targets: _ } => {
110110
self.consume_operand(location, discr);
111111
}
112112
TerminatorKind::Drop { place: drop_place, target: _, unwind: _ } => {

compiler/rustc_borrowck/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ impl<'cx, 'tcx> rustc_mir_dataflow::ResultsVisitor<'cx, 'tcx> for MirBorrowckCtx
644644
self.check_activations(loc, span, flow_state);
645645

646646
match &term.kind {
647-
TerminatorKind::SwitchInt { discr, switch_ty: _, targets: _ } => {
647+
TerminatorKind::SwitchInt { discr, targets: _ } => {
648648
self.consume_operand(loc, (discr, span), flow_state);
649649
}
650650
TerminatorKind::Drop { place, target: _, unwind: _ } => {

compiler/rustc_borrowck/src/type_check/mod.rs

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,25 +1360,10 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
13601360
);
13611361
}
13621362
}
1363-
TerminatorKind::SwitchInt { discr, switch_ty, .. } => {
1363+
TerminatorKind::SwitchInt { discr, .. } => {
13641364
self.check_operand(discr, term_location);
13651365

1366-
let discr_ty = discr.ty(body, tcx);
1367-
if let Err(terr) = self.sub_types(
1368-
discr_ty,
1369-
*switch_ty,
1370-
term_location.to_locations(),
1371-
ConstraintCategory::Assignment,
1372-
) {
1373-
span_mirbug!(
1374-
self,
1375-
term,
1376-
"bad SwitchInt ({:?} on {:?}): {:?}",
1377-
switch_ty,
1378-
discr_ty,
1379-
terr
1380-
);
1381-
}
1366+
let switch_ty = discr.ty(body, tcx);
13821367
if !switch_ty.is_integral() && !switch_ty.is_char() && !switch_ty.is_bool() {
13831368
span_mirbug!(self, term, "bad SwitchInt discr ty {:?}", switch_ty);
13841369
}

compiler/rustc_builtin_macros/src/concat.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub fn expand_concat(
1111
sp: rustc_span::Span,
1212
tts: TokenStream,
1313
) -> Box<dyn base::MacResult + 'static> {
14-
let Some(es) = base::get_exprs_from_tts(cx, sp, tts) else {
14+
let Some(es) = base::get_exprs_from_tts(cx, tts) else {
1515
return DummyResult::any(sp);
1616
};
1717
let mut accumulator = String::new();

compiler/rustc_builtin_macros/src/concat_bytes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ pub fn expand_concat_bytes(
137137
sp: rustc_span::Span,
138138
tts: TokenStream,
139139
) -> Box<dyn base::MacResult + 'static> {
140-
let Some(es) = base::get_exprs_from_tts(cx, sp, tts) else {
140+
let Some(es) = base::get_exprs_from_tts(cx, tts) else {
141141
return DummyResult::any(sp);
142142
};
143143
let mut accumulator = Vec::new();

compiler/rustc_builtin_macros/src/env.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub fn expand_env<'cx>(
5252
sp: Span,
5353
tts: TokenStream,
5454
) -> Box<dyn base::MacResult + 'cx> {
55-
let mut exprs = match get_exprs_from_tts(cx, sp, tts) {
55+
let mut exprs = match get_exprs_from_tts(cx, tts) {
5656
Some(exprs) if exprs.is_empty() => {
5757
cx.span_err(sp, "env! takes 1 or 2 arguments");
5858
return DummyResult::any(sp);

compiler/rustc_builtin_macros/src/format.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ pub fn make_format_args(
333333
parse::Piece::String(s) => {
334334
unfinished_literal.push_str(s);
335335
}
336-
parse::Piece::NextArgument(parse::Argument { position, position_span, format }) => {
336+
parse::Piece::NextArgument(box parse::Argument { position, position_span, format }) => {
337337
if !unfinished_literal.is_empty() {
338338
template.push(FormatArgsPiece::Literal(Symbol::intern(&unfinished_literal)));
339339
unfinished_literal.clear();

compiler/rustc_codegen_cranelift/src/base.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,10 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
372372
}
373373
}
374374

375-
TerminatorKind::SwitchInt { discr, switch_ty, targets } => {
376-
let discr = codegen_operand(fx, discr).load_scalar(fx);
375+
TerminatorKind::SwitchInt { discr, targets } => {
376+
let discr = codegen_operand(fx, discr);
377+
let switch_ty = discr.layout().ty;
378+
let discr = discr.load_scalar(fx);
377379

378380
let use_bool_opt = switch_ty.kind() == fx.tcx.types.bool.kind()
379381
|| (targets.iter().count() == 1 && targets.iter().next().unwrap().0 == 0);

compiler/rustc_codegen_gcc/src/type_.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,4 +300,8 @@ impl<'gcc, 'tcx> TypeMembershipMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
300300
// Unsupported.
301301
self.context.new_rvalue_from_int(self.int_type, 0)
302302
}
303+
304+
fn set_kcfi_type_metadata(&self, _function: RValue<'gcc>, _kcfi_typeid: u32) {
305+
// Unsupported.
306+
}
303307
}

0 commit comments

Comments
 (0)