Skip to content

Commit

Permalink
Fix new clippy warnings from the newer nightly.
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyb committed Oct 26, 2022
1 parent fdc7552 commit 16863f3
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions crates/rustc_codegen_spirv/src/builder/libm_intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ impl Builder<'_, '_> {
LibmIntrinsic::Custom(LibmCustomIntrinsic::SinCos) => {
assert_eq!(args.len(), 1);
let x = args[0];
let sin = self.gl_op(GLOp::Sin, x.ty, &[x]).def(self);
let cos = self.gl_op(GLOp::Cos, x.ty, &[x]).def(self);
let sin = self.gl_op(GLOp::Sin, x.ty, [x]).def(self);
let cos = self.gl_op(GLOp::Cos, x.ty, [x]).def(self);
self.emit()
.composite_construct(result_type, None, [sin, cos].iter().copied())
.unwrap()
Expand All @@ -228,7 +228,7 @@ impl Builder<'_, '_> {
self.gl_op(
GLOp::Pow,
result_type,
&[args[0], self.constant_float(args[0].ty, 1.0 / 3.0)],
[args[0], self.constant_float(args[0].ty, 1.0 / 3.0)],
)
}
LibmIntrinsic::Custom(LibmCustomIntrinsic::Log10) => {
Expand All @@ -242,7 +242,7 @@ impl Builder<'_, '_> {
assert_eq!(args.len(), 1);
let one = self.constant_float(args[0].ty, 1.0);
let add = self.add(args[0], one);
self.gl_op(GLOp::Log, result_type, &[add])
self.gl_op(GLOp::Log, result_type, [add])
}
LibmIntrinsic::Custom(LibmCustomIntrinsic::Exp10) => {
assert_eq!(args.len(), 1);
Expand All @@ -252,7 +252,7 @@ impl Builder<'_, '_> {
self.gl_op(GLOp::Exp, result_type, [mul])
}
LibmIntrinsic::Custom(LibmCustomIntrinsic::Expm1) => {
let exp = self.gl_op(GLOp::Exp, args[0].ty, &[args[0]]);
let exp = self.gl_op(GLOp::Exp, args[0].ty, [args[0]]);
let one = self.constant_float(exp.ty, 1.0);
self.sub(exp, one)
}
Expand Down
2 changes: 1 addition & 1 deletion crates/rustc_codegen_spirv/src/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ fn do_link(
) -> linker::LinkResult {
fn load(bytes: &[u8]) -> rspirv::dr::Module {
let mut loader = rspirv::dr::Loader::new();
rspirv::binary::parse_bytes(&bytes, &mut loader).unwrap();
rspirv::binary::parse_bytes(bytes, &mut loader).unwrap();
loader.module()
}

Expand Down
2 changes: 1 addition & 1 deletion crates/rustc_codegen_spirv/src/linker/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ fn validate(spirv: &[u32]) {

fn load(bytes: &[u8]) -> Module {
let mut loader = Loader::new();
rspirv::binary::parse_bytes(&bytes, &mut loader).unwrap();
rspirv::binary::parse_bytes(bytes, &mut loader).unwrap();
loader.module()
}

Expand Down
4 changes: 2 additions & 2 deletions crates/spirv-builder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ impl SpirvBuilder {
&self,
at: &Path,
) -> Result<CompileResult, SpirvBuilderError> {
let metadata_contents = File::open(&at).map_err(SpirvBuilderError::MetadataFileMissing)?;
let metadata_contents = File::open(at).map_err(SpirvBuilderError::MetadataFileMissing)?;
let metadata: CompileResult = serde_json::from_reader(BufReader::new(metadata_contents))
.map_err(SpirvBuilderError::MetadataFileMalformed)?;
match &metadata.module {
Expand Down Expand Up @@ -476,7 +476,7 @@ fn invoke_rustc(builder: &SpirvBuilder) -> Result<PathBuf, SpirvBuilderError> {
}

let mut cargo = Command::new("cargo");
cargo.args(&[
cargo.args([
"build",
"--lib",
"--message-format=json-render-diagnostics",
Expand Down
2 changes: 1 addition & 1 deletion tests/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ fn build_deps(deps_target_dir: &Path, codegen_backend_path: &Path, target: &str)

// Build compiletests-deps-helper
std::process::Command::new("cargo")
.args(&[
.args([
"build",
"-p",
"compiletests-deps-helper",
Expand Down

0 comments on commit 16863f3

Please sign in to comment.