Skip to content

Commit 16316a9

Browse files
committed
Auto merge of rust-lang#3371 - rust-lang:rustup-2024-03-10, r=saethlin
Automatic Rustup
2 parents ac968d4 + 2ecfbae commit 16316a9

File tree

163 files changed

+2910
-1110
lines changed

Some content is hidden

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

163 files changed

+2910
-1110
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,10 @@ jobs:
315315
- name: x86_64-gnu-distcheck
316316
os: ubuntu-20.04-8core-32gb
317317
env: {}
318+
- name: x86_64-gnu-llvm-18
319+
env:
320+
RUST_BACKTRACE: 1
321+
os: ubuntu-20.04-8core-32gb
318322
- name: x86_64-gnu-llvm-17
319323
env:
320324
RUST_BACKTRACE: 1

Cargo.lock

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -784,12 +784,6 @@ dependencies = [
784784
"windows-sys 0.52.0",
785785
]
786786

787-
[[package]]
788-
name = "convert_case"
789-
version = "0.4.0"
790-
source = "registry+https://github.com/rust-lang/crates.io-index"
791-
checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e"
792-
793787
[[package]]
794788
name = "core"
795789
version = "0.0.0"
@@ -1035,10 +1029,8 @@ version = "0.99.17"
10351029
source = "registry+https://github.com/rust-lang/crates.io-index"
10361030
checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321"
10371031
dependencies = [
1038-
"convert_case",
10391032
"proc-macro2",
10401033
"quote",
1041-
"rustc_version",
10421034
"syn 1.0.109",
10431035
]
10441036

