Skip to content

Commit 1c55db5

Browse files
committed
rustup: update to nightly-2024-09-01 (~1.82).
1 parent 91833e8 commit 1c55db5

26 files changed

+130
-158
lines changed

Cargo.lock

Lines changed: 26 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/rustc_codegen_spirv/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ regex = { version = "1", features = ["perf"] }
4848

4949
# HACK(eddyb) deps of `rustc_codegen_ssa`, for `pqp_cg_ssa` (see `build.rs`),
5050
# that cannot be handled with just `extern crate` pulling out of the sysroot.
51-
object = { version = "0.32.1", default-features = false, features = ["read_core", "elf", "macho", "pe", "xcoff", "unaligned", "archive", "write", "wasm"] }
51+
object = { version = "0.36.2", default-features = false, features = ["read_core", "elf", "macho", "pe", "xcoff", "unaligned", "archive", "write", "wasm"] }
5252
thorin-dwp = "0.7"
5353

5454
# Normal dependencies.

crates/rustc_codegen_spirv/build.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ use std::{env, fs, mem};
1515
/// `cargo publish`. We need to figure out a way to do this properly, but let's hardcode it for now :/
1616
//const REQUIRED_RUST_TOOLCHAIN: &str = include_str!("../../rust-toolchain.toml");
1717
const REQUIRED_RUST_TOOLCHAIN: &str = r#"[toolchain]
18-
channel = "nightly-2024-07-20"
18+
channel = "nightly-2024-09-01"
1919
components = ["rust-src", "rustc-dev", "llvm-tools"]
20-
# commit_hash = 9057c3ffec44926d5e149dc13ff3ce1613b69cce"#;
20+
# commit_hash = a7399ba69d37b019677a9c47fe89ceb8dd82db2d"#;
2121

