mirror of
https://github.com/EmbarkStudios/rust-gpu.git
synced 2024-11-21 22:34:34 +00:00
Fixed compile errors
This commit is contained in:
parent
4701143416
commit
ec6207e664
@ -496,7 +496,7 @@ fn check_mod_attrs(tcx: TyCtxt<'_>, module_def_id: LocalDefId) {
|
||||
sym: Symbols::get(),
|
||||
};
|
||||
tcx.hir()
|
||||
.deep_visit_item_likes_in_module(module_def_id, check_spirv_attr_visitor);
|
||||
.visit_item_likes_in_module(module_def_id, check_spirv_attr_visitor);
|
||||
if module_def_id.is_top_level_module() {
|
||||
check_spirv_attr_visitor.check_spirv_attributes(CRATE_HIR_ID, Target::Mod);
|
||||
}
|
||||
|
@ -10,7 +10,6 @@ use rustc_middle::mir::interpret::{
|
||||
alloc_range, ConstAllocation, 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, Primitive, Size};
|
||||
|
||||
@ -168,8 +167,8 @@ impl<'tcx> ConstMethods<'tcx> for CodegenCx<'tcx> {
|
||||
self.constant_float(t, val)
|
||||
}
|
||||
|
||||
fn const_str(&self, s: Symbol) -> (Self::Value, Self::Value) {
|
||||
let len = s.as_str().len();
|
||||
fn const_str(&self, s: &str) -> (Self::Value, Self::Value) {
|
||||
let len = s.len();
|
||||
let str_ty = self
|
||||
.layout_of(self.tcx.types.str_)
|
||||
.spirv_type(DUMMY_SP, self);
|
||||
@ -317,6 +316,11 @@ impl<'tcx> ConstMethods<'tcx> for CodegenCx<'tcx> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn zst_to_backend(&self, _llty: Self::Type) -> Self::Value {
|
||||
unreachable!();
|
||||
}
|
||||
|
||||
// FIXME(eddyb) this shouldn't exist, and is only used by vtable creation,
|
||||
// see https://github.com/rust-lang/rust/pull/86475#discussion_r680792727.
|
||||
fn const_data_from_alloc(&self, _alloc: ConstAllocation<'tcx>) -> Self::Value {
|
||||
|
@ -10,7 +10,7 @@ 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::{FnAbiOf, LayoutOf};
|
||||
use rustc_middle::ty::{self, Instance, ParamEnv, TypeFoldable};
|
||||
use rustc_middle::ty::{self, Instance, ParamEnv, TypeVisitable};
|
||||
use rustc_span::def_id::DefId;
|
||||
use rustc_span::Span;
|
||||
use rustc_target::abi::Align;
|
||||
|
Loading…
Reference in New Issue
Block a user