Skip to content

Commit ad31ee3

Browse files
committed
Auto merge of #124960 - matthiaskrgr:rollup-xrohkox, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #124551 (Add benchmarks for `impl Debug for str`) - #124914 (Remove `#[macro_use] extern crate rustc middle` from numerous crates) - #124915 (`rustc_target` cleanups) - #124918 (Eliminate some `FIXME(lcnr)` comments) - #124927 (opt-dist: use xz2 instead of xz crate) - #124936 (analyse visitor: build proof tree in probe) - #124943 (always use `GenericArgsRef`) Failed merges: - #124955 (Use fewer origins when creating type variables.) r? `@ghost` `@rustbot` modify labels: rollup
2 parents a6e87c5 + 3439a87 commit ad31ee3

File tree

234 files changed

+516
-214
lines changed

Some content is hidden

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

234 files changed

+516
-214
lines changed

Cargo.lock

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2760,7 +2760,7 @@ dependencies = [
27602760
"tabled",
27612761
"tar",
27622762
"tempfile",
2763-
"xz",
2763+
"xz2",
27642764
"zip",
27652765
]
27662766

@@ -6586,15 +6586,6 @@ dependencies = [
65866586
"rustix",
65876587
]
65886588

6589-
[[package]]
6590-
name = "xz"
6591-
version = "0.1.0"
6592-
source = "registry+https://github.com/rust-lang/crates.io-index"
6593-
checksum = "3c887690ff2a2e233e8e49633461521f98ec57fbff9d59a884c9a4f04ec1da34"
6594-
dependencies = [
6595-
"xz2",
6596-
]
6597-
65986589
[[package]]
65996590
name = "xz2"
66006591
version = "0.1.7"

compiler/rustc_borrowck/src/renumber.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ pub fn renumber_mir<'tcx>(
2626
renumberer.visit_body(body);
2727
}
2828

