Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustup: update to nightly-2021-09-29. #759

Merged
merged 1 commit into from
Sep 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions crates/rustc_codegen_spirv/src/abi.rs
Original file line number Diff line number Diff line change
@@ -9,18 +9,17 @@ use rustc_data_structures::fx::FxHashMap;
use rustc_errors::ErrorReported;
use rustc_index::vec::Idx;
use rustc_middle::bug;
use rustc_middle::ty::layout::{FnAbiExt, TyAndLayout};
use rustc_middle::ty::layout::{FnAbiOf, LayoutOf, TyAndLayout};
use rustc_middle::ty::subst::SubstsRef;
use rustc_middle::ty::{
Const, FloatTy, GeneratorSubsts, IntTy, ParamEnv, PolyFnSig, Ty, TyKind, TypeAndMut, UintTy,
self, Const, FloatTy, GeneratorSubsts, IntTy, ParamEnv, PolyFnSig, Ty, TyKind, TypeAndMut,
UintTy,
};
use rustc_span::def_id::DefId;
use rustc_span::Span;
use rustc_span::DUMMY_SP;
use rustc_target::abi::call::{CastTarget, FnAbi, PassMode, Reg, RegKind};
use rustc_target::abi::{
Abi, Align, FieldsShape, LayoutOf, Primitive, Scalar, Size, VariantIdx, Variants,
};
use rustc_target::abi::{Abi, Align, FieldsShape, Primitive, Scalar, Size, VariantIdx, Variants};
use std::cell::RefCell;
use std::collections::hash_map::Entry;
use std::fmt;
@@ -150,13 +149,17 @@ impl<'tcx> ConvSpirvType<'tcx> for PointeeTy<'tcx> {
fn spirv_type(&self, span: Span, cx: &CodegenCx<'tcx>) -> Word {
match *self {
PointeeTy::Ty(ty) => ty.spirv_type(span, cx),
PointeeTy::Fn(ty) => FnAbi::of_fn_ptr(cx, ty, &[]).spirv_type(span, cx),
PointeeTy::Fn(ty) => cx
.fn_abi_of_fn_ptr(ty, ty::List::empty())
.spirv_type(span, cx),
}
}
fn spirv_type_immediate(&self, span: Span, cx: &CodegenCx<'tcx>) -> Word {
match *self {
PointeeTy::Ty(ty) => ty.spirv_type_immediate(span, cx),
PointeeTy::Fn(ty) => FnAbi::of_fn_ptr(cx, ty, &[]).spirv_type_immediate(span, cx),
PointeeTy::Fn(ty) => cx
.fn_abi_of_fn_ptr(ty, ty::List::empty())
.spirv_type_immediate(span, cx),
}
}
}
21 changes: 0 additions & 21 deletions crates/rustc_codegen_spirv/src/attr.rs
Original file line number Diff line number Diff line change
@@ -476,27 +476,13 @@ impl<'tcx> Visitor<'tcx> for CheckSpirvAttrVisitor<'tcx> {
intravisit::walk_variant(self, variant, generics, item_id);
}

fn visit_macro_def(&mut self, macro_def: &'tcx hir::MacroDef<'tcx>) {
self.check_spirv_attributes(macro_def.hir_id(), Target::MacroDef);
intravisit::walk_macro_def(self, macro_def);
}

fn visit_param(&mut self, param: &'tcx hir::Param<'tcx>) {
self.check_spirv_attributes(param.hir_id, Target::Param);

intravisit::walk_param(self, param);
}
}

fn check_invalid_macro_level_spirv_attr(tcx: TyCtxt<'_>, sym: &Symbols, attrs: &[Attribute]) {
for attr in attrs {
if attr.has_name(sym.spirv) {
tcx.sess
.span_err(attr.span, "#[spirv(..)] cannot be applied to a macro");
}
}
}

