Skip to content

Commit 7fc7e3f

Browse files
committed
Merge remote-tracking branch 'origin' into free-runner-i686-mingw
2 parents 43e19cd + c37fbd8 commit 7fc7e3f

File tree

219 files changed

+4148
-1727
lines changed

Some content is hidden

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

219 files changed

+4148
-1727
lines changed

RELEASES.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
Version 1.84.1 (2025-01-30)
2+
==========================
3+
4+
<a id="1.84.1"></a>
5+
6+
- [Fix ICE 132920 in duplicate-crate diagnostics.](https://github.com/rust-lang/rust/pull/133304/)
7+
- [Fix errors for overlapping impls in incremental rebuilds.](https://github.com/rust-lang/rust/pull/133828/)
8+
- [Fix slow compilation related to the next-generation trait solver.](https://github.com/rust-lang/rust/pull/135618/)
9+
- [Fix debuginfo when LLVM's location discriminator value limit is exceeded.](https://github.com/rust-lang/rust/pull/135643/)
10+
- Fixes for building Rust from source:
11+
- [Only try to distribute `llvm-objcopy` if llvm tools are enabled.](https://github.com/rust-lang/rust/pull/134240/)
12+
- [Add Profile Override for Non-Git Sources.](https://github.com/rust-lang/rust/pull/135433/)
13+
- [Resolve symlinks of LLVM tool binaries before copying them.](https://github.com/rust-lang/rust/pull/135585/)
14+
- [Make it possible to use ci-rustc on tarball sources.](https://github.com/rust-lang/rust/pull/135722/)
15+
116
Version 1.84.0 (2025-01-09)
217
==========================
318

REUSE.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ SPDX-FileCopyrightText = "2015 Anders Kaseorg <andersk@mit.edu>"
9292
SPDX-License-Identifier = "MIT"
9393

9494
[[annotations]]
95-
path = "src/librustdoc/html/static/fonts/FiraSans**"
95+
path = "src/librustdoc/html/static/fonts/Fira**"
9696
precedence = "override"
9797
SPDX-FileCopyrightText = ["2014, Mozilla Foundation", "2014, Telefonica S.A."]
9898
SPDX-License-Identifier = "OFL-1.1"

compiler/rustc_ast/src/token.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -527,13 +527,13 @@ impl TokenKind {
527527

528528
/// Returns tokens that are likely to be typed accidentally instead of the current token.
529529
/// Enables better error recovery when the wrong token is found.
530-
pub fn similar_tokens(&self) -> Option<Vec<TokenKind>> {
531-
match *self {
532-
Comma => Some(vec![Dot, Lt, Semi]),
533-
Semi => Some(vec![Colon, Comma]),
534-
Colon => Some(vec![Semi]),
535-
FatArrow => Some(vec![Eq, RArrow, Ge, Gt]),
536-
_ => None,
530+
pub fn similar_tokens(&self) -> &[TokenKind] {
531+
match self {
532+
Comma => &[Dot, Lt, Semi],
533+
Semi => &[Colon, Comma],
534+
Colon => &[Semi],
535+
FatArrow => &[Eq, RArrow, Ge, Gt],
536+
_ => &[],
537537
}
538538
}
539539

compiler/rustc_borrowck/src/region_infer/opaque_types.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
use rustc_data_structures::fx::FxIndexMap;
22
use rustc_errors::ErrorGuaranteed;
3+
use rustc_hir::OpaqueTyOrigin;
34
use rustc_hir::def_id::LocalDefId;
5+
use rustc_infer::infer::outlives::env::OutlivesEnvironment;
46
use rustc_infer::infer::{InferCtxt, NllRegionVariableOrigin, TyCtxtInferExt as _};
57
use rustc_macros::extension;
68
use rustc_middle::ty::fold::fold_regions;
@@ -10,6 +12,7 @@ use rustc_middle::ty::{
1012
TypingMode,
1113
};
1214
use rustc_span::Span;
15+
use rustc_trait_selection::regions::OutlivesEnvironmentBuildExt;
1316
use rustc_trait_selection::traits::ObligationCtxt;
1417
use tracing::{debug, instrument};
1518

@@ -406,20 +409,16 @@ impl<'tcx> LazyOpaqueTyEnv<'tcx> {
406409
}
407410

408411
fn get_canonical_args(&self) -> ty::GenericArgsRef<'tcx> {
409-
use rustc_hir as hir;
410-
use rustc_infer::infer::outlives::env::OutlivesEnvironment;
411-
use rustc_trait_selection::traits::outlives_bounds::InferCtxtExt as _;
412-
413412
if let Some(&canonical_args) = self.canonical_args.get() {
414413
return canonical_args;
415414
}
416415

417416
let &Self { tcx, def_id, .. } = self;
418417
let origin = tcx.local_opaque_ty_origin(def_id);
419418
let parent = match origin {
420-
hir::OpaqueTyOrigin::FnReturn { parent, .. }
421-
| hir::OpaqueTyOrigin::AsyncFn { parent, .. }
422-
| hir::OpaqueTyOrigin::TyAlias { parent, .. } => parent,
419+
OpaqueTyOrigin::FnReturn { parent, .. }
420+
| OpaqueTyOrigin::AsyncFn { parent, .. }
421+
| OpaqueTyOrigin::TyAlias { parent, .. } => parent,
423422
};
424423
let param_env = tcx.param_env(parent);
425424
let args = GenericArgs::identity_for_item(tcx, parent).extend_to(
@@ -439,8 +438,7 @@ impl<'tcx> LazyOpaqueTyEnv<'tcx> {
439438
tcx.dcx().span_delayed_bug(tcx.def_span(def_id), "error getting implied bounds");
440439
Default::default()
441440
});
442-
let implied_bounds = infcx.implied_bounds_tys(param_env, parent, &wf_tys);
443-
let outlives_env = OutlivesEnvironment::with_bounds(param_env, implied_bounds);
441+
let outlives_env = OutlivesEnvironment::new(&infcx, parent, param_env, wf_tys);
444442

445443
let mut seen = vec![tcx.lifetimes.re_static];
446444
let canonical_args = fold_regions(tcx, args, |r1, _| {

compiler/rustc_builtin_macros/src/format.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,14 @@ fn parse_args<'a>(ecx: &ExtCtxt<'a>, sp: Span, tts: TokenStream) -> PResult<'a,
101101

102102
match p.expect(exp!(Comma)) {
103103
Err(err) => {
104-
match token::TokenKind::Comma.similar_tokens() {
105-
Some(tks) if tks.contains(&p.token.kind) => {
106-
// If a similar token is found, then it may be a typo. We
107-
// consider it as a comma, and continue parsing.
108-
err.emit();
109-
p.bump();
110-
}
104+
if token::TokenKind::Comma.similar_tokens().contains(&p.token.kind) {
105+
// If a similar token is found, then it may be a typo. We
106+
// consider it as a comma, and continue parsing.
107+
err.emit();
108+
p.bump();
109+
} else {
111110
// Otherwise stop the parsing and return the error.
112-
_ => return Err(err),
111+
return Err(err);
113112
}
114113
}
115114
Ok(Recovered::Yes(_)) => (),

compiler/rustc_codegen_cranelift/src/constant.rs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use cranelift_module::*;
66
use rustc_data_structures::fx::FxHashSet;
77
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
88
use rustc_middle::mir::interpret::{AllocId, GlobalAlloc, Scalar, read_target_uint};
9-
use rustc_middle::ty::{Binder, ExistentialTraitRef, ScalarInt};
9+
use rustc_middle::ty::{ExistentialTraitRef, ScalarInt};
1010

1111
use crate::prelude::*;
1212

@@ -167,7 +167,9 @@ pub(crate) fn codegen_const_value<'tcx>(
167167
&mut fx.constants_cx,
168168
fx.module,
169169
ty,
170-
dyn_ty.principal(),
170+
dyn_ty.principal().map(|principal| {
171+
fx.tcx.instantiate_bound_regions_with_erased(principal)
172+
}),
171173
);
172174
let local_data_id =
173175
fx.module.declare_data_in_func(data_id, &mut fx.bcx.func);
@@ -243,7 +245,7 @@ pub(crate) fn data_id_for_vtable<'tcx>(
243245
cx: &mut ConstantCx,
244246
module: &mut dyn Module,
245247
ty: Ty<'tcx>,
246-
trait_ref: Option<Binder<'tcx, ExistentialTraitRef<'tcx>>>,
248+
trait_ref: Option<ExistentialTraitRef<'tcx>>,
247249
) -> DataId {
248250
let alloc_id = tcx.vtable_allocation((ty, trait_ref));
249251
data_id_for_alloc_id(cx, module, alloc_id, Mutability::Not)
@@ -460,9 +462,15 @@ fn define_all_allocs(tcx: TyCtxt<'_>, module: &mut dyn Module, cx: &mut Constant
460462
GlobalAlloc::Memory(target_alloc) => {
461463
data_id_for_alloc_id(cx, module, alloc_id, target_alloc.inner().mutability)
462464
}
463-
GlobalAlloc::VTable(ty, dyn_ty) => {
464-
data_id_for_vtable(tcx, cx, module, ty, dyn_ty.principal())
465-
}
465+
GlobalAlloc::VTable(ty, dyn_ty) => data_id_for_vtable(
466+
tcx,
467+
cx,
468+
module,
469+
ty,
470+
dyn_ty
471+
.principal()
472+
.map(|principal| tcx.instantiate_bound_regions_with_erased(principal)),
473+
),
466474
GlobalAlloc::Static(def_id) => {
467475
if tcx.codegen_fn_attrs(def_id).flags.contains(CodegenFnAttrFlags::THREAD_LOCAL)
468476
{

compiler/rustc_codegen_cranelift/src/intrinsics/simd.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
129129
return;
130130
}
131131

132-
let idx = generic_args[2]
133-
.expect_const()
134-
.try_to_valtree()
135-
.expect("expected monomorphic const in codegen")
136-
.0
137-
.unwrap_branch();
132+
let idx = generic_args[2].expect_const().to_value().valtree.unwrap_branch();
138133

139134
assert_eq!(x.layout(), y.layout());
140135
let layout = x.layout();

compiler/rustc_codegen_cranelift/src/unsize.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,12 @@ pub(crate) fn unsized_info<'tcx>(
6161
old_info
6262
}
6363
}
64-
(_, ty::Dynamic(data, ..)) => crate::vtable::get_vtable(fx, source, data.principal()),
64+
(_, ty::Dynamic(data, ..)) => crate::vtable::get_vtable(
65+
fx,
66+
source,
67+
data.principal()
68+
.map(|principal| fx.tcx.instantiate_bound_regions_with_erased(principal)),
69+
),
6570
_ => bug!("unsized_info: invalid unsizing {:?} -> {:?}", source, target),
6671
}
6772
}

compiler/rustc_codegen_cranelift/src/vtable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ pub(crate) fn get_ptr_and_method_ref<'tcx>(
9090
pub(crate) fn get_vtable<'tcx>(
9191
fx: &mut FunctionCx<'_, '_, 'tcx>,
9292
ty: Ty<'tcx>,
93-
trait_ref: Option<ty::PolyExistentialTraitRef<'tcx>>,
93+
trait_ref: Option<ty::ExistentialTraitRef<'tcx>>,
9494
) -> Value {
9595
let data_id = data_id_for_vtable(fx.tcx, &mut fx.constants_cx, fx.module, ty, trait_ref);
9696
let local_data_id = fx.module.declare_data_in_func(data_id, fx.bcx.func);

compiler/rustc_codegen_gcc/src/common.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,12 @@ impl<'gcc, 'tcx> ConstCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
234234
GlobalAlloc::VTable(ty, dyn_ty) => {
235235
let alloc = self
236236
.tcx
237-
.global_alloc(self.tcx.vtable_allocation((ty, dyn_ty.principal())))
237+
.global_alloc(self.tcx.vtable_allocation((
238+
ty,
239+
dyn_ty.principal().map(|principal| {
240+
self.tcx.instantiate_bound_regions_with_erased(principal)
241+
}),
242+
)))
238243
.unwrap_memory();
239244
let init = const_alloc_to_gcc(self, alloc);
240245
self.static_addr_of(init, alloc.inner().align, None)

compiler/rustc_codegen_gcc/src/context.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use rustc_middle::ty::layout::{
1414
FnAbiError, FnAbiOf, FnAbiOfHelpers, FnAbiRequest, HasTyCtxt, HasTypingEnv, LayoutError,
1515
LayoutOfHelpers,
1616
};
17-
use rustc_middle::ty::{self, Instance, PolyExistentialTraitRef, Ty, TyCtxt};
17+
use rustc_middle::ty::{self, ExistentialTraitRef, Instance, Ty, TyCtxt};
1818
use rustc_session::Session;
1919
use rustc_span::source_map::respan;
2020
use rustc_span::{DUMMY_SP, Span};
@@ -90,7 +90,7 @@ pub struct CodegenCx<'gcc, 'tcx> {
9090
pub function_instances: RefCell<FxHashMap<Instance<'tcx>, Function<'gcc>>>,
9191
/// Cache generated vtables
9292
pub vtables:
93-
RefCell<FxHashMap<(Ty<'tcx>, Option<ty::PolyExistentialTraitRef<'tcx>>), RValue<'gcc>>>,
93+
RefCell<FxHashMap<(Ty<'tcx>, Option<ty::ExistentialTraitRef<'tcx>>), RValue<'gcc>>>,
9494

9595
// TODO(antoyo): improve the SSA API to not require those.
9696
/// Mapping from function pointer type to indexes of on stack parameters.
@@ -401,7 +401,7 @@ impl<'gcc, 'tcx> BackendTypes for CodegenCx<'gcc, 'tcx> {
401401
impl<'gcc, 'tcx> MiscCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
402402
fn vtables(
403403
&self,
404-
) -> &RefCell<FxHashMap<(Ty<'tcx>, Option<PolyExistentialTraitRef<'tcx>>), RValue<'gcc>>> {
404+
) -> &RefCell<FxHashMap<(Ty<'tcx>, Option<ExistentialTraitRef<'tcx>>), RValue<'gcc>>> {
405405
&self.vtables
406406
}
407407

compiler/rustc_codegen_gcc/src/debuginfo.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use rustc_data_structures::sync::Lrc;
77
use rustc_index::bit_set::DenseBitSet;
88
use rustc_index::{Idx, IndexVec};
99
use rustc_middle::mir::{self, Body, SourceScope};
10-
use rustc_middle::ty::{Instance, PolyExistentialTraitRef, Ty};
10+
use rustc_middle::ty::{ExistentialTraitRef, Instance, Ty};
1111
use rustc_session::config::DebugInfo;
1212
use rustc_span::{BytePos, Pos, SourceFile, SourceFileAndLine, Span, Symbol};
1313
use rustc_target::abi::Size;
@@ -214,7 +214,7 @@ impl<'gcc, 'tcx> DebugInfoCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
214214
fn create_vtable_debuginfo(
215215
&self,
216216
_ty: Ty<'tcx>,
217-
_trait_ref: Option<PolyExistentialTraitRef<'tcx>>,
217+
_trait_ref: Option<ExistentialTraitRef<'tcx>>,
218218
_vtable: Self::Value,
219219
) {
220220
// TODO(antoyo)

compiler/rustc_codegen_llvm/src/builder.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1325,7 +1325,9 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
13251325
impl<'ll> StaticBuilderMethods for Builder<'_, 'll, '_> {
13261326
fn get_static(&mut self, def_id: DefId) -> &'ll Value {
13271327
// Forward to the `get_static` method of `CodegenCx`
1328-
self.cx().get_static(def_id)
1328+
let s = self.cx().get_static(def_id);
1329+
// Cast to default address space if globals are in a different addrspace
1330+
self.cx().const_pointercast(s, self.type_ptr())
13291331
}
13301332
}
13311333

compiler/rustc_codegen_llvm/src/common.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ impl<'ll, 'tcx> ConstCodegenMethods<'tcx> for CodegenCx<'ll, 'tcx> {
225225
llvm::LLVMSetUnnamedAddress(g, llvm::UnnamedAddr::Global);
226226
}
227227
llvm::set_linkage(g, llvm::Linkage::InternalLinkage);
228+
// Cast to default address space if globals are in a different addrspace
229+
let g = self.const_pointercast(g, self.type_ptr());
228230
(s.to_owned(), g)
229231
})
230232
.1;
@@ -289,7 +291,7 @@ impl<'ll, 'tcx> ConstCodegenMethods<'tcx> for CodegenCx<'ll, 'tcx> {
289291
let alloc = alloc.inner();
290292
let value = match alloc.mutability {
291293
Mutability::Mut => self.static_addr_of_mut(init, alloc.align, None),
292-
_ => self.static_addr_of(init, alloc.align, None),
294+
_ => self.static_addr_of_impl(init, alloc.align, None),
293295
};
294296
if !self.sess().fewer_names() && llvm::get_value_name(value).is_empty()
295297
{
@@ -312,10 +314,15 @@ impl<'ll, 'tcx> ConstCodegenMethods<'tcx> for CodegenCx<'ll, 'tcx> {
312314
GlobalAlloc::VTable(ty, dyn_ty) => {
313315
let alloc = self
314316
.tcx
315-
.global_alloc(self.tcx.vtable_allocation((ty, dyn_ty.principal())))
317+
.global_alloc(self.tcx.vtable_allocation((
318+
ty,
319+
dyn_ty.principal().map(|principal| {
320+
self.tcx.instantiate_bound_regions_with_erased(principal)
321+
}),
322+
)))
316323
.unwrap_memory();
317324
let init = const_alloc_to_llvm(self, alloc, /*static*/ false);
318-
let value = self.static_addr_of(init, alloc.inner().align, None);
325+
let value = self.static_addr_of_impl(init, alloc.inner().align, None);
319326
(value, AddressSpace::DATA)
320327
}
321328
GlobalAlloc::Static(def_id) => {
@@ -327,7 +334,8 @@ impl<'ll, 'tcx> ConstCodegenMethods<'tcx> for CodegenCx<'ll, 'tcx> {
327334
let llval = unsafe {
328335
llvm::LLVMConstInBoundsGEP2(
329336
self.type_i8(),
330-
self.const_bitcast(base_addr, self.type_ptr_ext(base_addr_space)),
337+
// Cast to the required address space if necessary
338+
self.const_pointercast(base_addr, self.type_ptr_ext(base_addr_space)),
331339
&self.const_usize(offset.bytes()),
332340
1,
333341
)

0 commit comments

Comments
 (0)