29-
// FIXME(@lcnr): A lot of these variants overlap and it seems like
30-
// this type is only used to decide which region should be used
31-
// as representative. This should be cleaned up.
29+
// The fields are used only for debugging output in `sccs_info`.
3230
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
3331
pub(crate) enum RegionCtxt {
3432
Location(Location),

compiler/rustc_const_eval/src/const_eval/dummy_machine.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
use crate::interpret::{self, HasStaticRootDefId, ImmTy, Immediate, InterpCx, PointerArithmetic};
1+
use crate::interpret::{
2+
self, throw_machine_stop, HasStaticRootDefId, ImmTy, Immediate, InterpCx, PointerArithmetic,
3+
};
24
use rustc_middle::mir::interpret::{AllocId, ConstAllocation, InterpResult};
35
use rustc_middle::mir::*;
46
use rustc_middle::query::TyCtxtAt;
57
use rustc_middle::ty;
68
use rustc_middle::ty::layout::TyAndLayout;
9+
use rustc_middle::{bug, span_bug};
710
use rustc_span::def_id::DefId;
811

912
/// Macro for machine-specific `InterpError` without allocation.

compiler/rustc_const_eval/src/const_eval/error.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use rustc_span::{Span, Symbol};
1111

1212
use super::CompileTimeInterpreter;
1313
use crate::errors::{self, FrameNote, ReportErrorExt};
14+
use crate::interpret::{err_inval, err_machine_stop};
1415
use crate::interpret::{ErrorHandled, Frame, InterpError, InterpErrorInfo, MachineStopType};
1516

1617
/// The CTFE machine has some custom error kinds.

compiler/rustc_const_eval/src/const_eval/eval_queries.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use std::sync::atomic::Ordering::Relaxed;
33
use either::{Left, Right};
44

55
use rustc_hir::def::DefKind;
6+
use rustc_middle::bug;
67
use rustc_middle::mir::interpret::{AllocId, ErrorHandled, InterpErrorInfo};
78
use rustc_middle::mir::{self, ConstAlloc, ConstValue};
89
use rustc_middle::query::TyCtxtAt;
@@ -24,7 +25,7 @@ use crate::interpret::{
2425
InternKind, InterpCx, InterpError, InterpResult, MPlaceTy, MemoryKind, OpTy, RefTracking,
2526
StackPopCleanup,
2627
};
27-
use crate::interpret::{eval_nullary_intrinsic, InternResult};
28+
use crate::interpret::{eval_nullary_intrinsic, throw_exhaust, InternResult};
2829
use crate::CTRL_C_RECEIVED;
2930

3031
// Returns a pointer to where the result lives

compiler/rustc_const_eval/src/const_eval/machine.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use rustc_hir::def::DefKind;
1010
use rustc_hir::def_id::DefId;
1111
use rustc_hir::def_id::LocalDefId;
1212
use rustc_hir::LangItem;
13+
use rustc_middle::bug;
1314
use rustc_middle::mir;
1415
use rustc_middle::mir::AssertMessage;
1516
use rustc_middle::query::TyCtxtAt;
@@ -24,8 +25,9 @@ use rustc_target::spec::abi::Abi as CallAbi;
2425
use crate::errors::{LongRunning, LongRunningWarn};
2526
use crate::fluent_generated as fluent;
2627
use crate::interpret::{
27-
self, compile_time_machine, AllocId, AllocRange, ConstAllocation, CtfeProvenance, FnArg, FnVal,
28-
Frame, ImmTy, InterpCx, InterpResult, MPlaceTy, OpTy, Pointer, PointerArithmetic, Scalar,
28+
self, compile_time_machine, err_ub, throw_exhaust, throw_inval, throw_ub_custom,
29+
throw_unsup_format, AllocId, AllocRange, ConstAllocation, CtfeProvenance, FnArg, FnVal, Frame,
30+
ImmTy, InterpCx, InterpResult, MPlaceTy, OpTy, Pointer, PointerArithmetic, Scalar,
2931
};
3032

3133
use super::error::*;

compiler/rustc_const_eval/src/const_eval/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Not in interpret to make sure we do not use private implementation details
22

3+
use rustc_middle::bug;
34
use rustc_middle::mir;
45
use rustc_middle::mir::interpret::InterpErrorInfo;
56
use rustc_middle::query::{Key, TyCtxtAt};

compiler/rustc_const_eval/src/const_eval/valtrees.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use rustc_data_structures::stack::ensure_sufficient_stack;
2+
use rustc_middle::bug;
23
use rustc_middle::mir;
34
use rustc_middle::mir::interpret::{EvalToValTreeResult, GlobalId};
45
use rustc_middle::ty::layout::{LayoutCx, LayoutOf, TyAndLayout};

compiler/rustc_const_eval/src/interpret/cast.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ use rustc_middle::mir::CastKind;
77
use rustc_middle::ty::adjustment::PointerCoercion;
88
use rustc_middle::ty::layout::{IntegerExt, LayoutOf, TyAndLayout};
99
use rustc_middle::ty::{self, FloatTy, Ty};
10+
use rustc_middle::{bug, span_bug};
1011
use rustc_target::abi::Integer;
1112
use rustc_type_ir::TyKind::*;
1213

1314
use super::{
14-
util::ensure_monomorphic_enough, FnVal, ImmTy, Immediate, InterpCx, Machine, OpTy, PlaceTy,
15+
err_inval, throw_ub, throw_ub_custom, util::ensure_monomorphic_enough, FnVal, ImmTy, Immediate,
16+
InterpCx, Machine, OpTy, PlaceTy,
1517
};
1618

1719
use crate::fluent_generated as fluent;

compiler/rustc_const_eval/src/interpret/discriminant.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
//! Functions for reading and writing discriminants of multi-variant layouts (enums and coroutines).
22
33
use rustc_middle::mir;
4+
use rustc_middle::span_bug;
45
use rustc_middle::ty::layout::{LayoutOf, PrimitiveExt};
56
use rustc_middle::ty::{self, ScalarInt, Ty};
67
use rustc_target::abi::{self, TagEncoding};
78
use rustc_target::abi::{VariantIdx, Variants};
89

9-
use super::{ImmTy, InterpCx, InterpResult, Machine, Readable, Scalar, Writeable};
10+
use super::{
11+
err_ub, throw_ub, ImmTy, InterpCx, InterpResult, Machine, Readable, Scalar, Writeable,
12+
};
1013

1114
impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
1215
/// Writes the discriminant of the given variant.

0 commit comments

Comments
 (0)