Skip to content

Commit d9e85b5

Browse files
committed
Auto merge of rust-lang#125529 - cuviper:beta-next, r=cuviper
[beta] backports - Add `#[inline]` to float `Debug` fallback used by `cfg(no_fp_fmt_parse)` rust-lang#125252 - Add v0 symbol mangling for `f16` and `f128` rust-lang#123816 - Only make GAT ambiguous in `match_projection_projections` considering shallow resolvability rust-lang#125214 - Update to LLVM 18.1.6 rust-lang#125288 r? cuviper
2 parents 66eb3e4 + 16f4a2b commit d9e85b5

File tree

7 files changed

+37
-6
lines changed

7 files changed

+37
-6
lines changed

.gitmodules

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
[submodule "src/llvm-project"]
3434
path = src/llvm-project
3535
url = https://github.com/rust-lang/llvm-project.git
36-
branch = rustc/18.0-2024-02-13
36+
branch = rustc/18.1-2024-05-19
3737
shallow = true
3838
[submodule "src/doc/embedded-book"]
3939
path = src/doc/embedded-book

compiler/rustc_symbol_mangling/src/v0.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -318,11 +318,10 @@ impl<'tcx> Printer<'tcx> for SymbolMangler<'tcx> {
318318
ty::Uint(UintTy::U64) => "y",
319319
ty::Uint(UintTy::U128) => "o",
320320
ty::Uint(UintTy::Usize) => "j",
321-
// FIXME(f16_f128): update these once `rustc-demangle` supports the new types
322-
ty::Float(FloatTy::F16) => unimplemented!("f16_f128"),
321+
ty::Float(FloatTy::F16) => "C3f16",
323322
ty::Float(FloatTy::F32) => "f",
324323
ty::Float(FloatTy::F64) => "d",
325-
ty::Float(FloatTy::F128) => unimplemented!("f16_f128"),
324+
ty::Float(FloatTy::F128) => "C4f128",
326325
ty::Never => "z",
327326

328327
// Placeholders (should be demangled as `_`).

compiler/rustc_trait_selection/src/traits/select/mod.rs

+11-1
Original file line numberDiff line numberDiff line change
@@ -1777,9 +1777,19 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
17771777
// If this type is a GAT, and of the GAT args resolve to something new,
17781778
// that means that we must have newly inferred something about the GAT.
17791779
// We should give up in that case.
1780+
// FIXME(generic-associated-types): This only detects one layer of inference,
1781+
// which is probably not what we actually want, but fixing it causes some ambiguity:
1782+
// <https://github.com/rust-lang/rust/issues/125196>.
17801783
if !generics.params.is_empty()
17811784
&& obligation.predicate.args[generics.parent_count..].iter().any(|&p| {
1782-
p.has_non_region_infer() && self.infcx.resolve_vars_if_possible(p) != p
1785+
p.has_non_region_infer()
1786+
&& match p.unpack() {
1787+
ty::GenericArgKind::Const(ct) => {
1788+
self.infcx.shallow_resolve_const(ct) != ct
1789+
}
1790+
ty::GenericArgKind::Type(ty) => self.infcx.shallow_resolve(ty) != ty,
1791+
ty::GenericArgKind::Lifetime(_) => false,
1792+
}
17831793
})
17841794
{
17851795
ProjectionMatchesProjection::Ambiguous

library/core/src/fmt/nofloat.rs

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ macro_rules! floating {
44
($ty:ident) => {
55
#[stable(feature = "rust1", since = "1.0.0")]
66
impl Debug for $ty {
7+
#[inline]
78
fn fmt(&self, _fmt: &mut Formatter<'_>) -> Result {
89
panic!("floating point support is turned off");
910
}

src/doc/rustc/src/symbol-mangling/v0.md

+2
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,8 @@ The type encodings based on the initial tag character are:
739739
* `z` — `!`
740740
* `p` — [placeholder] `_`
741741
742+
Remaining primitives are encoded as a crate production, e.g. `C4f128`.
743+
742744
* `A` — An [array][reference-array] `[T; N]`.
743745
744746
> <span id="array-type">array-type</span> → `A` *[type]* *[const]*

src/llvm-project

Submodule llvm-project updated 159 files
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Fix for <https://github.com/rust-lang/rust/issues/125196>.
2+
//@ check-pass
3+
4+
trait Tr {
5+
type Gat<T>;
6+
}
7+
8+
struct W<T>(T);
9+
10+
fn foo<T: Tr>() where for<'a> &'a T: Tr<Gat<W<i32>> = i32> {
11+
let x: <&T as Tr>::Gat<W<_>> = 1i32;
12+
// Previously, `match_projection_projections` only checked that
13+
// `shallow_resolve(W<?0>) = W<?0>`. This won't prevent *all* inference guidance
14+
// from projection predicates in the environment, just ones that guide the
15+
// outermost type of each GAT constructor. This is definitely wrong, but there is
16+
// code that relies on it in the wild :/
17+
}
18+
19+
fn main() {}

0 commit comments

Comments
 (0)