Skip to content

Commit 02ee564

Browse files
committed
Auto merge of rust-lang#3320 - RalfJung:rustup, r=RalfJung
Rustup Let's see if rust-lang#121114 gets perf back to the old level.
2 parents 9577051 + 8704286 commit 02ee564

File tree

2,259 files changed

+11222
-8732
lines changed

Some content is hidden

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

2,259 files changed

+11222
-8732
lines changed

Diff for: .git-blame-ignore-revs

+3
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@ f97fddab91fbf290ea5b691fe355d6f915220b6e
2020
cc907f80b95c6ec530c5ee1b05b044a468f07eca
2121
# format let-chains
2222
b2d2184edea578109a48ec3d8decbee5948e8f35
23+
# test directives migration
24+
6e48b96692d63a79a14563f27fe5185f122434f8
25+
ec2cc761bc7067712ecc7734502f703fe3b024c8

Diff for: Cargo.lock

+10-34
Original file line numberDiff line numberDiff line change
@@ -1224,19 +1224,6 @@ dependencies = [
12241224
"regex",
12251225
]
12261226

1227-
[[package]]
1228-
name = "env_logger"
1229-
version = "0.10.2"
1230-
source = "registry+https://github.com/rust-lang/crates.io-index"
1231-
checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580"
1232-
dependencies = [
1233-
"humantime",
1234-
"is-terminal",
1235-
"log",
1236-
"regex",
1237-
"termcolor",
1238-
]
1239-
12401227
[[package]]
12411228
name = "env_logger"
12421229
version = "0.11.2"
@@ -2058,17 +2045,6 @@ version = "2.9.0"
20582045
source = "registry+https://github.com/rust-lang/crates.io-index"
20592046
checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3"
20602047