// FIXME(eddyb) DRY this somehow and make it reusable from somewhere in `rustc`.
fn check_mod_attrs(tcx: TyCtxt<'_>, module_def_id: LocalDefId) {
let check_spirv_attr_visitor = &mut CheckSpirvAttrVisitor {
@@ -507,13 +493,6 @@ fn check_mod_attrs(tcx: TyCtxt<'_>, module_def_id: LocalDefId) {
module_def_id,
&mut check_spirv_attr_visitor.as_deep_visitor(),
);
tcx.hir()
.visit_exported_macros_in_krate(check_spirv_attr_visitor);
check_invalid_macro_level_spirv_attr(
tcx,
&check_spirv_attr_visitor.sym,
tcx.hir().krate().non_exported_macro_attrs,
);
if module_def_id.is_top_level_module() {
check_spirv_attr_visitor.check_spirv_attributes(CRATE_HIR_ID, Target::Mod);
}
7 changes: 3 additions & 4 deletions crates/rustc_codegen_spirv/src/builder/builder_methods.rs
Original file line number Diff line number Diff line change
@@ -16,10 +16,9 @@ use rustc_codegen_ssa::MemFlags;
use rustc_middle::bug;
use rustc_middle::ty::Ty;
use rustc_span::Span;
use rustc_target::abi::{Abi, Align, Scalar, Size};
use rustc_target::abi::{Abi, Align, Scalar, Size, WrappingRange};
use std::convert::TryInto;
use std::iter::{self, empty};
use std::ops::Range;

macro_rules! simple_op {
(
@@ -794,7 +793,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {

// silly clippy, we can't rename this!
#[allow(clippy::wrong_self_convention)]
fn to_immediate_scalar(&mut self, val: Self::Value, scalar: &Scalar) -> Self::Value {
fn to_immediate_scalar(&mut self, val: Self::Value, scalar: Scalar) -> Self::Value {
if scalar.is_bool() {
let bool = SpirvType::Bool.def(self.span(), self);
return self.trunc(val, bool);
@@ -982,7 +981,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
self
}

fn range_metadata(&mut self, _load: Self::Value, _range: Range<u128>) {
fn range_metadata(&mut self, _load: Self::Value, _range: WrappingRange) {
// ignore
}

2 changes: 1 addition & 1 deletion crates/rustc_codegen_spirv/src/builder/intrinsics.rs
Original file line number Diff line number Diff line change
@@ -8,11 +8,11 @@ use rustc_codegen_ssa::mir::operand::OperandRef;
use rustc_codegen_ssa::mir::place::PlaceRef;
use rustc_codegen_ssa::traits::{BuilderMethods, IntrinsicCallMethods};
use rustc_middle::bug;
use rustc_middle::ty::layout::LayoutOf;
use rustc_middle::ty::{FnDef, Instance, ParamEnv, Ty, TyKind};
use rustc_span::source_map::Span;
use rustc_span::sym;
use rustc_target::abi::call::{FnAbi, PassMode};
use rustc_target::abi::LayoutOf;

fn int_type_width_signed(ty: Ty<'_>, cx: &CodegenCx<'_>) -> Option<(u64, bool)> {
match ty.kind() {
31 changes: 24 additions & 7 deletions crates/rustc_codegen_spirv/src/builder/mod.rs
Original file line number Diff line number Diff line change
@@ -24,12 +24,15 @@ use rustc_errors::DiagnosticBuilder;
use rustc_middle::mir::coverage::{
CodeRegion, CounterValueReference, ExpressionOperandId, InjectedExpressionId, Op,
};
use rustc_middle::ty::layout::{HasParamEnv, HasTyCtxt, TyAndLayout};
use rustc_middle::ty::layout::{
FnAbiError, FnAbiOfHelpers, FnAbiRequest, HasParamEnv, HasTyCtxt, LayoutError, LayoutOfHelpers,
TyAndLayout,
};
use rustc_middle::ty::{Instance, ParamEnv, Ty, TyCtxt};
use rustc_span::def_id::DefId;
use rustc_span::source_map::Span;
use rustc_target::abi::call::{ArgAbi, FnAbi, PassMode};
use rustc_target::abi::{HasDataLayout, LayoutOf, Size, TargetDataLayout};
use rustc_target::abi::{HasDataLayout, Size, TargetDataLayout};
use rustc_target::spec::{HasTargetSpec, Target};
use std::ops::Deref;

@@ -389,11 +392,25 @@ impl<'a, 'tcx> HasDataLayout for Builder<'a, 'tcx> {
}
}

impl<'a, 'tcx> LayoutOf for Builder<'a, 'tcx> {
type Ty = Ty<'tcx>;
type TyAndLayout = TyAndLayout<'tcx>;
impl<'tcx> LayoutOfHelpers<'tcx> for Builder<'_, 'tcx> {
type LayoutOfResult = TyAndLayout<'tcx>;

#[inline]
fn handle_layout_err(&self, err: LayoutError<'tcx>, span: Span, ty: Ty<'tcx>) -> ! {
self.cx.handle_layout_err(err, span, ty)
}
}

impl<'tcx> FnAbiOfHelpers<'tcx> for Builder<'_, 'tcx> {
type FnAbiOfResult = &'tcx FnAbi<'tcx, Ty<'tcx>>;

fn layout_of(&self, ty: Ty<'tcx>) -> Self::TyAndLayout {
self.cx.layout_of(ty)
#[inline]
fn handle_fn_abi_err(
&self,
err: FnAbiError<'tcx>,
span: Span,
fn_abi_request: FnAbiRequest<'tcx>,
) -> ! {
self.cx.handle_fn_abi_err(err, span, fn_abi_request)
}
}
13 changes: 7 additions & 6 deletions crates/rustc_codegen_spirv/src/codegen_cx/constant.rs
Original file line number Diff line number Diff line change
@@ -6,12 +6,13 @@ use rspirv::spirv::Word;
use rustc_codegen_ssa::mir::place::PlaceRef;
use rustc_codegen_ssa::traits::{BaseTypeMethods, ConstMethods, MiscMethods, StaticMethods};
use rustc_middle::bug;
use rustc_middle::mir::interpret::{alloc_range, Allocation, GlobalAlloc, ScalarMaybeUninit};
use rustc_middle::ty::layout::TyAndLayout;
use rustc_mir::interpret::Scalar;
use rustc_middle::mir::interpret::{
alloc_range, Allocation, GlobalAlloc, Scalar, ScalarMaybeUninit,
};
use rustc_middle::ty::layout::{LayoutOf, TyAndLayout};
use rustc_span::symbol::Symbol;
use rustc_span::{Span, DUMMY_SP};
use rustc_target::abi::{self, AddressSpace, HasDataLayout, Integer, LayoutOf, Primitive, Size};
use rustc_target::abi::{self, AddressSpace, HasDataLayout, Integer, Primitive, Size};

impl<'tcx> CodegenCx<'tcx> {
pub fn constant_u8(&self, span: Span, val: u8) -> SpirvValue {
@@ -207,7 +208,7 @@ impl<'tcx> ConstMethods<'tcx> for CodegenCx<'tcx> {
fn scalar_to_backend(
&self,
scalar: Scalar,
layout: &abi::Scalar,
layout: abi::Scalar,
ty: Self::Type,
) -> Self::Value {
match scalar {
@@ -426,7 +427,7 @@ impl<'tcx> CodegenCx<'tcx> {
// tldr, the pointer here is only needed for the offset
let value = match alloc.read_scalar(self, alloc_range(*offset, size)).unwrap() {
ScalarMaybeUninit::Scalar(scalar) => {
self.scalar_to_backend(scalar, &self.primitive_to_scalar(primitive), ty)
self.scalar_to_backend(scalar, self.primitive_to_scalar(primitive), ty)
}
ScalarMaybeUninit::Uninit => self.undef(ty),
};
9 changes: 4 additions & 5 deletions crates/rustc_codegen_spirv/src/codegen_cx/declare.rs
Original file line number Diff line number Diff line change
@@ -9,12 +9,11 @@ use rustc_codegen_ssa::traits::{BaseTypeMethods, PreDefineMethods, StaticMethods
use rustc_middle::bug;
use rustc_middle::middle::codegen_fn_attrs::{CodegenFnAttrFlags, CodegenFnAttrs};
use rustc_middle::mir::mono::{Linkage, MonoItem, Visibility};
use rustc_middle::ty::layout::FnAbiExt;
use rustc_middle::ty::layout::{FnAbiOf, LayoutOf};
use rustc_middle::ty::{self, Instance, ParamEnv, TypeFoldable};
use rustc_span::def_id::DefId;
use rustc_span::Span;
use rustc_target::abi::call::FnAbi;
use rustc_target::abi::{Align, LayoutOf};
use rustc_target::abi::Align;

fn attrs_to_spirv(attrs: &CodegenFnAttrs) -> FunctionControl {
let mut control = FunctionControl::NONE;
@@ -58,7 +57,7 @@ impl<'tcx> CodegenCx<'tcx> {
// PreDefineMethods::predefine_fn -> declare_fn_ext
fn declare_fn_ext(&self, instance: Instance<'tcx>, linkage: Option<LinkageType>) -> SpirvValue {
let control = attrs_to_spirv(self.tcx.codegen_fn_attrs(instance.def_id()));
let fn_abi = FnAbi::of_instance(self, instance, &[]);
let fn_abi = self.fn_abi_of_instance(instance, ty::List::empty());
let span = self.tcx.def_span(instance.def_id());
let function_type = fn_abi.spirv_type(span, self);
let (return_type, argument_types) = match self.lookup_type(function_type) {
@@ -116,7 +115,7 @@ impl<'tcx> CodegenCx<'tcx> {
.as_ref()
.map(ToString::to_string)
.unwrap_or_else(|| instance.to_string());
self.entry_stub(&instance, &fn_abi, declared, entry_name, entry);
self.entry_stub(&instance, fn_abi, declared, entry_name, entry);
}
if attrs.unroll_loops.is_some() {
self.unroll_loops_decorations.borrow_mut().insert(fn_id);
4 changes: 2 additions & 2 deletions crates/rustc_codegen_spirv/src/codegen_cx/entry.rs
Original file line number Diff line number Diff line change
@@ -11,12 +11,12 @@ use rspirv::spirv::{
use rustc_codegen_ssa::traits::{BaseTypeMethods, BuilderMethods};
use rustc_data_structures::fx::FxHashMap;
use rustc_hir as hir;
use rustc_middle::ty::layout::TyAndLayout;
use rustc_middle::ty::layout::{LayoutOf, TyAndLayout};
use rustc_middle::ty::{Instance, Ty, TyKind};
use rustc_span::Span;
use rustc_target::abi::{
call::{ArgAbi, ArgAttribute, ArgAttributes, FnAbi, PassMode},
LayoutOf, Size,
Size,
};

impl<'tcx> CodegenCx<'tcx> {
70 changes: 52 additions & 18 deletions crates/rustc_codegen_spirv/src/codegen_cx/type_.rs
Original file line number Diff line number Diff line change
@@ -4,31 +4,65 @@ use crate::spirv_type::SpirvType;
use rspirv::spirv::Word;
use rustc_codegen_ssa::common::TypeKind;
use rustc_codegen_ssa::traits::{BaseTypeMethods, LayoutTypeMethods};
use rustc_middle::bug;
use rustc_middle::ty::layout::{LayoutError, TyAndLayout};
use rustc_middle::ty::{ParamEnv, Ty};
use rustc_middle::ty::layout::{
FnAbiError, FnAbiOfHelpers, FnAbiRequest, LayoutError, LayoutOfHelpers, TyAndLayout,
};
use rustc_middle::ty::Ty;
use rustc_middle::{bug, span_bug};
use rustc_span::source_map::{Span, DUMMY_SP};
use rustc_target::abi::call::{CastTarget, FnAbi, Reg};
use rustc_target::abi::{Abi, AddressSpace, FieldsShape, LayoutOf};
use rustc_target::abi::{Abi, AddressSpace, FieldsShape};

impl<'tcx> LayoutOf for CodegenCx<'tcx> {
type Ty = Ty<'tcx>;
type TyAndLayout = TyAndLayout<'tcx>;
impl<'tcx> LayoutOfHelpers<'tcx> for CodegenCx<'tcx> {
type LayoutOfResult = TyAndLayout<'tcx>;

fn layout_of(&self, ty: Ty<'tcx>) -> Self::TyAndLayout {
self.spanned_layout_of(ty, DUMMY_SP)
#[inline]
fn handle_layout_err(&self, err: LayoutError<'tcx>, span: Span, ty: Ty<'tcx>) -> ! {
if let LayoutError::SizeOverflow(_) = err {
self.tcx.sess.span_fatal(span, &err.to_string())
} else {
span_bug!(span, "failed to get layout for `{}`: {}", ty, err)
}
}
}

fn spanned_layout_of(&self, ty: Ty<'tcx>, span: Span) -> Self::TyAndLayout {
self.tcx
.layout_of(ParamEnv::reveal_all().and(ty))
.unwrap_or_else(|e| {
if let LayoutError::SizeOverflow(_) = e {
self.tcx.sess.span_fatal(span, &e.to_string())
} else {
bug!("failed to get layout for `{}`: {}", ty, e)
impl<'tcx> FnAbiOfHelpers<'tcx> for CodegenCx<'tcx> {
type FnAbiOfResult = &'tcx FnAbi<'tcx, Ty<'tcx>>;

#[inline]
fn handle_fn_abi_err(
&self,
err: FnAbiError<'tcx>,
span: Span,
fn_abi_request: FnAbiRequest<'tcx>,
) -> ! {
if let FnAbiError::Layout(LayoutError::SizeOverflow(_)) = err {
self.tcx.sess.span_fatal(span, &err.to_string())
} else {
match fn_abi_request {
FnAbiRequest::OfFnPtr { sig, extra_args } => {
span_bug!(
span,
"`fn_abi_of_fn_ptr({}, {:?})` failed: {}",
sig,
extra_args,
err
);
}
})
FnAbiRequest::OfInstance {
instance,
extra_args,
} => {
span_bug!(
span,
"`fn_abi_of_instance({}, {:?})` failed: {}",
instance,
extra_args,
err
);
}
}
}
}
}

4 changes: 2 additions & 2 deletions crates/rustc_codegen_spirv/src/lib.rs
Original file line number Diff line number Diff line change
@@ -118,7 +118,6 @@ extern crate rustc_hir;
extern crate rustc_index;
extern crate rustc_interface;
extern crate rustc_middle;
extern crate rustc_mir;
extern crate rustc_session;
extern crate rustc_span;
extern crate rustc_target;
@@ -171,9 +170,9 @@ use rustc_errors::{ErrorReported, FatalError, Handler};
use rustc_middle::dep_graph::{WorkProduct, WorkProductId};
use rustc_middle::middle::cstore::EncodedMetadata;
use rustc_middle::mir::mono::{Linkage, MonoItem, Visibility};
use rustc_middle::mir::pretty::write_mir_pretty;
use rustc_middle::ty::print::with_no_trimmed_paths;
use rustc_middle::ty::{self, query, DefIdTree, Instance, InstanceDef, TyCtxt};
use rustc_mir::util::write_mir_pretty;
use rustc_session::config::{self, OptLevel, OutputFilenames, OutputType};
use rustc_session::Session;
use rustc_span::symbol::{sym, Symbol};
@@ -500,6 +499,7 @@ impl ExtraBackendMethods for SpirvCodegenBackend {
&self,
_: TyCtxt<'tcx>,
_: &mut Self::Module,
_: &str,
_: AllocatorKind,
_: bool,
) {
4 changes: 2 additions & 2 deletions crates/spirv-std/src/lib.rs
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
),
register_attr(spirv)
)]
#![feature(const_generics)]
#![feature(adt_const_params)]
// BEGIN - Embark standard lints v0.4
// do not change or add/remove here, but one can add exceptions after this section
// for more info see: <https://github.com/EmbarkStudios/rust-ecosystem/issues/59>
@@ -88,7 +88,7 @@
// We deblierately provide an unimplemented version of our API on CPU
// platforms so that code completion still works.
clippy::unimplemented,
// The part of `const-generics` we're using (C-like enums) is not incomplete.
// The part of `adt_const_params` we're using (C-like enums) is not incomplete.
incomplete_features,
)]

2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -5,5 +5,5 @@
# to the user in the error, instead of "error: invalid channel name '[toolchain]'".

[toolchain]
channel = "nightly-2021-08-27"
channel = "nightly-2021-09-29"
components = ["rust-src", "rustc-dev", "llvm-tools-preview"]
2 changes: 1 addition & 1 deletion tests/ui/arch/control_barrier.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// build-pass

#![feature(const_generics)]
#![feature(adt_const_params)]
#![allow(incomplete_features)]

use spirv_std::memory::{Scope, Semantics};
2 changes: 1 addition & 1 deletion tests/ui/arch/memory_barrier.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// build-pass

#![feature(const_generics)]
#![feature(adt_const_params)]
#![allow(incomplete_features)]

use spirv_std::memory::{Scope, Semantics};
2 changes: 1 addition & 1 deletion tests/ui/dis/generic-fn-op-name.rs
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
// normalize-stderr-test "OpExtension .SPV_KHR_vulkan_memory_model.\n" -> ""
// normalize-stderr-test "OpMemoryModel Logical Vulkan" -> "OpMemoryModel Logical Simple"

#![feature(const_generics)]
#![feature(adt_const_params)]
#![allow(incomplete_features)]

use spirv_std::image::Dimensionality;
4 changes: 2 additions & 2 deletions tests/ui/dis/ptr_copy.normal.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
error: Cannot memcpy dynamically sized data
--> $CORE_SRC/intrinsics.rs:2138:14
--> $CORE_SRC/intrinsics.rs:2137:14
|
2138 | unsafe { copy(src, dst, count) }
2137 | unsafe { copy(src, dst, count) }
| ^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error
4 changes: 2 additions & 2 deletions tests/ui/dis/ptr_read.stderr
Original file line number Diff line number Diff line change
@@ -5,9 +5,9 @@
%8 = OpVariable %5 Function
OpLine %9 319 5
OpStore %8 %10
OpLine %11 703 8
OpLine %11 699 8
OpCopyMemory %8 %4
OpLine %11 704 8
OpLine %11 700 8
%12 = OpLoad %13 %8
OpLine %14 7 13
OpStore %6 %12
4 changes: 2 additions & 2 deletions tests/ui/dis/ptr_read_method.stderr
Original file line number Diff line number Diff line change
@@ -5,9 +5,9 @@
%8 = OpVariable %5 Function
OpLine %9 319 5
OpStore %8 %10
OpLine %11 703 8
OpLine %11 699 8
OpCopyMemory %8 %4
OpLine %11 704 8
OpLine %11 700 8
%12 = OpLoad %13 %8
OpLine %14 7 13
OpStore %6 %12
2 changes: 1 addition & 1 deletion tests/ui/dis/ptr_write.stderr
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ OpLine %9 7 35
%10 = OpLoad %11 %4
OpLine %9 7 13
OpStore %8 %10
OpLine %12 894 8
OpLine %12 890 8
OpCopyMemory %6 %8
OpLine %9 8 1
OpReturn
2 changes: 1 addition & 1 deletion tests/ui/dis/ptr_write_method.stderr
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ OpLine %9 7 37
%10 = OpLoad %11 %4
OpLine %12 1013 17
OpStore %8 %10
OpLine %13 894 8
OpLine %13 890 8
OpCopyMemory %6 %8
OpLine %9 8 1
OpReturn
2 changes: 1 addition & 1 deletion tests/ui/dis/unroll_loops.stderr
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ OpBranchConditional %17 %22 %21
%22 = OpLabel
OpLine %7 9 10
%23 = OpSLessThan %18 %10 %24
OpLine %7 9 4
OpLine %7 9 10
OpSelectionMerge %25 None
OpBranchConditional %23 %26 %27
%26 = OpLabel
8 changes: 4 additions & 4 deletions tests/ui/spirv-attr/invalid-target.rs
Original file line number Diff line number Diff line change
@@ -17,10 +17,10 @@
// * builtin: `position`

// NOTE(eddyb) accounting for the number of errors this test actually produces:
// * 461 "attribute is only valid on" errors (see `invalid-target.stderr`)
// * 40 `#[spirv(...)]` (excluding `macro_rules!`, which doesn't get the above error)
// * at most 12 attributes per `#[spirv(...)]`, so an upper bound of `40*12 = 480`
// * the difference between 480 and 461 is 19, i.e. valid attributes, made up of:
// * 473 errors, all "attribute is only valid on" (see `invalid-target.stderr`)
// * 41 uses of `#[spirv(...)]` in this test
// * at most 12 attributes per `#[spirv(...)]`, so an upper bound of `41*12 = 492`
// * the difference between 492 and 473 is 19, i.e. valid attributes, made up of:
// * 4 on `_Struct`
// * 8 on functions, i.e. 2 on each of:
// * `_inherent_method`
493 changes: 277 additions & 216 deletions tests/ui/spirv-attr/invalid-target.stderr

Large diffs are not rendered by default.