mirror of
https://github.com/EmbarkStudios/rust-gpu.git
synced 2024-11-22 06:45:13 +00:00
rustup update, and edition = 2021 (#775)
This commit is contained in:
parent
4831789bbb
commit
f58c6f20af
@ -717,8 +717,7 @@ impl<'cx, 'tcx> Builder<'cx, 'tcx> {
|
||||
|
||||
// FIXME(eddyb) try multiple signatures until one fits.
|
||||
let mut sig = match instruction_signatures(instruction.class.opcode)? {
|
||||
[sig
|
||||
@ InstSig {
|
||||
[sig @ InstSig {
|
||||
output_type: Some(_),
|
||||
..
|
||||
}] => *sig,
|
||||
|
@ -588,7 +588,12 @@ impl<'tcx> MiscMethods<'tcx> for CodegenCx<'tcx> {
|
||||
}
|
||||
|
||||
impl<'tcx> DebugInfoMethods<'tcx> for CodegenCx<'tcx> {
|
||||
fn create_vtable_metadata(&self, _ty: Ty<'tcx>, _vtable: Self::Value) {
|
||||
fn create_vtable_metadata(
|
||||
&self,
|
||||
_ty: Ty<'tcx>,
|
||||
_trait_ref: Option<PolyExistentialTraitRef<'tcx>>,
|
||||
_vtable: Self::Value,
|
||||
) {
|
||||
// Ignore.
|
||||
}
|
||||
|
||||
|
@ -117,6 +117,7 @@ extern crate rustc_errors;
|
||||
extern crate rustc_hir;
|
||||
extern crate rustc_index;
|
||||
extern crate rustc_interface;
|
||||
extern crate rustc_metadata;
|
||||
extern crate rustc_middle;
|
||||
extern crate rustc_session;
|
||||
extern crate rustc_span;
|
||||
@ -167,8 +168,8 @@ use rustc_codegen_ssa::traits::{
|
||||
use rustc_codegen_ssa::{CodegenResults, CompiledModule, ModuleCodegen, ModuleKind};
|
||||
use rustc_data_structures::fx::FxHashMap;
|
||||
use rustc_errors::{ErrorReported, FatalError, Handler};
|
||||
use rustc_metadata::EncodedMetadata;
|
||||
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;
|
||||
@ -211,7 +212,7 @@ fn is_blocklisted_fn<'tcx>(
|
||||
) -> bool {
|
||||
// TODO: These sometimes have a constant value of an enum variant with a hole
|
||||
if let InstanceDef::Item(def) = instance.def {
|
||||
if let Some(debug_trait_def_id) = tcx.get_diagnostic_item(sym::debug_trait) {
|
||||
if let Some(debug_trait_def_id) = tcx.get_diagnostic_item(sym::Debug) {
|
||||
// Helper for detecting `<_ as core::fmt::Debug>::fmt` (in impls).
|
||||
let is_debug_fmt_method = |def_id| match tcx.opt_associated_item(def_id) {
|
||||
Some(assoc) if assoc.ident.name == sym::fmt => match assoc.container {
|
||||
|
@ -102,7 +102,11 @@ fn link_rlib(sess: &Session, codegen_results: &CodegenResults, out_filename: &Pa
|
||||
}
|
||||
}
|
||||
|
||||
create_archive(&file_list, &codegen_results.metadata.raw_data, out_filename);
|
||||
create_archive(
|
||||
&file_list,
|
||||
codegen_results.metadata.raw_data(),
|
||||
out_filename,
|
||||
);
|
||||
}
|
||||
|
||||
fn link_exe(
|
||||
|
@ -53,7 +53,7 @@ pub fn inline(sess: &Session, module: &mut Module) -> super::Result<()> {
|
||||
})
|
||||
});
|
||||
let mut inliner = Inliner {
|
||||
header: &mut module.header.as_mut().unwrap(),
|
||||
header: module.header.as_mut().unwrap(),
|
||||
types_global_values: &mut module.types_global_values,
|
||||
void,
|
||||
functions: &functions,
|
||||
|
@ -37,7 +37,7 @@ pub struct Options {
|
||||
}
|
||||
|
||||
pub enum LinkResult {
|
||||
SingleModule(Module),
|
||||
SingleModule(Box<Module>),
|
||||
MultipleModules(FxHashMap<String, Module>),
|
||||
}
|
||||
|
||||
@ -107,8 +107,8 @@ pub fn link(sess: &Session, mut inputs: Vec<Module>, opts: &Options) -> Result<L
|
||||
let mut bound = inputs[0].header.as_ref().unwrap().bound - 1;
|
||||
let version = inputs[0].header.as_ref().unwrap().version();
|
||||
|
||||
for mut module in inputs.iter_mut().skip(1) {
|
||||
simple_passes::shift_ids(&mut module, bound);
|
||||
for module in inputs.iter_mut().skip(1) {
|
||||
simple_passes::shift_ids(module, bound);
|
||||
bound += module.header.as_ref().unwrap().bound - 1;
|
||||
let this_version = module.header.as_ref().unwrap().version();
|
||||
if version != this_version {
|
||||
@ -293,11 +293,11 @@ pub fn link(sess: &Session, mut inputs: Vec<Module>, opts: &Options) -> Result<L
|
||||
.collect();
|
||||
LinkResult::MultipleModules(modules)
|
||||
} else {
|
||||
LinkResult::SingleModule(output)
|
||||
LinkResult::SingleModule(Box::new(output))
|
||||
};
|
||||
|
||||
let output_module_iter: Box<dyn Iterator<Item = &mut Module>> = match output {
|
||||
LinkResult::SingleModule(ref mut m) => Box::new(std::iter::once(m)),
|
||||
LinkResult::SingleModule(ref mut m) => Box::new(std::iter::once(&mut *m as &mut Module)),
|
||||
LinkResult::MultipleModules(ref mut m) => Box::new(m.values_mut()),
|
||||
};
|
||||
for (i, output) in output_module_iter.enumerate() {
|
||||
|
@ -99,7 +99,7 @@ fn assemble_and_link(binaries: &[&[u8]]) -> Result<Module, String> {
|
||||
);
|
||||
assert_eq!(compiler.session().has_errors(), res.is_err());
|
||||
res.map(|res| match res {
|
||||
LinkResult::SingleModule(m) => m,
|
||||
LinkResult::SingleModule(m) => *m,
|
||||
LinkResult::MultipleModules(_) => unreachable!(),
|
||||
})
|
||||
})
|
||||
|
@ -36,7 +36,7 @@ pub fn read_deps_file_from(
|
||||
|
||||
loop {
|
||||
line.clear();
|
||||
if file.read_until(b'\n', &mut line.as_mut_bytes())? == 0 {
|
||||
if file.read_until(b'\n', line.as_mut_bytes())? == 0 {
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,10 @@
|
||||
use crate::vector::Vector;
|
||||
|
||||
/// Abstract trait representing a SPIR-V floating point type.
|
||||
///
|
||||
/// # Safety
|
||||
/// Implementing this trait on non-primitive-float types breaks assumptions of other unsafe code,
|
||||
/// and should not be done.
|
||||
pub unsafe trait Float: num_traits::Float + crate::scalar::Scalar + Default {
|
||||
const WIDTH: usize;
|
||||
}
|
||||
|
@ -1,4 +1,8 @@
|
||||
/// Abstract trait representing any SPIR-V integer type.
|
||||
///
|
||||
/// # Safety
|
||||
/// Implementing this trait on non-primitive-integer types breaks assumptions of other unsafe code,
|
||||
/// and should not be done.
|
||||
pub unsafe trait Integer: num_traits::PrimInt + crate::scalar::Scalar {
|
||||
const WIDTH: usize;
|
||||
const SIGNED: bool;
|
||||
|
@ -1,4 +1,8 @@
|
||||
/// Abstract trait representing a SPIR-V scalar type.
|
||||
///
|
||||
/// # Safety
|
||||
/// Implementing this trait on non-scalar types breaks assumptions of other unsafe code, and should
|
||||
/// not be done.
|
||||
pub unsafe trait Scalar: Copy + Default + crate::sealed::Sealed {}
|
||||
|
||||
unsafe impl Scalar for bool {}
|
||||
|
@ -1,4 +1,8 @@
|
||||
/// Abstract trait representing a SPIR-V vector type.
|
||||
///
|
||||
/// # Safety
|
||||
/// Implementing this trait on non-simd-vector types breaks assumptions of other unsafe code, and
|
||||
/// should not be done.
|
||||
pub unsafe trait Vector<T: crate::scalar::Scalar, const N: usize>: Default {}
|
||||
|
||||
#[cfg(feature = "glam")]
|
||||
|
@ -5,5 +5,5 @@
|
||||
# to the user in the error, instead of "error: invalid channel name '[toolchain]'".
|
||||
|
||||
[toolchain]
|
||||
channel = "nightly-2021-09-29"
|
||||
channel = "nightly-2021-10-26"
|
||||
components = ["rust-src", "rustc-dev", "llvm-tools-preview"]
|
||||
|
@ -84,7 +84,7 @@ error[E0277]: the trait bound `{float}: Vector<f32, 2_usize>` is not satisfied
|
||||
--> $DIR/debug_printf_type_checking.rs:22:31
|
||||
|
|
||||
22 | debug_printf!("%v2f", 11.0);
|
||||
| ----------------------^^^^--
|
||||
| ----------------------^^^^-
|
||||
| | |
|
||||
| | the trait `Vector<f32, 2_usize>` is not implemented for `{float}`
|
||||
| required by a bound introduced by this call
|
||||
|
@ -12,7 +12,7 @@ pub fn main(
|
||||
output: &mut glam::Vec4,
|
||||
) {
|
||||
let v3 = glam::Vec3::new(0.0, 1.0, 0.5);
|
||||
let r1: glam::Vec4 = image1d.gather(*sampler, 0.0, 0);
|
||||
let r1: glam::Vec4 = image1d.gather(*sampler, 0.0f32, 0);
|
||||
let r2: glam::Vec4 = image3d.gather(*sampler, v3, 0);
|
||||
*output = r1 + r2;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
error[E0277]: the trait bound `Image<f32, 0_u32, 2_u32, 0_u32, 0_u32, 1_u32, 0_u32>: HasGather` is not satisfied
|
||||
--> $DIR/gather_err.rs:15:34
|
||||
|
|
||||
15 | let r1: glam::Vec4 = image1d.gather(*sampler, 0.0, 0);
|
||||
15 | let r1: glam::Vec4 = image1d.gather(*sampler, 0.0f32, 0);
|
||||
| ^^^^^^ the trait `HasGather` is not implemented for `Image<f32, 0_u32, 2_u32, 0_u32, 0_u32, 1_u32, 0_u32>`
|
||||
|
|
||||
= help: the following implementations were found:
|
||||
|
@ -2,7 +2,7 @@ error: `noreturn` requires a terminator at the end
|
||||
--> $DIR/block_tracking_fail.rs:10:9
|
||||
|
|
||||
10 | asm!("", options(noreturn));
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: trailing terminator Unreachable requires `options(noreturn)`
|
||||
--> $DIR/block_tracking_fail.rs:17:9
|
||||
@ -10,7 +10,7 @@ error: trailing terminator Unreachable requires `options(noreturn)`
|
||||
17 | / asm!(
|
||||
18 | | "OpUnreachable",
|
||||
19 | | );
|
||||
| |__________^
|
||||
| |_________^
|
||||
|
||||
error: expected OpLabel after terminator Kill
|
||||
--> $DIR/block_tracking_fail.rs:26:9
|
||||
@ -20,7 +20,7 @@ error: expected OpLabel after terminator Kill
|
||||
28 | | "%sum = OpFAdd _ {x} {x}",
|
||||
29 | | x = in(reg) x,
|
||||
30 | | );
|
||||
| |__________^
|
||||
| |_________^
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user