2061-
[[package]]
2062-
name = "is-terminal"
2063-
version = "0.4.12"
2064-
source = "registry+https://github.com/rust-lang/crates.io-index"
2065-
checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b"
2066-
dependencies = [
2067-
"hermit-abi",
2068-
"libc",
2069-
"windows-sys 0.52.0",
2070-
]
2071-
20722048
[[package]]
20732049
name = "itertools"
20742050
version = "0.11.0"
@@ -2364,7 +2340,7 @@ dependencies = [
23642340
"clap",
23652341
"clap_complete",
23662342
"elasticlunr-rs",
2367-
"env_logger 0.11.2",
2343+
"env_logger",
23682344
"handlebars",
23692345
"log",
23702346
"memchr",
@@ -2709,7 +2685,7 @@ dependencies = [
27092685
"camino",
27102686
"clap",
27112687
"derive_builder",
2712-
"env_logger 0.10.2",
2688+
"env_logger",
27132689
"fs_extra",
27142690
"glob",
27152691
"humansize",
@@ -2788,9 +2764,9 @@ dependencies = [
27882764

27892765
[[package]]
27902766
name = "papergrid"
2791-
version = "0.10.0"
2767+
version = "0.11.0"
27922768
source = "registry+https://github.com/rust-lang/crates.io-index"
2793-
checksum = "a2ccbe15f2b6db62f9a9871642746427e297b0ceb85f9a7f1ee5ff47d184d0c8"
2769+
checksum = "9ad43c07024ef767f9160710b3a6773976194758c7919b17e63b863db0bdf7fb"
27942770
dependencies = [
27952771
"bytecount",
27962772
"fnv",
@@ -3326,7 +3302,7 @@ name = "rustbook"
33263302
version = "0.1.0"
33273303
dependencies = [
33283304
"clap",
3329-
"env_logger 0.10.2",
3305+
"env_logger",
33303306
"mdbook",
33313307
]
33323308

@@ -5271,16 +5247,16 @@ dependencies = [
52715247

52725248
[[package]]
52735249
name = "sysinfo"
5274-
version = "0.29.11"
5250+
version = "0.30.5"
52755251
source = "registry+https://github.com/rust-lang/crates.io-index"
5276-
checksum = "cd727fc423c2060f6c92d9534cef765c65a6ed3f428a03d7def74a8c4348e666"
5252+
checksum = "1fb4f3438c8f6389c864e61221cbc97e9bca98b4daf39a5beb7bea660f528bb2"
52775253
dependencies = [
52785254
"cfg-if",
52795255
"core-foundation-sys",
52805256
"libc",
52815257
"ntapi",
52825258
"once_cell",
5283-
"winapi",
5259+
"windows",
52845260
]
52855261

52865262
[[package]]
@@ -5315,9 +5291,9 @@ dependencies = [
53155291

53165292
[[package]]
53175293
name = "tabled"
5318-
version = "0.13.0"
5294+
version = "0.15.0"
53195295
source = "registry+https://github.com/rust-lang/crates.io-index"
5320-
checksum = "4d38d39c754ae037a9bc3ca1580a985db7371cd14f1229172d1db9093feb6739"
5296+
checksum = "4c998b0c8b921495196a48aabaf1901ff28be0760136e31604f7967b0792050e"
53215297
dependencies = [
53225298
"papergrid",
53235299
"unicode-width",

Diff for: compiler/rustc_ast_lowering/src/delegation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
138138
} else {
139139
self.tcx.fn_arg_names(sig_id).len()
140140
};
141-
let inputs = self.arena.alloc_from_iter((0..args_count).into_iter().map(|arg| hir::Ty {
141+
let inputs = self.arena.alloc_from_iter((0..args_count).map(|arg| hir::Ty {
142142
hir_id: self.next_id(),
143143
kind: hir::TyKind::InferDelegation(sig_id, hir::InferDelegationKind::Input(arg)),
144144
span: self.lower_span(param_span),

Diff for: compiler/rustc_ast_lowering/src/lib.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1636,7 +1636,9 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
16361636
if let Some(old_def_id) = self.orig_opt_local_def_id(param) {
16371637
old_def_id
16381638
} else {
1639-
self.dcx().span_bug(lifetime.ident.span, "no def-id for fresh lifetime");
1639+
self.dcx()
1640+
.span_delayed_bug(lifetime.ident.span, "no def-id for fresh lifetime");
1641+
continue;
16401642
}
16411643
}
16421644

Diff for: compiler/rustc_borrowck/messages.ftl

+7-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,13 @@ borrowck_returned_lifetime_wrong =
163163
borrowck_returned_ref_escaped =
164164
returns a reference to a captured variable which escapes the closure body
165165
166-
borrowck_simd_shuffle_last_const = last argument of `simd_shuffle` is required to be a `const` item
166+
borrowck_simd_intrinsic_arg_const =
167+
{$arg ->
168+
[1] 1st
169+
[2] 2nd
170+
[3] 3rd
171+
*[other] {$arg}th
172+
} argument of `{$intrinsic}` is required to be a `const` item
167173
168174
borrowck_suggest_create_freash_reborrow =
169175
consider reborrowing the `Pin` instead of moving it

Diff for: compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1559,7 +1559,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
15591559
// A bare path doesn't need a `let` assignment, it's already a simple
15601560
// binding access.
15611561
// As a new binding wasn't added, we don't need to modify the advancing call.
1562-
sugg.push((loop_span.with_hi(pat_span.lo()), format!("while let Some(")));
1562+
sugg.push((loop_span.with_hi(pat_span.lo()), "while let Some(".to_string()));
15631563
sugg.push((
15641564
pat_span.shrink_to_hi().with_hi(head.span.lo()),
15651565
") = ".to_string(),

Diff for: compiler/rustc_borrowck/src/diagnostics/outlives_suggestion.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -134,14 +134,13 @@ impl OutlivesSuggestionBuilder {
134134

135135
for (r, bound) in unified.into_iter() {
136136
if !unified_already.contains(fr) {
137-
suggested.push(SuggestedConstraint::Equal(fr_name.clone(), bound));
137+
suggested.push(SuggestedConstraint::Equal(fr_name, bound));
138138
unified_already.insert(r);
139139
}
140140
}
141141

142142
if !other.is_empty() {
143-
let other =
144-
other.iter().map(|(_, rname)| rname.clone()).collect::<SmallVec<_>>();
143+
let other = other.iter().map(|(_, rname)| *rname).collect::<SmallVec<_>>();
145144
suggested.push(SuggestedConstraint::Outlives(fr_name, other))
146145
}
147146
}

Diff for: compiler/rustc_borrowck/src/diagnostics/region_errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
280280
.iter()
281281
.rfind(|param| param.def_id.to_def_id() == defid)
282282
.is_some() {
283-
suggestions.push((bounded_span.shrink_to_hi(), format!(" + 'static")));
283+
suggestions.push((bounded_span.shrink_to_hi(), " + 'static".to_string()));
284284
}
285285
});
286286
});

Diff for: compiler/rustc_borrowck/src/region_infer/opaque_types.rs

+8-6
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,14 @@ impl<'tcx> RegionInferenceContext<'tcx> {
153153
if let Some(prev) = result.get_mut(&opaque_type_key.def_id) {
154154
if prev.ty != ty {
155155
let guar = ty.error_reported().err().unwrap_or_else(|| {
156-
prev.report_mismatch(
157-
&OpaqueHiddenType { ty, span: concrete_type.span },
158-
opaque_type_key.def_id,
159-
infcx.tcx,
160-
)
161-
.emit()
156+
let (Ok(e) | Err(e)) = prev
157+
.build_mismatch_error(
158+
&OpaqueHiddenType { ty, span: concrete_type.span },
159+
opaque_type_key.def_id,
160+
infcx.tcx,
161+
)
162+
.map(|d| d.emit());
163+
e
162164
});
163165
prev.ty = Ty::new_error(infcx.tcx, guar);
164166
}

Diff for: compiler/rustc_borrowck/src/session_diagnostics.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,10 @@ pub(crate) enum TypeNoCopy<'a, 'tcx> {
454454
}
455455

456456
#[derive(Diagnostic)]
457-
#[diag(borrowck_simd_shuffle_last_const)]
458-
pub(crate) struct SimdShuffleLastConst {
457+
#[diag(borrowck_simd_intrinsic_arg_const)]
458+
pub(crate) struct SimdIntrinsicArgConst {
459459
#[primary_span]
460460
pub span: Span,
461+
pub arg: usize,
462+
pub intrinsic: String,
461463
}

Diff for: compiler/rustc_borrowck/src/type_check/mod.rs

+17-4
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ use rustc_mir_dataflow::impls::MaybeInitializedPlaces;
4949
use rustc_mir_dataflow::move_paths::MoveData;
5050
use rustc_mir_dataflow::ResultsCursor;
5151

52-
use crate::session_diagnostics::{MoveUnsized, SimdShuffleLastConst};
52+
use crate::session_diagnostics::{MoveUnsized, SimdIntrinsicArgConst};
5353
use crate::{
5454
borrow_set::BorrowSet,
5555
constraints::{OutlivesConstraint, OutlivesConstraintSet},
@@ -1664,9 +1664,22 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
16641664

16651665
let func_ty = func.ty(body, self.infcx.tcx);
16661666
if let ty::FnDef(def_id, _) = *func_ty.kind() {
1667-
if let Some(sym::simd_shuffle) = self.tcx().intrinsic(def_id) {
1668-
if !matches!(args[2], Spanned { node: Operand::Constant(_), .. }) {
1669-
self.tcx().dcx().emit_err(SimdShuffleLastConst { span: term.source_info.span });
1667+
// Some of the SIMD intrinsics are special: they need a particular argument to be a constant.
1668+
// (Eventually this should use const-generics, but those are not up for the task yet:
1669+
// https://github.com/rust-lang/rust/issues/85229.)
1670+
if let Some(name @ (sym::simd_shuffle | sym::simd_insert | sym::simd_extract)) =
1671+
self.tcx().intrinsic(def_id)
1672+
{
1673+
let idx = match name {
1674+
sym::simd_shuffle => 2,
1675+
_ => 1,
1676+
};
1677+
if !matches!(args[idx], Spanned { node: Operand::Constant(_), .. }) {
1678+
self.tcx().dcx().emit_err(SimdIntrinsicArgConst {
1679+
span: term.source_info.span,
1680+
arg: idx + 1,
1681+
intrinsic: name.to_string(),
1682+
});
16701683
}
16711684
}
16721685
}

Diff for: compiler/rustc_borrowck/src/type_check/relate_tys.rs

+9-5
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,11 @@ impl<'me, 'bccx, 'tcx> NllTypeRelating<'me, 'bccx, 'tcx> {
123123
// `handle_opaque_type` cannot handle subtyping, so to support subtyping
124124
// we instead eagerly generalize here. This is a bit of a mess but will go
125125
// away once we're using the new solver.
126-
let mut enable_subtyping = |ty, ty_is_expected| {
126+
//
127+
// Given `opaque rel B`, we create a new infer var `ty_vid` constrain it
128+
// by using `ty_vid rel B` and then finally and end by equating `ty_vid` to
129+
// the opaque.
130+
let mut enable_subtyping = |ty, opaque_is_expected| {
127131
let ty_vid = infcx.next_ty_var_id_in_universe(
128132
TypeVariableOrigin {
129133
kind: TypeVariableOriginKind::MiscVariable,
@@ -132,15 +136,15 @@ impl<'me, 'bccx, 'tcx> NllTypeRelating<'me, 'bccx, 'tcx> {
132136
ty::UniverseIndex::ROOT,
133137
);
134138

135-
let variance = if ty_is_expected {
139+
let variance = if opaque_is_expected {
136140
self.ambient_variance
137141
} else {
138142
self.ambient_variance.xform(ty::Contravariant)
139143
};
140144

141145
self.type_checker.infcx.instantiate_ty_var(
142146
self,
143-
ty_is_expected,
147+
opaque_is_expected,
144148
ty_vid,
145149
variance,
146150
ty,
@@ -149,8 +153,8 @@ impl<'me, 'bccx, 'tcx> NllTypeRelating<'me, 'bccx, 'tcx> {
149153
};
150154

151155
let (a, b) = match (a.kind(), b.kind()) {
152-
(&ty::Alias(ty::Opaque, ..), _) => (a, enable_subtyping(b, false)?),
153-
(_, &ty::Alias(ty::Opaque, ..)) => (enable_subtyping(a, true)?, b),
156+
(&ty::Alias(ty::Opaque, ..), _) => (a, enable_subtyping(b, true)?),
157+
(_, &ty::Alias(ty::Opaque, ..)) => (enable_subtyping(a, false)?, b),
154158
_ => unreachable!(
155159
"expected at least one opaque type in `relate_opaques`, got {a} and {b}."
156160
),

Diff for: compiler/rustc_codegen_cranelift/src/intrinsics/simd.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
743743
simd_reduce(fx, v, None, ret, &|fx, _ty, a, b| fx.bcx.ins().bxor(a, b));
744744
}
745745

746-
sym::simd_reduce_min | sym::simd_reduce_min_nanless => {
746+
sym::simd_reduce_min => {
747747
intrinsic_args!(fx, args => (v); intrinsic);
748748

749749
if !v.layout().ty.is_simd() {
@@ -762,7 +762,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
762762
});
763763
}
764764

765-
sym::simd_reduce_max | sym::simd_reduce_max_nanless => {
765+
sym::simd_reduce_max => {
766766
intrinsic_args!(fx, args => (v); intrinsic);
767767

768768
if !v.layout().ty.is_simd() {

Diff for: compiler/rustc_codegen_gcc/src/builder.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1752,7 +1752,7 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
17521752
self.vector_reduce(src, |a, b, context| context.new_binary_op(None, op, a.get_type(), a, b))
17531753
}
17541754

1755-
pub fn vector_reduce_fadd_fast(&mut self, _acc: RValue<'gcc>, _src: RValue<'gcc>) -> RValue<'gcc> {
1755+
pub fn vector_reduce_fadd_reassoc(&mut self, _acc: RValue<'gcc>, _src: RValue<'gcc>) -> RValue<'gcc> {
17561756
unimplemented!();
17571757
}
17581758

@@ -1772,7 +1772,7 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
17721772
unimplemented!();
17731773
}
17741774

1775-
pub fn vector_reduce_fmul_fast(&mut self, _acc: RValue<'gcc>, _src: RValue<'gcc>) -> RValue<'gcc> {
1775+
pub fn vector_reduce_fmul_reassoc(&mut self, _acc: RValue<'gcc>, _src: RValue<'gcc>) -> RValue<'gcc> {
17761776
unimplemented!();
17771777
}
17781778

Diff for: compiler/rustc_codegen_gcc/src/intrinsic/simd.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -989,14 +989,14 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
989989

990990
arith_red!(
991991
simd_reduce_add_unordered: BinaryOp::Plus,
992-
vector_reduce_fadd_fast,
992+
vector_reduce_fadd_reassoc,
993993
false,
994994
add,
995995
0.0 // TODO: Use this argument.
996996
);
997997
arith_red!(
998998
simd_reduce_mul_unordered: BinaryOp::Mult,
999-
vector_reduce_fmul_fast,
999+
vector_reduce_fmul_reassoc,
10001000
false,
10011001
mul,
10021002
1.0
@@ -1041,9 +1041,6 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
10411041

10421042
minmax_red!(simd_reduce_min: vector_reduce_min, vector_reduce_fmin);
10431043
minmax_red!(simd_reduce_max: vector_reduce_max, vector_reduce_fmax);
1044-
// TODO(sadlerap): revisit these intrinsics to generate more optimal reductions
1045-
minmax_red!(simd_reduce_min_nanless: vector_reduce_min, vector_reduce_fmin);
1046-
minmax_red!(simd_reduce_max_nanless: vector_reduce_max, vector_reduce_fmax);
10471044

10481045
macro_rules! bitwise_red {
10491046
($name:ident : $op:expr, $boolean:expr) => {

Diff for: compiler/rustc_codegen_llvm/src/back/archive.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ fn get_llvm_object_symbols(
313313
llvm::LLVMRustGetSymbols(
314314
buf.as_ptr(),
315315
buf.len(),
316-
&mut *state as *mut &mut _ as *mut c_void,
316+
std::ptr::addr_of_mut!(*state) as *mut c_void,
317317
callback,
318318
error_callback,
319319
)

0 commit comments

Comments
 (0)