Skip to content

Commit e08d0d6

Browse files
committed
rustup: update to nightly-2022-04-11.
1 parent 3e04f62 commit e08d0d6

18 files changed

+87
-62
lines changed

crates/rustc_codegen_spirv/src/abi.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ impl<'tcx> ConvSpirvType<'tcx> for TyAndLayout<'tcx> {
408408
// Note: We can't use auto_struct_layout here because the spirv types here might be undefined due to
409409
// recursive pointer types.
410410
let a_offset = Size::ZERO;
411-
let b_offset = a.value.size(cx).align_to(b.value.align(cx).abi);
411+
let b_offset = a.primitive().size(cx).align_to(b.primitive().align(cx).abi);
412412
let a = trans_scalar(cx, span, *self, a, a_offset);
413413
let b = trans_scalar(cx, span, *self, b, b_offset);
414414
let size = if self.is_unsized() {
@@ -470,7 +470,7 @@ pub fn scalar_pair_element_backend_type<'tcx>(
470470
};
471471
let offset = match index {
472472
0 => Size::ZERO,
473-
1 => a.value.size(cx).align_to(b.value.align(cx).abi),
473+
1 => a.primitive().size(cx).align_to(b.primitive().align(cx).abi),
474474
_ => unreachable!(),
475475
};
476476
trans_scalar(cx, span, ty, [a, b][index], offset)
@@ -494,7 +494,7 @@ fn trans_scalar<'tcx>(
494494
return SpirvType::Bool.def(span, cx);
495495
}
496496

