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

Update to nightly-2022-10-29 #958

Merged
merged 6 commits into from
Dec 2, 2022
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed 🛠️

- Updated toolchain to `nightly-2022-10-15`
- Updated toolchain to `nightly-2022-10-29`
- Applied workspace inheritance to Cargo.toml files

### Removed 🔥
Expand Down
4 changes: 2 additions & 2 deletions crates/rustc_codegen_spirv/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ use std::process::{Command, ExitCode};
/// `cargo publish`. We need to figure out a way to do this properly, but let's hardcode it for now :/
//const REQUIRED_RUST_TOOLCHAIN: &str = include_str!("../../rust-toolchain");
const REQUIRED_RUST_TOOLCHAIN: &str = r#"[toolchain]
channel = "nightly-2022-10-15"
channel = "nightly-2022-10-29"
components = ["rust-src", "rustc-dev", "llvm-tools-preview"]
# commit_hash = bf15a9e5263fcea065a7ae9c179b2d24c2deb670"#;
# commit_hash = 9565dfeb4e6225177bbe78f18cd48a7982f34401"#;

fn get_rustc_commit_hash() -> Result<String, Box<dyn Error>> {
let rustc = std::env::var("RUSTC").unwrap_or_else(|_| String::from("rustc"));
Expand Down
4 changes: 2 additions & 2 deletions crates/rustc_codegen_spirv/src/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ fn dig_scalar_pointee<'tcx>(
let new_pointee = dig_scalar_pointee(cx, field, offset - field_offset);
match pointee {
Some(old_pointee) if old_pointee != new_pointee => {
cx.tcx.sess.fatal(&format!(
cx.tcx.sess.fatal(format!(
"dig_scalar_pointee: unsupported Pointer with different \
pointee types ({:?} vs {:?}) at offset {:?} in {:#?}",
old_pointee, new_pointee, offset, layout
Expand Down Expand Up @@ -860,7 +860,7 @@ fn trans_intrinsic_type<'tcx>(
None => Err(cx
.tcx
.sess
.err(&format!("Invalid value for Image const generic: {}", value))),
.err(format!("Invalid value for Image const generic: {}", value))),
}
}

Expand Down
10 changes: 5 additions & 5 deletions crates/rustc_codegen_spirv/src/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ impl AggregatedSpirvAttributes {
let (span, parsed_attr) = match parse_attr_result {
Ok(span_and_parsed_attr) => span_and_parsed_attr,
Err((span, msg)) => {
cx.tcx.sess.delay_span_bug(span, &msg);
cx.tcx.sess.delay_span_bug(span, msg);
continue;
}
};
Expand All @@ -158,7 +158,7 @@ impl AggregatedSpirvAttributes {
}) => {
cx.tcx
.sess
.delay_span_bug(span, &format!("multiple {} attributes", category));
.delay_span_bug(span, format!("multiple {} attributes", category));
}
}
}
Expand Down Expand Up @@ -264,7 +264,7 @@ impl CheckSpirvAttrVisitor<'_> {
let (span, parsed_attr) = match parse_attr_result {
Ok(span_and_parsed_attr) => span_and_parsed_attr,
Err((span, msg)) => {
self.tcx.sess.span_err(span, &msg);
self.tcx.sess.span_err(span, msg);
continue;
}
};
Expand Down Expand Up @@ -333,7 +333,7 @@ impl CheckSpirvAttrVisitor<'_> {
if let Err(msg) = valid {
self.tcx.sess.span_err(
span,
&format!("`{:?}` storage class {}", storage_class, msg),
format!("`{:?}` storage class {}", storage_class, msg),
);
}
}
Expand All @@ -354,7 +354,7 @@ impl CheckSpirvAttrVisitor<'_> {
Err(Expected(expected_target)) => {
self.tcx.sess.span_err(
span,
&format!(
format!(
"attribute is only valid on a {}, not on a {}",
expected_target, target
),
Expand Down
21 changes: 9 additions & 12 deletions crates/rustc_codegen_spirv/src/builder/spirv_asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ impl<'a, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'tcx> {
if let Some(modifier) = modifier {
self.tcx.sess.span_err(
span,
&format!("asm modifiers are not supported: {}", modifier),
format!("asm modifiers are not supported: {}", modifier),
);
}
let line = tokens.last_mut().unwrap();
Expand Down Expand Up @@ -577,7 +577,7 @@ impl<'cx, 'tcx> Builder<'cx, 'tcx> {
));
}
if tokens.next().is_some() {
self.tcx.sess.err(&format!(
self.tcx.sess.err(format!(
"too many operands to instruction: {}",
instruction.class.opname
));
Expand Down Expand Up @@ -792,7 +792,7 @@ impl<'cx, 'tcx> Builder<'cx, 'tcx> {
_ => {
self.tcx
.sess
.span_err(span, &format!("invalid register: {}", reg));
.span_err(span, format!("invalid register: {}", reg));
}
}
}
Expand Down Expand Up @@ -916,7 +916,7 @@ impl<'cx, 'tcx> Builder<'cx, 'tcx> {
other => {
self.tcx.sess.span_err(
span,
&format!(
format!(
"cannot use typeof* on non-pointer type: {}",
other.debug(ty, self)
),
Expand All @@ -938,7 +938,7 @@ impl<'cx, 'tcx> Builder<'cx, 'tcx> {
other => {
self.tcx.sess.span_err(
span,
&format!(
format!(
"out register type not pointer: {}",
other.debug(place.llval.ty, self)
),
Expand Down Expand Up @@ -1159,16 +1159,13 @@ impl<'cx, 'tcx> Builder<'cx, 'tcx> {
Some(Token::Placeholder(_, span)) => {
self.tcx.sess.span_err(
span,
&format!(
"expected a literal, not a dynamic value for a {:?}",
kind
),
format!("expected a literal, not a dynamic value for a {:?}", kind),
);
}
Some(Token::Typeof(_, span, _)) => {
self.tcx.sess.span_err(
span,
&format!("expected a literal, not a type for a {:?}", kind),
format!("expected a literal, not a type for a {:?}", kind),
);
}
None => {
Expand Down Expand Up @@ -1373,13 +1370,13 @@ impl<'cx, 'tcx> Builder<'cx, 'tcx> {
Token::Placeholder(_, span) => {
self.tcx.sess.span_err(
span,
&format!("expected a literal, not a dynamic value for a {:?}", kind),
format!("expected a literal, not a dynamic value for a {:?}", kind),
);
}
Token::Typeof(_, span, _) => {
self.tcx.sess.span_err(
span,
&format!("expected a literal, not a type for a {:?}", kind),
format!("expected a literal, not a type for a {:?}", kind),
);
}
},
Expand Down
18 changes: 9 additions & 9 deletions crates/rustc_codegen_spirv/src/codegen_cx/constant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ impl<'tcx> CodegenCx<'tcx> {
_ => self
.tcx
.sess
.fatal(&format!("Invalid constant value for bool: {}", val)),
.fatal(format!("Invalid constant value for bool: {}", val)),
},
SpirvType::Integer(128, _) => {
let result = self.undef(ty);
self.zombie_no_span(result.def_cx(self), "u128 constant");
result
}
other => self.tcx.sess.fatal(&format!(
other => self.tcx.sess.fatal(format!(
"constant_int invalid on type {}",
other.debug(ty, self)
)),
Expand All @@ -94,7 +94,7 @@ impl<'tcx> CodegenCx<'tcx> {
match self.lookup_type(ty) {
SpirvType::Float(32) => self.def_constant(ty, SpirvConst::F32((val as f32).to_bits())),
SpirvType::Float(64) => self.def_constant(ty, SpirvConst::F64(val.to_bits())),
other => self.tcx.sess.fatal(&format!(
other => self.tcx.sess.fatal(format!(
"constant_float invalid on type {}",
other.debug(ty, self)
)),
Expand Down Expand Up @@ -233,9 +233,9 @@ impl<'tcx> ConstMethods<'tcx> for CodegenCx<'tcx> {
_ => self
.tcx
.sess
.fatal(&format!("Invalid constant value for bool: {}", data)),
.fatal(format!("Invalid constant value for bool: {}", data)),
},
other => self.tcx.sess.fatal(&format!(
other => self.tcx.sess.fatal(format!(
"scalar_to_backend Primitive::Int not supported on type {}",
other.debug(ty, self)
)),
Expand Down Expand Up @@ -273,7 +273,7 @@ impl<'tcx> ConstMethods<'tcx> for CodegenCx<'tcx> {
GlobalAlloc::Memory(alloc) => {
let pointee = match self.lookup_type(ty) {
SpirvType::Pointer { pointee } => pointee,
other => self.tcx.sess.fatal(&format!(
other => self.tcx.sess.fatal(format!(
"GlobalAlloc::Memory type not implemented: {}",
other.debug(ty, self)
)),
Expand All @@ -293,7 +293,7 @@ impl<'tcx> ConstMethods<'tcx> for CodegenCx<'tcx> {
.unwrap_memory();
let pointee = match self.lookup_type(ty) {
SpirvType::Pointer { pointee } => pointee,
other => self.tcx.sess.fatal(&format!(
other => self.tcx.sess.fatal(format!(
"GlobalAlloc::VTable type not implemented: {}",
other.debug(ty, self)
)),
Expand Down Expand Up @@ -426,7 +426,7 @@ impl<'tcx> CodegenCx<'tcx> {
other => {
self.tcx
.sess
.fatal(&format!("invalid size for integer: {}", other));
.fatal(format!("invalid size for integer: {}", other));
}
};
Primitive::Int(integer, int_signedness)
Expand All @@ -437,7 +437,7 @@ impl<'tcx> CodegenCx<'tcx> {
other => {
self.tcx
.sess
.fatal(&format!("invalid size for float: {}", other));
.fatal(format!("invalid size for float: {}", other));
}
},
SpirvType::Pointer { .. } => Primitive::Pointer,
Expand Down
8 changes: 4 additions & 4 deletions crates/rustc_codegen_spirv/src/codegen_cx/declare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ impl<'tcx> CodegenCx<'tcx> {
self.libm_intrinsics.borrow_mut().insert(fn_id, intrinsic);
}
None => {
self.tcx.sess.err(&format!(
self.tcx.sess.err(format!(
"missing libm intrinsic {}, which is {}",
symbol_name, instance
));
Expand Down Expand Up @@ -214,7 +214,7 @@ impl<'tcx> PreDefineMethods<'tcx> for CodegenCx<'tcx> {
Linkage::External => Some(LinkageType::Export),
Linkage::Internal => None,
other => {
self.tcx.sess.err(&format!(
self.tcx.sess.err(format!(
"TODO: Linkage type {:?} not supported yet for static var symbol {}",
other, symbol_name
));
Expand Down Expand Up @@ -244,7 +244,7 @@ impl<'tcx> PreDefineMethods<'tcx> for CodegenCx<'tcx> {
Linkage::External | Linkage::WeakAny => Some(LinkageType::Export),
Linkage::Internal => None,
other => {
self.tcx.sess.err(&format!(
self.tcx.sess.err(format!(
"TODO: Linkage type {:?} not supported yet for function symbol {}",
other, symbol_name
));
Expand Down Expand Up @@ -277,7 +277,7 @@ impl<'tcx> StaticMethods for CodegenCx<'tcx> {
};
let value_ty = match self.lookup_type(g.ty) {
SpirvType::Pointer { pointee } => pointee,
other => self.tcx.sess.fatal(&format!(
other => self.tcx.sess.fatal(format!(
"global had non-pointer type {}",
other.debug(g.ty, self)
)),
Expand Down
16 changes: 8 additions & 8 deletions crates/rustc_codegen_spirv/src/codegen_cx/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl<'tcx> CodegenCx<'tcx> {
} else {
self.tcx
.sess
.span_err(span, &format!("Cannot declare {} as an entry point", name));
.span_err(span, format!("Cannot declare {} as an entry point", name));
return;
};
let body = self
Expand All @@ -57,7 +57,7 @@ impl<'tcx> CodegenCx<'tcx> {
if !matches!(arg_abi.layout.ty.kind(), ty::Ref(..)) {
self.tcx.sess.span_err(
hir_param.ty_span,
&format!(
format!(
"entry point parameter type not yet supported \
(`{}` has `ScalarPair` ABI but is not a `&T`)",
arg_abi.layout.ty
Expand All @@ -69,7 +69,7 @@ impl<'tcx> CodegenCx<'tcx> {
// is any validation concern, it should be done on the types.
PassMode::Ignore => self.tcx.sess.span_fatal(
hir_param.ty_span,
&format!(
format!(
"entry point parameter type not yet supported \
(`{}` has size `0`)",
arg_abi.layout.ty
Expand All @@ -87,7 +87,7 @@ impl<'tcx> CodegenCx<'tcx> {
} else {
self.tcx.sess.span_err(
span,
&format!(
format!(
"entry point should return `()`, not `{}`",
fn_abi.ret.layout.ty
),
Expand Down Expand Up @@ -206,7 +206,7 @@ impl<'tcx> CodegenCx<'tcx> {
} else {
self.tcx.sess.span_err(
hir_param.ty_span,
&format!(
format!(
"entry parameter type must be by-reference: `&{}`",
layout.ty,
),
Expand All @@ -232,7 +232,7 @@ impl<'tcx> CodegenCx<'tcx> {
if !is_ref {
self.tcx.sess.span_fatal(
hir_param.ty_span,
&format!(
format!(
"invalid entry param type `{}` for storage class `{:?}` \
(expected `&{}T`)",
layout.ty,
Expand Down Expand Up @@ -281,7 +281,7 @@ impl<'tcx> CodegenCx<'tcx> {
(true, hir::Mutability::Mut) => StorageClass::Output,
(true, hir::Mutability::Not) => self.tcx.sess.span_fatal(
hir_param.ty_span,
&format!(
format!(
"invalid entry param type `{}` (expected `{}` or `&mut {1}`)",
layout.ty, value_ty
),
Expand Down Expand Up @@ -404,7 +404,7 @@ impl<'tcx> CodegenCx<'tcx> {
if is_unsized {
self.tcx.sess.span_fatal(
hir_param.ty_span,
&format!(
format!(
"unsized types are not supported for storage class {:?}",
storage_class
),
Expand Down
4 changes: 2 additions & 2 deletions crates/rustc_codegen_spirv/src/codegen_cx/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ impl<'tcx> CodegenCx<'tcx> {
.map(|s| s.parse())
.collect::<Result<_, String>>()
.unwrap_or_else(|error| {
tcx.sess.err(&error);
tcx.sess.err(error);
Vec::new()
});

Expand Down Expand Up @@ -247,7 +247,7 @@ impl CodegenArgs {
pub fn from_session(sess: &Session) -> Self {
match CodegenArgs::parse(&sess.opts.cg.llvm_args) {
Ok(ok) => ok,
Err(err) => sess.fatal(&format!("Unable to parse llvm-args: {}", err)),
Err(err) => sess.fatal(format!("Unable to parse llvm-args: {}", err)),
}
}

Expand Down
Loading