Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 8ae7c74

Browse files
author
The Miri Conjob Bot
committed
Merge from rustc
2 parents fdbf932 + 42ca6e4 commit 8ae7c74

File tree

394 files changed

+1388
-8718
lines changed

Some content is hidden

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

394 files changed

+1388
-8718
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ jobs:
305305
SCRIPT: "./x.py dist bootstrap --include-default-paths --host=x86_64-apple-darwin --target=x86_64-apple-darwin"
306306
RUST_CONFIGURE_ARGS: "--enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false --set rust.lto=thin"
307307
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
308-
MACOSX_DEPLOYMENT_TARGET: 10.7
308+
MACOSX_DEPLOYMENT_TARGET: 10.12
309309
SELECT_XCODE: /Applications/Xcode_13.4.1.app
310310
NO_LLVM_ASSERTIONS: 1
311311
NO_DEBUG_ASSERTIONS: 1
@@ -317,7 +317,7 @@ jobs:
317317
SCRIPT: "./x.py dist bootstrap --include-default-paths --host='' --target=aarch64-apple-ios,x86_64-apple-ios,aarch64-apple-ios-sim"
318318
RUST_CONFIGURE_ARGS: "--enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false"
319319
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
320-
MACOSX_DEPLOYMENT_TARGET: 10.7
320+
MACOSX_DEPLOYMENT_TARGET: 10.12
321321
SELECT_XCODE: /Applications/Xcode_13.4.1.app
322322
NO_LLVM_ASSERTIONS: 1
323323
NO_DEBUG_ASSERTIONS: 1
@@ -328,8 +328,8 @@ jobs:
328328
SCRIPT: "./x.py --stage 2 test --skip tests/ui --skip tests/rustdoc --skip tests/run-make-fulldeps"
329329
RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false"
330330
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
331-
MACOSX_DEPLOYMENT_TARGET: 10.8
332-
MACOSX_STD_DEPLOYMENT_TARGET: 10.7
331+
MACOSX_DEPLOYMENT_TARGET: 10.12
332+
MACOSX_STD_DEPLOYMENT_TARGET: 10.12
333333
NO_LLVM_ASSERTIONS: 1
334334
NO_DEBUG_ASSERTIONS: 1
335335
NO_OVERFLOW_CHECKS: 1
@@ -339,8 +339,8 @@ jobs:
339339
SCRIPT: "./x.py --stage 2 test tests/ui tests/rustdoc tests/run-make-fulldeps"
340340
RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false"
341341
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
342-
MACOSX_DEPLOYMENT_TARGET: 10.8
343-
MACOSX_STD_DEPLOYMENT_TARGET: 10.7
342+
MACOSX_DEPLOYMENT_TARGET: 10.12
343+
MACOSX_STD_DEPLOYMENT_TARGET: 10.12
344344
NO_LLVM_ASSERTIONS: 1
345345
NO_DEBUG_ASSERTIONS: 1
346346
NO_OVERFLOW_CHECKS: 1