@@ -3498,7 +3490,7 @@ dependencies = [
34983490
name = "rustc_ast_passes"
34993491
version = "0.0.0"
35003492
dependencies = [
3501-
"itertools 0.11.0",
3493+
"itertools 0.12.1",
35023494
"rustc_ast",
35033495
"rustc_ast_pretty",
35043496
"rustc_attr",
@@ -3518,7 +3510,7 @@ dependencies = [
35183510
name = "rustc_ast_pretty"
35193511
version = "0.0.0"
35203512
dependencies = [
3521-
"itertools 0.11.0",
3513+
"itertools 0.12.1",
35223514
"rustc_ast",
35233515
"rustc_lexer",
35243516
"rustc_span",
@@ -3559,7 +3551,7 @@ name = "rustc_borrowck"
35593551
version = "0.0.0"
35603552
dependencies = [
35613553
"either",
3562-
"itertools 0.11.0",
3554+
"itertools 0.12.1",
35633555
"polonius-engine",
35643556
"rustc_data_structures",
35653557
"rustc_errors",
@@ -3612,7 +3604,7 @@ name = "rustc_codegen_llvm"
36123604
version = "0.0.0"
36133605
dependencies = [
36143606
"bitflags 2.4.2",
3615-
"itertools 0.11.0",
3607+
"itertools 0.12.1",
36163608
"libc",
36173609
"measureme",
36183610
"object",
@@ -3648,7 +3640,7 @@ dependencies = [
36483640
"ar_archive_writer",
36493641
"bitflags 2.4.2",
36503642
"cc",
3651-
"itertools 0.11.0",
3643+
"itertools 0.12.1",
36523644
"jobserver",
36533645
"libc",
36543646
"object",
@@ -3930,7 +3922,7 @@ dependencies = [
39303922
name = "rustc_hir_analysis"
39313923
version = "0.0.0"
39323924
dependencies = [
3933-
"itertools 0.11.0",
3925+
"itertools 0.12.1",
39343926
"rustc_arena",
39353927
"rustc_ast",
39363928
"rustc_attr",
@@ -3969,7 +3961,7 @@ dependencies = [
39693961
name = "rustc_hir_typeck"
39703962
version = "0.0.0"
39713963
dependencies = [
3972-
"itertools 0.11.0",
3964+
"itertools 0.12.1",
39733965
"rustc_ast",
39743966
"rustc_ast_ir",
39753967
"rustc_attr",
@@ -4134,7 +4126,6 @@ dependencies = [
41344126
"rustc_target",
41354127
"rustc_trait_selection",
41364128
"rustc_type_ir",
4137-
"smallvec",
41384129
"tracing",
41394130
"unicode-security",
41404131
]
@@ -4218,7 +4209,6 @@ name = "rustc_middle"
42184209
version = "0.0.0"
42194210
dependencies = [
42204211
"bitflags 2.4.2",
4221-
"derive_more",
42224212
"either",
42234213
"field-offset",
42244214
"gsgdt",
@@ -4256,7 +4246,7 @@ name = "rustc_mir_build"
42564246
version = "0.0.0"
42574247
dependencies = [
42584248
"either",
4259-
"itertools 0.11.0",
4249+
"itertools 0.12.1",
42604250
"rustc_apfloat",
42614251
"rustc_arena",
42624252
"rustc_ast",
@@ -4303,7 +4293,7 @@ name = "rustc_mir_transform"
43034293
version = "0.0.0"
43044294
dependencies = [
43054295
"either",
4306-
"itertools 0.11.0",
4296+
"itertools 0.12.1",
43074297
"rustc_arena",
43084298
"rustc_ast",
43094299
"rustc_attr",
@@ -4383,7 +4373,6 @@ dependencies = [
43834373
name = "rustc_passes"
43844374
version = "0.0.0"
43854375
dependencies = [
4386-
"itertools 0.11.0",
43874376
"rustc_ast",
43884377
"rustc_ast_pretty",
43894378
"rustc_attr",
@@ -4573,6 +4562,7 @@ name = "rustc_span"
45734562
version = "0.0.0"
45744563
dependencies = [
45754564
"indexmap",
4565+
"itoa",
45764566
"md-5",
45774567
"rustc_arena",
45784568
"rustc_data_structures",
@@ -4633,7 +4623,7 @@ name = "rustc_trait_selection"
46334623
version = "0.0.0"
46344624
dependencies = [
46354625
"bitflags 2.4.2",
4636-
"itertools 0.11.0",
4626+
"itertools 0.12.1",
46374627
"rustc_ast",
46384628
"rustc_ast_ir",
46394629
"rustc_attr",
@@ -4673,7 +4663,7 @@ dependencies = [
46734663
name = "rustc_transmute"
46744664
version = "0.0.0"
46754665
dependencies = [
4676-
"itertools 0.11.0",
4666+
"itertools 0.12.1",
46774667
"rustc_ast_ir",
46784668
"rustc_data_structures",
46794669
"rustc_hir",
@@ -4689,7 +4679,7 @@ dependencies = [
46894679
name = "rustc_ty_utils"
46904680
version = "0.0.0"
46914681
dependencies = [
4692-
"itertools 0.11.0",
4682+
"itertools 0.12.1",
46934683
"rustc_ast_ir",
46944684
"rustc_data_structures",
46954685
"rustc_errors",
@@ -4739,7 +4729,7 @@ dependencies = [
47394729
"askama",
47404730
"expect-test",
47414731
"indexmap",
4742-
"itertools 0.11.0",
4732+
"itertools 0.12.1",
47434733
"minifier",
47444734
"once_cell",
47454735
"regex",

compiler/rustc_ast_ir/src/visit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ impl VisitorResult for () {
1414
type Residual = !;
1515

1616
#[cfg(not(feature = "nightly"))]
17-
type Residual = core::ops::Infallible;
17+
type Residual = core::convert::Infallible;
1818

1919
fn output() -> Self {}
2020
fn from_residual(_: Self::Residual) -> Self {}

compiler/rustc_ast_passes/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ edition = "2021"
55

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

compiler/rustc_ast_pretty/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ edition = "2021"
55

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

compiler/rustc_borrowck/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ edition = "2021"
66
[dependencies]
77
# tidy-alphabetical-start
88
either = "1.5.0"
9-
itertools = "0.11"
9+
itertools = "0.12"
1010
polonius-engine = "0.13.0"
1111
rustc_data_structures = { path = "../rustc_data_structures" }
1212
rustc_errors = { path = "../rustc_errors" }

compiler/rustc_borrowck/src/type_check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2000,7 +2000,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
20002000
ConstraintCategory::SizedBound,
20012001
);
20022002
}
2003-
&Rvalue::NullaryOp(NullOp::DebugAssertions, _) => {}
2003+
&Rvalue::NullaryOp(NullOp::UbCheck(_), _) => {}
20042004

20052005
Rvalue::ShallowInitBox(operand, ty) => {
20062006
self.check_operand(operand, location);

compiler/rustc_codegen_cranelift/src/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ fn codegen_stmt<'tcx>(
779779
NullOp::OffsetOf(fields) => {
780780
layout.offset_of_subfield(fx, fields.iter()).bytes()
781781
}
782-
NullOp::DebugAssertions => {
782+
NullOp::UbCheck(_) => {
783783
let val = fx.tcx.sess.opts.debug_assertions;
784784
let val = CValue::by_val(
785785
fx.bcx.ins().iconst(types::I8, i64::try_from(val).unwrap()),

compiler/rustc_codegen_llvm/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ test = false
99
[dependencies]
1010
# tidy-alphabetical-start
1111
bitflags = "2.4.1"
12-
itertools = "0.11"
12+
itertools = "0.12"
1313
libc = "0.2"
1414
measureme = "11"
1515
object = { version = "0.32.0", default-features = false, features = ["std", "read"] }

compiler/rustc_codegen_ssa/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ edition = "2021"
88
ar_archive_writer = "0.1.5"
99
bitflags = "2.4.1"
1010
cc = "1.0.90"
11-
itertools = "0.11"
11+
itertools = "0.12"
1212
jobserver = "0.1.28"
1313
pathdiff = "0.2.0"
1414
regex = "1.4"

compiler/rustc_codegen_ssa/src/mir/rvalue.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,8 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
685685
let val = layout.offset_of_subfield(bx.cx(), fields.iter()).bytes();
686686
bx.cx().const_usize(val)
687687
}
688-
mir::NullOp::DebugAssertions => {
688+
mir::NullOp::UbCheck(_) => {
689+
// In codegen, we want to check for language UB and library UB
689690
let val = bx.tcx().sess.opts.debug_assertions;
690691
bx.cx().const_bool(val)
691692
}

compiler/rustc_const_eval/src/interpret/step.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,16 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
258258
let val = layout.offset_of_subfield(self, fields.iter()).bytes();
259259
Scalar::from_target_usize(val, self)
260260
}
261-
mir::NullOp::DebugAssertions => {
262-
// The checks hidden behind this are always better done by the interpreter
263-
// itself, because it knows the runtime state better.
264-
Scalar::from_bool(false)
261+
mir::NullOp::UbCheck(kind) => {
262+
// We want to enable checks for library UB, because the interpreter doesn't
263+
// know about those on its own.
264+
// But we want to disable checks for language UB, because the interpreter
265+
// has its own better checks for that.
266+
let should_check = match kind {
267+
mir::UbKind::LibraryUb => self.tcx.sess.opts.debug_assertions,
268+
mir::UbKind::LanguageUb => false,
269+
};
270+
Scalar::from_bool(should_check)
265271
}
266272
};
267273
self.write_scalar(val, &dest)?;

compiler/rustc_const_eval/src/interpret/validity.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ use rustc_middle::mir::interpret::{
1717
ExpectedKind, InterpError, InvalidMetaKind, Misalignment, PointerKind, Provenance,
1818
ValidationErrorInfo, ValidationErrorKind, ValidationErrorKind::*,
1919
};
20-
use rustc_middle::ty;
2120
use rustc_middle::ty::layout::{LayoutOf, TyAndLayout};
21+
use rustc_middle::ty::{self, Ty};
2222
use rustc_span::symbol::{sym, Symbol};
2323
use rustc_target::abi::{
2424
Abi, FieldIdx, Scalar as ScalarAbi, Size, VariantIdx, Variants, WrappingRange,
@@ -783,7 +783,11 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValueVisitor<'mir, 'tcx, M>
783783
}
784784

785785
#[inline]
786-
fn visit_box(&mut self, op: &OpTy<'tcx, M::Provenance>) -> InterpResult<'tcx> {
786+
fn visit_box(
787+
&mut self,
788+
_box_ty: Ty<'tcx>,
789+
op: &OpTy<'tcx, M::Provenance>,
790+
) -> InterpResult<'tcx> {
787791
self.check_safe_pointer(op, PointerKind::Box)?;
788792
Ok(())
789793
}

compiler/rustc_const_eval/src/interpret/visitor.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
use rustc_index::IndexVec;
55
use rustc_middle::mir::interpret::InterpResult;
6-
use rustc_middle::ty;
6+
use rustc_middle::ty::{self, Ty};
77
use rustc_target::abi::FieldIdx;
88
use rustc_target::abi::{FieldsShape, VariantIdx, Variants};
99

@@ -47,10 +47,10 @@ pub trait ValueVisitor<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>>: Sized {
4747
Ok(())
4848
}
4949
/// Visits the given value as the pointer of a `Box`. There is nothing to recurse into.
50-
/// The type of `v` will be a raw pointer, but this is a field of `Box<T>` and the
51-
/// pointee type is the actual `T`.
50+
/// The type of `v` will be a raw pointer to `T`, but this is a field of `Box<T>` and the
51+
/// pointee type is the actual `T`. `box_ty` provides the full type of the `Box` itself.
5252
#[inline(always)]
53-
fn visit_box(&mut self, _v: &Self::V) -> InterpResult<'tcx> {
53+
fn visit_box(&mut self, _box_ty: Ty<'tcx>, _v: &Self::V) -> InterpResult<'tcx> {
5454
Ok(())
5555
}
5656

@@ -144,7 +144,7 @@ pub trait ValueVisitor<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>>: Sized {
144144
assert_eq!(nonnull_ptr.layout().fields.count(), 1);
145145
let raw_ptr = self.ecx().project_field(&nonnull_ptr, 0)?; // the actual raw ptr
146146
// ... whose only field finally is a raw ptr we can dereference.
147-
self.visit_box(&raw_ptr)?;
147+
self.visit_box(ty, &raw_ptr)?;
148148

149149
// The second `Box` field is the allocator, which we recursively check for validity
150150
// like in regular structs.

compiler/rustc_const_eval/src/transform/check_consts/check.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
558558
Rvalue::Cast(_, _, _) => {}
559559

560560
Rvalue::NullaryOp(
561-
NullOp::SizeOf | NullOp::AlignOf | NullOp::OffsetOf(_) | NullOp::DebugAssertions,
561+
NullOp::SizeOf | NullOp::AlignOf | NullOp::OffsetOf(_) | NullOp::UbCheck(_),
562562
_,
563563
) => {}
564564
Rvalue::ShallowInitBox(_, _) => {}

compiler/rustc_const_eval/src/transform/validate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
11571157
Rvalue::Repeat(_, _)
11581158
| Rvalue::ThreadLocalRef(_)
11591159
| Rvalue::AddressOf(_, _)
1160-
| Rvalue::NullaryOp(NullOp::SizeOf | NullOp::AlignOf | NullOp::DebugAssertions, _)
1160+
| Rvalue::NullaryOp(NullOp::SizeOf | NullOp::AlignOf | NullOp::UbCheck(_), _)
11611161
| Rvalue::Discriminant(_) => {}
11621162
}
11631163
self.super_rvalue(rvalue, location);

compiler/rustc_driver_impl/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,7 @@ fn list_metadata(early_dcx: &EarlyDiagCtxt, sess: &Session, metadata_loader: &dy
676676
metadata_loader,
677677
&mut v,
678678
&sess.opts.unstable_opts.ls,
679+
sess.cfg_version,
679680
)
680681
.unwrap();
681682
safe_println!("{}", String::from_utf8(v).unwrap());

compiler/rustc_hir_analysis/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ doctest = false
99

1010
[dependencies]
1111
# tidy-alphabetical-start
12-
itertools = "0.11"
12+
itertools = "0.12"
1313
rustc_arena = { path = "../rustc_arena" }
1414
rustc_ast = { path = "../rustc_ast" }
1515
rustc_attr = { path = "../rustc_attr" }

0 commit comments

Comments
 (0)