497-
match scalar.value {
497+
match scalar.primitive() {
498498
Primitive::Int(width, signedness) => {
499499
SpirvType::Integer(width.size().bits() as u32, signedness).def(span, cx)
500500
}

crates/rustc_codegen_spirv/src/builder/builder_methods.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,10 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
918918
);
919919
OperandValue::Immediate(self.to_immediate(llval, place.layout))
920920
} else if let Abi::ScalarPair(a, b) = place.layout.abi {
921-
let b_offset = a.value.size(self).align_to(b.value.align(self).abi);
921+
let b_offset = a
922+
.primitive()
923+
.size(self)
924+
.align_to(b.primitive().align(self).abi);
922925

923926
let pair_ty = place.layout.spirv_type(self.span(), self);
924927
let mut load = |i, scalar: Scalar, align| {

crates/rustc_codegen_spirv/src/codegen_cx/constant.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ impl<'tcx> CodegenCx<'tcx> {
2020
self.builder.def_constant(ty, SpirvConst::U32(val as u32))
2121
}
2222

23+
pub fn constant_i16(&self, span: Span, val: i16) -> SpirvValue {
24+
let ty = SpirvType::Integer(16, true).def(span, self);
25+
self.builder.def_constant(ty, SpirvConst::U32(val as u32))
26+
}
27+
2328
pub fn constant_u16(&self, span: Span, val: u16) -> SpirvValue {
2429
let ty = SpirvType::Integer(16, false).def(span, self);
2530
self.builder.def_constant(ty, SpirvConst::U32(val as u32))
@@ -139,6 +144,9 @@ impl<'tcx> ConstMethods<'tcx> for CodegenCx<'tcx> {
139144
fn const_bool(&self, val: bool) -> Self::Value {
140145
self.constant_bool(DUMMY_SP, val)
141146
}
147+
fn const_i16(&self, i: i16) -> Self::Value {
148+
self.constant_i16(DUMMY_SP, i)
149+
}
142150
fn const_i32(&self, i: i32) -> Self::Value {
143151
self.constant_i32(DUMMY_SP, i)
144152
}
@@ -213,10 +221,10 @@ impl<'tcx> ConstMethods<'tcx> for CodegenCx<'tcx> {
213221
) -> Self::Value {
214222
match scalar {
215223
Scalar::Int(int) => {
216-
assert_eq!(int.size(), layout.value.size(self));
224+
assert_eq!(int.size(), layout.primitive().size(self));
217225
let data = int.to_bits(int.size()).unwrap();
218226

219-
match layout.value {
227+
match layout.primitive() {
220228
Primitive::Int(int_size, int_signedness) => match self.lookup_type(ty) {
221229
SpirvType::Integer(width, spirv_signedness) => {
222230
assert_eq!(width as u64, int_size.size().bits());
@@ -297,7 +305,7 @@ impl<'tcx> ConstMethods<'tcx> for CodegenCx<'tcx> {
297305
// let offset = self.constant_u64(ptr.offset.bytes());
298306
// self.gep(base_addr, once(offset))
299307
};
300-
if layout.value != Primitive::Pointer {
308+
if layout.primitive() != Primitive::Pointer {
301309
self.tcx
302310
.sess
303311
.fatal("Non-pointer-typed scalar_to_backend Scalar::Ptr not supported");
@@ -347,7 +355,7 @@ impl<'tcx> CodegenCx<'tcx> {
347355
pub fn primitive_to_scalar(&self, value: Primitive) -> abi::Scalar {
348356
let bits = value.size(self.data_layout()).bits();
349357
assert!(bits <= 128);
350-
abi::Scalar {
358+
abi::Scalar::Initialized {
351359
value,
352360
valid_range: abi::WrappingRange {
353361
start: 0,

crates/rustc_codegen_spirv/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ fn is_blocklisted_fn<'tcx>(
224224
return true;
225225
}
226226

227-
if tcx.opt_item_name(def.did).map(|i| i.name) == Some(sym.fmt_decimal) {
227+
if tcx.opt_item_ident(def.did).map(|i| i.name) == Some(sym.fmt_decimal) {
228228
if let Some(parent_def_id) = tcx.parent(def.did) {
229229
if is_debug_fmt_method(parent_def_id) {
230230
return true;
@@ -308,7 +308,7 @@ impl CodegenBackend for SpirvCodegenBackend {
308308
.cg
309309
.target_cpu
310310
.clone()
311-
.unwrap_or_else(|| tcx.sess.target.cpu.clone()),
311+
.unwrap_or_else(|| tcx.sess.target.cpu.to_string()),
312312
metadata,
313313
need_metadata_module,
314314
))

crates/rustc_codegen_spirv/src/target.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,23 +77,23 @@ impl SpirvTarget {
7777

7878
pub fn rustc_target(&self) -> Target {
7979
Target {
80-
llvm_target: self.to_string(),
80+
llvm_target: self.to_string().into(),
8181
pointer_width: 32,
82-
data_layout: "e-m:e-p:32:32:32-i64:64-n8:16:32:64".to_string(),
83-
arch: String::from(ARCH),
82+
data_layout: "e-m:e-p:32:32:32-i64:64-n8:16:32:64".into(),
83+
arch: ARCH.into(),
8484
options: TargetOptions {
8585
simd_types_indirect: false,
8686
allows_weak_linkage: false,
8787
crt_static_allows_dylibs: true,
88-
dll_prefix: "".to_string(),
89-
dll_suffix: ".spv".to_string(),
88+
dll_prefix: "".into(),
89+
dll_suffix: ".spv".into(),
9090
dynamic_linking: true,
9191
emit_debug_gdb_scripts: false,
9292
linker_flavor: LinkerFlavor::Ld,
9393
panic_strategy: PanicStrategy::Abort,
94-
os: "unknown".to_string(),
95-
env: self.env.to_string(),
96-
vendor: self.vendor.clone(),
94+
os: "unknown".into(),
95+
env: self.env.to_string().into(),
96+
vendor: self.vendor.clone().into(),
9797
// TODO: Investigate if main_needs_argc_argv is useful (for building exes)
9898
main_needs_argc_argv: false,
9999
..Default::default()

rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
# to the user in the error, instead of "error: invalid channel name '[toolchain]'".
66

77
[toolchain]
8-
channel = "nightly-2022-04-01"
8+
channel = "nightly-2022-04-11"
99
components = ["rust-src", "rustc-dev", "llvm-tools-preview"]

tests/ui/arch/debug_printf_type_checking.stderr

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,16 @@ error[E0277]: the trait bound `{float}: Vector<f32, 2_usize>` is not satisfied
8989
| | the trait `Vector<f32, 2_usize>` is not implemented for `{float}`
9090
| required by a bound introduced by this call
9191
|
92+
= help: the following other types implement trait `Vector<T, N>`:
93+
<BVec2 as Vector<bool, 2_usize>>
94+
<BVec3 as Vector<bool, 3_usize>>
95+
<BVec4 as Vector<bool, 4_usize>>
96+
<DVec2 as Vector<f64, 2_usize>>
97+
<DVec3 as Vector<f64, 3_usize>>
98+
<DVec4 as Vector<f64, 4_usize>>
99+
<IVec2 as Vector<i32, 2_usize>>
100+
<IVec3 as Vector<i32, 3_usize>>
101+
and 9 others
92102
note: required by a bound in `debug_printf_assert_is_vector`
93103
--> $SPIRV_STD_SRC/lib.rs:144:8
94104
|

tests/ui/dis/ptr_copy.normal.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error: Cannot memcpy dynamically sized data
2-
--> $CORE_SRC/intrinsics.rs:2193:14
2+
--> $CORE_SRC/intrinsics.rs:2210:9
33
|
4-
2193 | unsafe { copy(src, dst, count) }
5-
| ^^^^^^^^^^^^^^^^^^^^^
4+
2210 | copy(src, dst, count)
5+
| ^^^^^^^^^^^^^^^^^^^^^
66

77
error: aborting due to previous error
88

tests/ui/dis/ptr_read.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
%4 = OpFunctionParameter %5
33
%6 = OpFunctionParameter %5
44
%7 = OpLabel
5-
OpLine %8 971 8
5+
OpLine %8 1096 8
66
%9 = OpLoad %10 %4
77
OpLine %11 7 13
88
OpStore %6 %9

tests/ui/dis/ptr_read_method.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
%4 = OpFunctionParameter %5
33
%6 = OpFunctionParameter %5
44
%7 = OpLabel
5-
OpLine %8 971 8
5+
OpLine %8 1096 8
66
%9 = OpLoad %10 %4
77
OpLine %11 7 13
88
OpStore %6 %9

0 commit comments

Comments
 (0)