compiler/rustc_codegen_gcc/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ use rustc_errors::{DiagnosticMessage, ErrorGuaranteed, Handler, SubdiagnosticMes
8080
use rustc_fluent_macro::fluent_messages;
8181
use rustc_metadata::EncodedMetadata;
8282
use rustc_middle::dep_graph::{WorkProduct, WorkProductId};
83-
use rustc_middle::query::Providers;
83+
use rustc_middle::util::Providers;
8484
use rustc_middle::ty::TyCtxt;
8585
use rustc_session::config::{Lto, OptLevel, OutputFilenames};
8686
use rustc_session::Session;

compiler/rustc_codegen_llvm/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ use rustc_errors::{DiagnosticMessage, ErrorGuaranteed, FatalError, Handler, Subd
3939
use rustc_fluent_macro::fluent_messages;
4040
use rustc_metadata::EncodedMetadata;
4141
use rustc_middle::dep_graph::{WorkProduct, WorkProductId};
42-
use rustc_middle::query::Providers;
4342
use rustc_middle::ty::TyCtxt;
43+
use rustc_middle::util::Providers;
4444
use rustc_session::config::{OptLevel, OutputFilenames, PrintKind, PrintRequest};
4545
use rustc_session::Session;
4646
use rustc_span::symbol::Symbol;

compiler/rustc_codegen_ssa/src/back/symbol_export.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ use rustc_middle::middle::exported_symbols::{
1111
metadata_symbol_name, ExportedSymbol, SymbolExportInfo, SymbolExportKind, SymbolExportLevel,
1212
};
1313
use rustc_middle::query::LocalCrate;
14-
use rustc_middle::query::{ExternProviders, Providers};
1514
use rustc_middle::ty::Instance;
1615
use rustc_middle::ty::{self, SymbolName, TyCtxt};
1716
use rustc_middle::ty::{GenericArgKind, GenericArgsRef};
17+
use rustc_middle::util::Providers;
1818
use rustc_session::config::{CrateType, OomStrategy};
1919
use rustc_target::spec::SanitizerSet;
2020

@@ -457,11 +457,9 @@ pub fn provide(providers: &mut Providers) {
457457
providers.is_unreachable_local_definition = is_unreachable_local_definition_provider;
458458
providers.upstream_drop_glue_for = upstream_drop_glue_for_provider;
459459
providers.wasm_import_module_map = wasm_import_module_map;
460-
}
461-
462-
pub fn provide_extern(providers: &mut ExternProviders) {
463-
providers.is_reachable_non_generic = is_reachable_non_generic_provider_extern;
464-
providers.upstream_monomorphizations_for = upstream_monomorphizations_for_provider;
460+
providers.extern_queries.is_reachable_non_generic = is_reachable_non_generic_provider_extern;
461+
providers.extern_queries.upstream_monomorphizations_for =
462+
upstream_monomorphizations_for_provider;
465463
}
466464

467465
fn symbol_export_level(tcx: TyCtxt<'_>, sym_def_id: DefId) -> SymbolExportLevel {

compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,6 @@ fn push_debuginfo_type_name<'tcx>(
426426
| ty::Placeholder(..)
427427
| ty::Alias(..)
428428
| ty::Bound(..)
429-
| ty::GeneratorWitnessMIR(..)
430429
| ty::GeneratorWitness(..) => {
431430
bug!(
432431
"debuginfo: Trying to create type name for \

compiler/rustc_codegen_ssa/src/lib.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use rustc_middle::dep_graph::WorkProduct;
3131
use rustc_middle::middle::debugger_visualizer::DebuggerVisualizerFile;
3232
use rustc_middle::middle::dependency_format::Dependencies;
3333
use rustc_middle::middle::exported_symbols::SymbolExportKind;
34-
use rustc_middle::query::{ExternProviders, Providers};
34+
use rustc_middle::util::Providers;
3535
use rustc_serialize::opaque::{FileEncoder, MemDecoder};
3636
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
3737
use rustc_session::config::{CrateType, OutputFilenames, OutputType, RUST_CGU_EXT};
@@ -190,10 +190,6 @@ pub fn provide(providers: &mut Providers) {
190190
crate::codegen_attrs::provide(providers);
191191
}
192192

193-
pub fn provide_extern(providers: &mut ExternProviders) {
194-
crate::back::symbol_export::provide_extern(providers);
195-
}
196-
197193
/// Checks if the given filename ends with the `.rcgu.o` extension that `rustc`
198194
/// uses for the object files it generates.
199195
pub fn looks_like_rust_object_file(filename: &str) -> bool {

compiler/rustc_codegen_ssa/src/mir/debuginfo.rs

Lines changed: 10 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -158,16 +158,15 @@ fn calculate_debuginfo_offset<
158158
L: DebugInfoOffsetLocation<'tcx, Bx>,
159159
>(
160160
bx: &mut Bx,
161-
local: mir::Local,
162-
var: &PerLocalVarDebugInfo<'tcx, Bx::DIVariable>,
161+
projection: &[mir::PlaceElem<'tcx>],
163162
base: L,
164163
) -> DebugInfoOffset<L> {
165164
let mut direct_offset = Size::ZERO;
166165
// FIXME(eddyb) use smallvec here.
167166
let mut indirect_offsets = vec![];
168167
let mut place = base;
169168

170-
for elem in &var.projection[..] {
169+
for elem in projection {
171170
match *elem {
172171
mir::ProjectionElem::Deref => {
173172
indirect_offsets.push(Size::ZERO);
@@ -188,23 +187,15 @@ fn calculate_debuginfo_offset<
188187
} => {
189188
let offset = indirect_offsets.last_mut().unwrap_or(&mut direct_offset);
190189
let FieldsShape::Array { stride, count: _ } = place.layout().fields else {
191-
span_bug!(
192-
var.source_info.span,
193-
"ConstantIndex on non-array type {:?}",
194-
place.layout()
195-
)
190+
bug!("ConstantIndex on non-array type {:?}", place.layout())
196191
};
197192
*offset += stride * index;
198193
place = place.project_constant_index(bx, index);
199194
}
200195
_ => {
201196
// Sanity check for `can_use_in_debuginfo`.
202197
debug_assert!(!elem.can_use_in_debuginfo());
203-
span_bug!(
204-
var.source_info.span,
205-
"unsupported var debuginfo place `{:?}`",
206-
mir::Place { local, projection: var.projection },
207-
)
198+
bug!("unsupported var debuginfo projection `{:?}`", projection)
208199
}
209200
}
210201
}
@@ -407,7 +398,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
407398
let Some(dbg_loc) = self.dbg_loc(var.source_info) else { return };
408399

409400
let DebugInfoOffset { direct_offset, indirect_offsets, result: _ } =
410-
calculate_debuginfo_offset(bx, local, &var, base.layout);
401+
calculate_debuginfo_offset(bx, &var.projection, base.layout);
411402

412403
// When targeting MSVC, create extra allocas for arguments instead of pointing multiple
413404
// dbg_var_addr() calls into the same alloca with offsets. MSVC uses CodeView records
@@ -425,7 +416,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
425416

426417
if should_create_individual_allocas {
427418
let DebugInfoOffset { direct_offset: _, indirect_offsets: _, result: place } =
428-
calculate_debuginfo_offset(bx, local, &var, base);
419+
calculate_debuginfo_offset(bx, &var.projection, base);
429420

430421
// Create a variable which will be a pointer to the actual value
431422
let ptr_ty = Ty::new_ptr(
@@ -532,23 +523,9 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
532523
let fragment = if let Some(ref fragment) = var.composite {
533524
let var_layout = self.cx.layout_of(var_ty);
534525

535-
let mut fragment_start = Size::ZERO;
536-
let mut fragment_layout = var_layout;
537-
538-
for elem in &fragment.projection {
539-
match *elem {
540-
mir::ProjectionElem::Field(field, _) => {
541-
let i = field.index();
542-
fragment_start += fragment_layout.fields.offset(i);
543-
fragment_layout = fragment_layout.field(self.cx, i);
544-
}
545-
_ => span_bug!(
546-
var.source_info.span,
547-
"unsupported fragment projection `{:?}`",
548-
elem,
549-
),
550-
}
551-
}
526+
let DebugInfoOffset { direct_offset, indirect_offsets, result: fragment_layout } =
527+
calculate_debuginfo_offset(bx, &fragment.projection, var_layout);
528+
debug_assert!(indirect_offsets.is_empty());
552529

553530
if fragment_layout.size == Size::ZERO {
554531
// Fragment is a ZST, so does not represent anything. Avoid generating anything
@@ -559,7 +536,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
559536
// DWARF is concerned, it's not really a fragment.
560537
None
561538
} else {
562-
Some(fragment_start..fragment_start + fragment_layout.size)
539+
Some(direct_offset..direct_offset + fragment_layout.size)
563540
}
564541
} else {
565542
None

compiler/rustc_codegen_ssa/src/traits/backend.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ use rustc_data_structures::sync::{DynSend, DynSync};
1111
use rustc_errors::ErrorGuaranteed;
1212
use rustc_metadata::EncodedMetadata;
1313
use rustc_middle::dep_graph::{WorkProduct, WorkProductId};
14-
use rustc_middle::query::{ExternProviders, Providers};
1514
use rustc_middle::ty::layout::{FnAbiOf, HasTyCtxt, LayoutOf, TyAndLayout};
1615
use rustc_middle::ty::{Ty, TyCtxt};
16+
use rustc_middle::util::Providers;
1717
use rustc_session::{
1818
config::{self, OutputFilenames, PrintRequest},
1919
cstore::MetadataLoaderDyn,
@@ -85,7 +85,6 @@ pub trait CodegenBackend {
8585
}
8686

8787
fn provide(&self, _providers: &mut Providers) {}
88-
fn provide_extern(&self, _providers: &mut ExternProviders) {}
8988
fn codegen_crate<'tcx>(
9089
&self,
9190
tcx: TyCtxt<'tcx>,

compiler/rustc_const_eval/src/const_eval/mod.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use crate::errors::MaxNumNodesInConstErr;
44
use crate::interpret::{intern_const_alloc_recursive, InternKind, InterpCx, Scalar};
55
use rustc_middle::mir;
66
use rustc_middle::mir::interpret::{EvalToValTreeResult, GlobalId};
7+
use rustc_middle::query::TyCtxtAt;
78
use rustc_middle::ty::{self, Ty, TyCtxt};
89
use rustc_span::{source_map::DUMMY_SP, symbol::Symbol};
910

@@ -86,17 +87,17 @@ pub(crate) fn eval_to_valtree<'tcx>(
8687

8788
#[instrument(skip(tcx), level = "debug")]
8889
pub(crate) fn try_destructure_mir_constant_for_diagnostics<'tcx>(
89-
tcx: TyCtxt<'tcx>,
90+
tcx: TyCtxtAt<'tcx>,
9091
val: mir::ConstValue<'tcx>,
9192
ty: Ty<'tcx>,
9293
) -> Option<mir::DestructuredConstant<'tcx>> {
9394
let param_env = ty::ParamEnv::reveal_all();
94-
let ecx = mk_eval_cx(tcx, DUMMY_SP, param_env, CanAccessStatics::No);
95+
let ecx = mk_eval_cx(tcx.tcx, tcx.span, param_env, CanAccessStatics::No);
9596
let op = ecx.const_val_to_op(val, ty, None).ok()?;
9697

9798
// We go to `usize` as we cannot allocate anything bigger anyway.
9899
let (field_count, variant, down) = match ty.kind() {
99-
ty::Array(_, len) => (len.eval_target_usize(tcx, param_env) as usize, None, op),
100+
ty::Array(_, len) => (len.eval_target_usize(tcx.tcx, param_env) as usize, None, op),
100101
ty::Adt(def, _) if def.variants().is_empty() => {
101102
return None;
102103
}

compiler/rustc_const_eval/src/const_eval/valtrees.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ pub(crate) fn const_to_valtree_inner<'tcx>(
152152
// FIXME(oli-obk): we can probably encode closures just like structs
153153
| ty::Closure(..)
154154
| ty::Generator(..)
155-
| ty::GeneratorWitness(..) |ty::GeneratorWitnessMIR(..)=> Err(ValTreeCreationError::NonSupportedType),
155+
| ty::GeneratorWitness(..) => Err(ValTreeCreationError::NonSupportedType),
156156
}
157157
}
158158

@@ -280,7 +280,6 @@ pub fn valtree_to_const_value<'tcx>(
280280
| ty::Closure(..)
281281
| ty::Generator(..)
282282
| ty::GeneratorWitness(..)
283-
| ty::GeneratorWitnessMIR(..)
284283
| ty::FnPtr(_)
285284
| ty::RawPtr(_)
286285
| ty::Str

0 commit comments

Comments
 (0)