2222
fn rustc_output(arg: &str) -> Result<String, Box<dyn Error>> {
2323
let rustc = env::var("RUSTC").unwrap_or_else(|_| "rustc".into());
@@ -145,7 +145,7 @@ fn generate_pqp_cg_ssa() -> Result<(), Box<dyn Error>> {
145145
for line in mem::take(&mut src).lines() {
146146
if line.starts_with("#!") {
147147
src += "// ";
148-
if !line.starts_with("#![doc(") {
148+
if !line.starts_with("#![doc(") && line != "#![warn(unreachable_pub)]" {
149149
writeln(&mut cg_ssa_lib_rc_attrs, line);
150150
}
151151
} else if line == "#[macro_use]" || line.starts_with("extern crate ") {

crates/rustc_codegen_spirv/src/abi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ fn dig_scalar_pointee<'tcx>(
548548
TyKind::Ref(_, pointee_ty, _) | TyKind::RawPtr(pointee_ty, _) => {
549549
PointeeTy::Ty(cx.layout_of(pointee_ty))
550550
}
551-
TyKind::FnPtr(sig) => PointeeTy::Fn(sig),
551+
TyKind::FnPtr(sig_tys, hdr) => PointeeTy::Fn(sig_tys.with(hdr)),
552552
_ => bug!("Pointer is not `&T`, `*T` or `fn` pointer: {:#?}", layout),
553553
};
554554
return pointee;

crates/rustc_codegen_spirv/src/attr.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -182,15 +182,14 @@ impl AggregatedSpirvAttributes {
182182
span: Span,
183183
category: &'static str,
184184
) -> Result<(), MultipleAttrs> {
185-
match slot {
186-
Some(prev) => Err(MultipleAttrs {
185+
if let Some(prev) = slot {
186+
Err(MultipleAttrs {
187187
prev_span: prev.span,
188188
category,
189-
}),
190-
None => {
191-
*slot = Some(Spanned { value, span });
192-
Ok(())
193-
}
189+
})
190+
} else {
191+
*slot = Some(Spanned { value, span });
192+
Ok(())
194193
}
195194
}
196195

crates/rustc_codegen_spirv/src/builder/builder_methods.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ macro_rules! simple_op {
5656
_ => return None,
5757
};
5858
Some(if signed {
59-
size.sign_extend(x)
59+
size.sign_extend(x) as u128
6060
} else {
6161
size.truncate(x)
6262
})

crates/rustc_codegen_spirv/src/builder/spirv_asm.rs

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -857,12 +857,11 @@ impl<'cx, 'tcx> Builder<'cx, 'tcx> {
857857
place,
858858
} => {
859859
self.check_reg(span, reg);
860-
match place {
861-
Some(place) => Some(OutRegister::Place(*place)),
862-
None => {
863-
self.tcx.dcx().span_err(span, "missing place for register");
864-
None
865-
}
860+
if let Some(place) = place {
861+
Some(OutRegister::Place(*place))
862+
} else {
863+
self.tcx.dcx().span_err(span, "missing place for register");
864+
None
866865
}
867866
}
868867
InlineAsmOperandRef::InOut {
@@ -872,12 +871,11 @@ impl<'cx, 'tcx> Builder<'cx, 'tcx> {
872871
out_place,
873872
} => {
874873
self.check_reg(span, reg);
875-
match out_place {
876-
Some(out_place) => Some(OutRegister::Place(*out_place)),
877-
None => {
878-
self.tcx.dcx().span_err(span, "missing place for register");
879-
None
880-
}
874+
if let Some(out_place) = out_place {
875+
Some(OutRegister::Place(*out_place))
876+
} else {
877+
self.tcx.dcx().span_err(span, "missing place for register");
878+
None
881879
}
882880
}
883881
InlineAsmOperandRef::Const { string: _ } => {
@@ -953,8 +951,8 @@ impl<'cx, 'tcx> Builder<'cx, 'tcx> {
953951
place,
954952
} => {
955953
self.check_reg(span, reg);
956-
match place {
957-
Some(place) => match self.lookup_type(place.val.llval.ty) {
954+
if let Some(place) = place {
955+
match self.lookup_type(place.val.llval.ty) {
958956
SpirvType::Pointer { pointee } => Some(pointee),
959957
other => {
960958
self.tcx.dcx().span_err(
@@ -966,13 +964,12 @@ impl<'cx, 'tcx> Builder<'cx, 'tcx> {
966964
);
967965
None
968966
}
969-
},
970-
None => {
971-
self.tcx
972-
.dcx()
973-
.span_err(span, "missing place for out register typeof");
974-
None
975967
}
968+
} else {
969+
self.tcx
970+
.dcx()
971+
.span_err(span, "missing place for out register typeof");
972+
None
976973
}
977974
}
978975
InlineAsmOperandRef::InOut {

crates/rustc_codegen_spirv/src/builder_spirv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ impl<'tcx> BuilderSpirv<'tcx> {
577577
(SpirvConst::Scalar(val), Some(SpirvType::Integer(bits, signed))) => {
578578
let size = Size::from_bits(bits);
579579
SpirvConst::Scalar(if signed {
580-
size.sign_extend(val)
580+
size.sign_extend(val) as u128
581581
} else {
582582
size.truncate(val)
583583
})

crates/rustc_codegen_spirv/src/codegen_cx/constant.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,14 @@ impl<'tcx> ConstMethods<'tcx> for CodegenCx<'tcx> {
195195
.def(DUMMY_SP, self);
196196
self.constant_composite(struct_ty, elts.iter().map(|f| f.def_cx(self)))
197197
}
198+
fn const_vector(&self, elts: &[Self::Value]) -> Self::Value {
199+
let vector_ty = SpirvType::Vector {
200+
element: elts[0].ty,
201+
count: elts.len() as u32,
202+
}
203+
.def(DUMMY_SP, self);
204+
self.constant_composite(vector_ty, elts.iter().map(|elt| elt.def_cx(self)))
205+
}
198206

199207
fn const_to_opt_uint(&self, v: Self::Value) -> Option<u64> {
200208
self.builder.lookup_const_scalar(v)?.try_into().ok()
@@ -247,10 +255,7 @@ impl<'tcx> ConstMethods<'tcx> for CodegenCx<'tcx> {
247255
let value = self.static_addr_of(init, alloc.inner().align, None);
248256
(value, AddressSpace::DATA)
249257
}
250-
GlobalAlloc::Function {
251-
instance,
252-
unique: _,
253-
} => (
258+
GlobalAlloc::Function { instance } => (
254259
self.get_fn_addr(instance.polymorphize(self.tcx)),
255260
self.data_layout().instruction_address_space,
256261
),

crates/rustc_codegen_spirv/src/codegen_cx/entry.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -831,8 +831,10 @@ impl<'tcx> CodegenCx<'tcx> {
831831
}
832832
}
833833
}
834-
// Emitted earlier.
835-
Err(SpecConstant { .. }) => {}
834+
Err(not_var) => {
835+
// Emitted earlier.
836+
let SpecConstant { .. } = not_var;
837+
}
836838
}
837839
}
838840

0 commit comments

Comments
 (0)