From 2ca5826e55cadd920c7cec37be0dd32edeee8ebd Mon Sep 17 00:00:00 2001 From: Ashley Hauck <953151+khyperia@users.noreply.github.com> Date: Mon, 6 Dec 2021 11:31:43 +0100 Subject: [PATCH] rustup update (#816) * rustup update * Test fixes --- crates/rustc_codegen_spirv/src/abi.rs | 4 +- crates/rustc_codegen_spirv/src/attr.rs | 3 +- .../src/builder/builder_methods.rs | 8 ++++ .../src/builder/intrinsics.rs | 5 +- crates/rustc_codegen_spirv/src/builder/mod.rs | 2 +- .../src/builder/spirv_asm.rs | 3 +- crates/rustc_codegen_spirv/src/lib.rs | 2 +- crates/spirv-builder/src/lib.rs | 2 +- crates/spirv-std/src/lib.rs | 8 ++-- examples/runners/ash/src/main.rs | 2 +- examples/runners/cpu/src/main.rs | 2 +- examples/runners/wgpu/src/lib.rs | 2 +- rust-toolchain | 2 +- tests/src/main.rs | 2 +- .../ui/arch/debug_printf_type_checking.stderr | 4 +- tests/ui/dis/ptr_copy.normal.stderr | 4 +- tests/ui/dis/ptr_read.stderr | 2 +- tests/ui/dis/ptr_read_method.stderr | 2 +- tests/ui/dis/ptr_write.stderr | 2 +- tests/ui/dis/ptr_write_method.stderr | 2 +- tests/ui/image/gather_err.stderr | 46 +++++++++++-------- tests/ui/image/query/query_levels_err.stderr | 25 ++++++---- tests/ui/image/query/query_lod_err.stderr | 25 ++++++---- tests/ui/image/query/query_size_err.stderr | 27 ++++++----- .../ui/image/query/query_size_lod_err.stderr | 25 ++++++---- 25 files changed, 126 insertions(+), 85 deletions(-) diff --git a/crates/rustc_codegen_spirv/src/abi.rs b/crates/rustc_codegen_spirv/src/abi.rs index 155daf7ef0..18ca7eb2df 100644 --- a/crates/rustc_codegen_spirv/src/abi.rs +++ b/crates/rustc_codegen_spirv/src/abi.rs @@ -9,7 +9,7 @@ use rustc_data_structures::fx::FxHashMap; use rustc_errors::ErrorReported; use rustc_index::vec::Idx; use rustc_middle::ty::layout::{FnAbiOf, LayoutOf, TyAndLayout}; -use rustc_middle::ty::query::Providers; +use rustc_middle::ty::query::{ExternProviders, Providers}; use rustc_middle::ty::subst::SubstsRef; use rustc_middle::ty::{ self, Const, FloatTy, GeneratorSubsts, IntTy, ParamEnv, PolyFnSig, Ty, TyCtxt, TyKind, @@ -167,7 +167,7 @@ pub(crate) fn provide(providers: &mut Providers) { }; } -pub(crate) fn provide_extern(providers: &mut Providers) { +pub(crate) fn provide_extern(providers: &mut ExternProviders) { // Reset providers overriden in `provide`, that need to still go through the // `rustc_metadata::rmeta` decoding, as opposed to being locally computed. providers.fn_sig = rustc_interface::DEFAULT_EXTERN_QUERY_PROVIDERS.fn_sig; diff --git a/crates/rustc_codegen_spirv/src/attr.rs b/crates/rustc_codegen_spirv/src/attr.rs index 364e9cedd9..364e1e4369 100644 --- a/crates/rustc_codegen_spirv/src/attr.rs +++ b/crates/rustc_codegen_spirv/src/attr.rs @@ -236,7 +236,8 @@ fn target_from_impl_item<'tcx>(tcx: TyCtxt<'tcx>, impl_item: &hir::ImplItem<'_>) hir::ImplItemKind::Const(..) => Target::AssocConst, hir::ImplItemKind::Fn(..) => { let parent_hir_id = tcx.hir().get_parent_item(impl_item.hir_id()); - let containing_item = tcx.hir().expect_item(parent_hir_id); + let parent_local_def_id = tcx.hir().local_def_id(parent_hir_id); + let containing_item = tcx.hir().expect_item(parent_local_def_id); let containing_impl_is_for_trait = match &containing_item.kind { hir::ItemKind::Impl(hir::Impl { of_trait, .. }) => of_trait.is_some(), _ => unreachable!("parent of an ImplItem must be an Impl"), diff --git a/crates/rustc_codegen_spirv/src/builder/builder_methods.rs b/crates/rustc_codegen_spirv/src/builder/builder_methods.rs index ac995a9406..f65e3668a8 100644 --- a/crates/rustc_codegen_spirv/src/builder/builder_methods.rs +++ b/crates/rustc_codegen_spirv/src/builder/builder_methods.rs @@ -991,6 +991,14 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> { // ignore } + fn type_metadata(&mut self, _function: Self::Function, _typeid: String) { + // ignore + } + + fn typeid_metadata(&mut self, _typeid: String) -> Self::Value { + todo!() + } + fn store(&mut self, val: Self::Value, ptr: Self::Value, _align: Align) -> Self::Value { let ptr_elem_ty = match self.lookup_type(ptr.ty) { SpirvType::Pointer { pointee } => pointee, diff --git a/crates/rustc_codegen_spirv/src/builder/intrinsics.rs b/crates/rustc_codegen_spirv/src/builder/intrinsics.rs index 3633b6abb4..7c3cf459bb 100644 --- a/crates/rustc_codegen_spirv/src/builder/intrinsics.rs +++ b/crates/rustc_codegen_spirv/src/builder/intrinsics.rs @@ -350,9 +350,8 @@ impl<'a, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'a, 'tcx> { cond } - fn sideeffect(&mut self) { - // TODO: This is currently ignored. - // It corresponds to the llvm.sideeffect intrinsic - does spir-v have an equivalent? + fn type_test(&mut self, _pointer: Self::Value, _typeid: Self::Value) -> Self::Value { + todo!() } fn va_start(&mut self, _val: Self::Value) -> Self::Value { diff --git a/crates/rustc_codegen_spirv/src/builder/mod.rs b/crates/rustc_codegen_spirv/src/builder/mod.rs index 5a8995de62..6d1663b209 100644 --- a/crates/rustc_codegen_spirv/src/builder/mod.rs +++ b/crates/rustc_codegen_spirv/src/builder/mod.rs @@ -329,7 +329,7 @@ impl<'a, 'tcx> ArgAbiMethods<'tcx> for Builder<'a, 'tcx> { impl<'a, 'tcx> AbiBuilderMethods<'tcx> for Builder<'a, 'tcx> { fn apply_attrs_callsite(&mut self, _fn_abi: &FnAbi<'tcx, Ty<'tcx>>, _callsite: Self::Value) {} - fn get_param(&self, index: usize) -> Self::Value { + fn get_param(&mut self, index: usize) -> Self::Value { self.function_parameter_values.borrow()[&self.current_fn.def(self)][index] } } diff --git a/crates/rustc_codegen_spirv/src/builder/spirv_asm.rs b/crates/rustc_codegen_spirv/src/builder/spirv_asm.rs index 5d19a615f5..b81574df26 100644 --- a/crates/rustc_codegen_spirv/src/builder/spirv_asm.rs +++ b/crates/rustc_codegen_spirv/src/builder/spirv_asm.rs @@ -13,7 +13,7 @@ use rustc_codegen_ssa::mir::place::PlaceRef; use rustc_codegen_ssa::traits::{AsmBuilderMethods, InlineAsmOperandRef}; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_hir::LlvmInlineAsmInner; -use rustc_middle::bug; +use rustc_middle::{bug, ty::Instance}; use rustc_span::{Span, DUMMY_SP}; use rustc_target::asm::{InlineAsmRegClass, InlineAsmRegOrRegClass, SpirVInlineAsmRegClass}; use std::convert::TryFrom; @@ -70,6 +70,7 @@ impl<'a, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'tcx> { operands: &[InlineAsmOperandRef<'tcx, Self>], options: InlineAsmOptions, _line_spans: &[Span], + _instance: Instance<'_>, ) { const SUPPORTED_OPTIONS: InlineAsmOptions = InlineAsmOptions::NORETURN; let unsupported_options = options & !SUPPORTED_OPTIONS; diff --git a/crates/rustc_codegen_spirv/src/lib.rs b/crates/rustc_codegen_spirv/src/lib.rs index 073e2f7d6e..c4601b5acd 100644 --- a/crates/rustc_codegen_spirv/src/lib.rs +++ b/crates/rustc_codegen_spirv/src/lib.rs @@ -290,7 +290,7 @@ impl CodegenBackend for SpirvCodegenBackend { crate::attr::provide(providers); } - fn provide_extern(&self, providers: &mut query::Providers) { + fn provide_extern(&self, providers: &mut query::ExternProviders) { crate::abi::provide_extern(providers); } diff --git a/crates/spirv-builder/src/lib.rs b/crates/spirv-builder/src/lib.rs index 6234406a49..7af53614ca 100644 --- a/crates/spirv-builder/src/lib.rs +++ b/crates/spirv-builder/src/lib.rs @@ -68,7 +68,7 @@ )] // END - Embark standard lints v0.4 // crate-specific exceptions: -#![allow()] +// #![allow()] mod depfile; #[cfg(feature = "watch")] diff --git a/crates/spirv-std/src/lib.rs b/crates/spirv-std/src/lib.rs index 209e191b08..836d923beb 100644 --- a/crates/spirv-std/src/lib.rs +++ b/crates/spirv-std/src/lib.rs @@ -2,12 +2,14 @@ #![cfg_attr( target_arch = "spirv", feature( + abi_unadjusted, asm, - register_attr, - repr_simd, + asm_const, + asm_experimental_arch, core_intrinsics, lang_items, - abi_unadjusted + register_attr, + repr_simd, ), register_attr(spirv) )] diff --git a/examples/runners/ash/src/main.rs b/examples/runners/ash/src/main.rs index a9bb365881..2bac0efe1e 100644 --- a/examples/runners/ash/src/main.rs +++ b/examples/runners/ash/src/main.rs @@ -68,7 +68,7 @@ )] // END - Embark standard lints v0.4 // crate-specific exceptions: -#![allow()] +// #![allow()] use ash::{ extensions::{ext, khr}, diff --git a/examples/runners/cpu/src/main.rs b/examples/runners/cpu/src/main.rs index af9ca5c870..bc97c9ac9a 100644 --- a/examples/runners/cpu/src/main.rs +++ b/examples/runners/cpu/src/main.rs @@ -68,7 +68,7 @@ )] // END - Embark standard lints v0.4 // crate-specific exceptions: -#![allow()] +// #![allow()] use minifb::{Key, Window, WindowOptions}; use rayon::prelude::*; diff --git a/examples/runners/wgpu/src/lib.rs b/examples/runners/wgpu/src/lib.rs index 18d94ec3a0..04126bd308 100644 --- a/examples/runners/wgpu/src/lib.rs +++ b/examples/runners/wgpu/src/lib.rs @@ -68,7 +68,7 @@ )] // END - Embark standard lints v0.4 // crate-specific exceptions: -#![allow()] +// #![allow()] use structopt::StructOpt; use strum::{Display, EnumString}; diff --git a/rust-toolchain b/rust-toolchain index ea2cce185b..1db3cd0a56 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -5,5 +5,5 @@ # to the user in the error, instead of "error: invalid channel name '[toolchain]'". [toolchain] -channel = "nightly-2021-10-26" +channel = "nightly-2021-12-02" components = ["rust-src", "rustc-dev", "llvm-tools-preview"] diff --git a/tests/src/main.rs b/tests/src/main.rs index ef375d7306..6f9b292a27 100644 --- a/tests/src/main.rs +++ b/tests/src/main.rs @@ -122,7 +122,7 @@ impl Runner { "--crate-type dylib", "-Zunstable-options", "-Zcrate-attr=no_std", - "-Zcrate-attr=feature(register_attr,asm)", + "-Zcrate-attr=feature(register_attr,asm,asm_const,asm_experimental_arch)", "-Zcrate-attr=register_attr(spirv)", ] .join(" ") diff --git a/tests/ui/arch/debug_printf_type_checking.stderr b/tests/ui/arch/debug_printf_type_checking.stderr index 94a7c85efa..946707c23d 100644 --- a/tests/ui/arch/debug_printf_type_checking.stderr +++ b/tests/ui/arch/debug_printf_type_checking.stderr @@ -96,9 +96,9 @@ error[E0277]: the trait bound `{float}: Vector` is not satisfied > and 13 others note: required by a bound in `debug_printf_assert_is_vector` - --> $SPIRV_STD_SRC/lib.rs:146:8 + --> $SPIRV_STD_SRC/lib.rs:148:8 | -146 | V: crate::vector::Vector, +148 | V: crate::vector::Vector, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `debug_printf_assert_is_vector` error[E0308]: mismatched types diff --git a/tests/ui/dis/ptr_copy.normal.stderr b/tests/ui/dis/ptr_copy.normal.stderr index 5655da78a9..224bf8c158 100644 --- a/tests/ui/dis/ptr_copy.normal.stderr +++ b/tests/ui/dis/ptr_copy.normal.stderr @@ -1,7 +1,7 @@ error: Cannot memcpy dynamically sized data - --> $CORE_SRC/intrinsics.rs:2137:14 + --> $CORE_SRC/intrinsics.rs:2171:14 | -2137 | unsafe { copy(src, dst, count) } +2171 | unsafe { copy(src, dst, count) } | ^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/tests/ui/dis/ptr_read.stderr b/tests/ui/dis/ptr_read.stderr index eab27fc2ae..101902b858 100644 --- a/tests/ui/dis/ptr_read.stderr +++ b/tests/ui/dis/ptr_read.stderr @@ -2,7 +2,7 @@ %4 = OpFunctionParameter %5 %6 = OpFunctionParameter %5 %7 = OpLabel -OpLine %8 699 8 +OpLine %8 701 8 %9 = OpLoad %10 %4 OpLine %11 7 13 OpStore %6 %9 diff --git a/tests/ui/dis/ptr_read_method.stderr b/tests/ui/dis/ptr_read_method.stderr index eab27fc2ae..101902b858 100644 --- a/tests/ui/dis/ptr_read_method.stderr +++ b/tests/ui/dis/ptr_read_method.stderr @@ -2,7 +2,7 @@ %4 = OpFunctionParameter %5 %6 = OpFunctionParameter %5 %7 = OpLabel -OpLine %8 699 8 +OpLine %8 701 8 %9 = OpLoad %10 %4 OpLine %11 7 13 OpStore %6 %9 diff --git a/tests/ui/dis/ptr_write.stderr b/tests/ui/dis/ptr_write.stderr index 5810b25699..19948c68d5 100644 --- a/tests/ui/dis/ptr_write.stderr +++ b/tests/ui/dis/ptr_write.stderr @@ -4,7 +4,7 @@ %7 = OpLabel OpLine %8 7 35 %9 = OpLoad %10 %4 -OpLine %11 890 8 +OpLine %11 892 8 OpStore %6 %9 OpLine %8 8 1 OpReturn diff --git a/tests/ui/dis/ptr_write_method.stderr b/tests/ui/dis/ptr_write_method.stderr index f328e2975f..d18f00c68a 100644 --- a/tests/ui/dis/ptr_write_method.stderr +++ b/tests/ui/dis/ptr_write_method.stderr @@ -4,7 +4,7 @@ %7 = OpLabel OpLine %8 7 37 %9 = OpLoad %10 %4 -OpLine %11 890 8 +OpLine %11 892 8 OpStore %6 %9 OpLine %8 8 1 OpReturn diff --git a/tests/ui/image/gather_err.stderr b/tests/ui/image/gather_err.stderr index d114edfa76..22baf635ed 100644 --- a/tests/ui/image/gather_err.stderr +++ b/tests/ui/image/gather_err.stderr @@ -1,24 +1,34 @@ error[E0277]: the trait bound `Image: HasGather` is not satisfied - --> $DIR/gather_err.rs:15:34 - | -15 | let r1: glam::Vec4 = image1d.gather(*sampler, 0.0f32, 0); - | ^^^^^^ the trait `HasGather` is not implemented for `Image` - | - = help: the following implementations were found: - as HasGather> - as HasGather> - as HasGather> + --> $DIR/gather_err.rs:15:34 + | +15 | let r1: glam::Vec4 = image1d.gather(*sampler, 0.0f32, 0); + | ^^^^^^ the trait `HasGather` is not implemented for `Image` + | + = help: the following implementations were found: + as HasGather> + as HasGather> + as HasGather> +note: required by a bound in `Image::::gather` + --> $SPIRV_STD_SRC/image.rs:161:15 + | +161 | Self: HasGather, + | ^^^^^^^^^ required by this bound in `Image::::gather` error[E0277]: the trait bound `Image: HasGather` is not satisfied - --> $DIR/gather_err.rs:16:34 - | -16 | let r2: glam::Vec4 = image3d.gather(*sampler, v3, 0); - | ^^^^^^ the trait `HasGather` is not implemented for `Image` - | - = help: the following implementations were found: - as HasGather> - as HasGather> - as HasGather> + --> $DIR/gather_err.rs:16:34 + | +16 | let r2: glam::Vec4 = image3d.gather(*sampler, v3, 0); + | ^^^^^^ the trait `HasGather` is not implemented for `Image` + | + = help: the following implementations were found: + as HasGather> + as HasGather> + as HasGather> +note: required by a bound in `Image::::gather` + --> $SPIRV_STD_SRC/image.rs:161:15 + | +161 | Self: HasGather, + | ^^^^^^^^^ required by this bound in `Image::::gather` error: aborting due to 2 previous errors diff --git a/tests/ui/image/query/query_levels_err.stderr b/tests/ui/image/query/query_levels_err.stderr index fc6d7ee32f..f0c0664f65 100644 --- a/tests/ui/image/query/query_levels_err.stderr +++ b/tests/ui/image/query/query_levels_err.stderr @@ -1,14 +1,19 @@ error[E0277]: the trait bound `Image: HasQueryLevels` is not satisfied - --> $DIR/query_levels_err.rs:12:21 - | -12 | *output = image.query_levels(); - | ^^^^^^^^^^^^ the trait `HasQueryLevels` is not implemented for `Image` - | - = help: the following implementations were found: - as HasQueryLevels> - as HasQueryLevels> - as HasQueryLevels> - as HasQueryLevels> + --> $DIR/query_levels_err.rs:12:21 + | +12 | *output = image.query_levels(); + | ^^^^^^^^^^^^ the trait `HasQueryLevels` is not implemented for `Image` + | + = help: the following implementations were found: + as HasQueryLevels> + as HasQueryLevels> + as HasQueryLevels> + as HasQueryLevels> +note: required by a bound in `Image::::query_levels` + --> $SPIRV_STD_SRC/image.rs:818:15 + | +818 | Self: HasQueryLevels, + | ^^^^^^^^^^^^^^ required by this bound in `Image::::query_levels` error: aborting due to previous error diff --git a/tests/ui/image/query/query_lod_err.stderr b/tests/ui/image/query/query_lod_err.stderr index 0e6025720a..3a4b0dd1b9 100644 --- a/tests/ui/image/query/query_lod_err.stderr +++ b/tests/ui/image/query/query_lod_err.stderr @@ -1,14 +1,19 @@ error[E0277]: the trait bound `Image: HasQueryLevels` is not satisfied - --> $DIR/query_lod_err.rs:13:21 - | -13 | *output = image.query_lod(*sampler, glam::Vec2::new(0.0, 1.0)); - | ^^^^^^^^^ the trait `HasQueryLevels` is not implemented for `Image` - | - = help: the following implementations were found: - as HasQueryLevels> - as HasQueryLevels> - as HasQueryLevels> - as HasQueryLevels> + --> $DIR/query_lod_err.rs:13:21 + | +13 | *output = image.query_lod(*sampler, glam::Vec2::new(0.0, 1.0)); + | ^^^^^^^^^ the trait `HasQueryLevels` is not implemented for `Image` + | + = help: the following implementations were found: + as HasQueryLevels> + as HasQueryLevels> + as HasQueryLevels> + as HasQueryLevels> +note: required by a bound in `Image::::query_lod` + --> $SPIRV_STD_SRC/image.rs:844:15 + | +844 | Self: HasQueryLevels, + | ^^^^^^^^^^^^^^ required by this bound in `Image::::query_lod` error: aborting due to previous error diff --git a/tests/ui/image/query/query_size_err.stderr b/tests/ui/image/query/query_size_err.stderr index 8e2a2c2fc4..2eeadf7a9f 100644 --- a/tests/ui/image/query/query_size_err.stderr +++ b/tests/ui/image/query/query_size_err.stderr @@ -1,15 +1,20 @@ error[E0277]: the trait bound `Image: HasQuerySize` is not satisfied - --> $DIR/query_size_err.rs:12:21 - | -12 | *output = image.query_size(); - | ^^^^^^^^^^ the trait `HasQuerySize` is not implemented for `Image` - | - = help: the following implementations were found: - as HasQuerySize> - as HasQuerySize> - as HasQuerySize> - as HasQuerySize> - and 10 others + --> $DIR/query_size_err.rs:12:21 + | +12 | *output = image.query_size(); + | ^^^^^^^^^^ the trait `HasQuerySize` is not implemented for `Image` + | + = help: the following implementations were found: + as HasQuerySize> + as HasQuerySize> + as HasQuerySize> + as HasQuerySize> + and 10 others +note: required by a bound in `Image::::query_size` + --> $SPIRV_STD_SRC/image.rs:875:15 + | +875 | Self: HasQuerySize, + | ^^^^^^^^^^^^ required by this bound in `Image::::query_size` error: aborting due to previous error diff --git a/tests/ui/image/query/query_size_lod_err.stderr b/tests/ui/image/query/query_size_lod_err.stderr index cb037a425a..c4afc7963b 100644 --- a/tests/ui/image/query/query_size_lod_err.stderr +++ b/tests/ui/image/query/query_size_lod_err.stderr @@ -1,14 +1,19 @@ error[E0277]: the trait bound `Image: HasQuerySizeLod` is not satisfied - --> $DIR/query_size_lod_err.rs:12:21 - | -12 | *output = image.query_size_lod(0); - | ^^^^^^^^^^^^^^ the trait `HasQuerySizeLod` is not implemented for `Image` - | - = help: the following implementations were found: - as HasQuerySizeLod> - as HasQuerySizeLod> - as HasQuerySizeLod> - as HasQuerySizeLod> + --> $DIR/query_size_lod_err.rs:12:21 + | +12 | *output = image.query_size_lod(0); + | ^^^^^^^^^^^^^^ the trait `HasQuerySizeLod` is not implemented for `Image` + | + = help: the following implementations were found: + as HasQuerySizeLod> + as HasQuerySizeLod> + as HasQuerySizeLod> + as HasQuerySizeLod> +note: required by a bound in `Image::::query_size_lod` + --> $SPIRV_STD_SRC/image.rs:908:15 + | +908 | Self: HasQuerySizeLod, + | ^^^^^^^^^^^^^^^ required by this bound in `Image::::query_size_lod` error: aborting due to previous error