Skip to content

Commit 526285c

Browse files
committed
Fix clippy warnings
1 parent 1ef84a0 commit 526285c

File tree

6 files changed

+151
-12
lines changed

6 files changed

+151
-12
lines changed

Cargo.lock

Lines changed: 142 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ gccjit = "2.4"
2929
#gccjit = { path = "../gccjit.rs" }
3030

3131
[dev-dependencies]
32-
lang_tester = "0.8.0"
3332
boml = "0.3.1"
33+
lang_tester = "0.8.0"
34+
tempfile = "3.7.1"
3435

3536
[profile.dev]
3637
# By compiling dependencies with optimizations, performing tests gets much faster.

src/back/lto.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ use crate::back::write::save_temp_bitcode;
4141
use crate::errors::{DynamicLinkingWithLTO, LtoBitcodeFromRlib, LtoDisallowed, LtoDylib};
4242
use crate::{GccCodegenBackend, GccContext, SyncContext, to_gcc_opt_level};
4343

44-
/// We keep track of the computed LTO cache keys from the previous
45-
/// session to determine which CGUs we can reuse.
46-
//pub const THIN_LTO_KEYS_INCR_COMP_FILE_NAME: &str = "thin-lto-past-keys.bin";
47-
4844
pub fn crate_type_allows_lto(crate_type: CrateType) -> bool {
4945
match crate_type {
5046
CrateType::Executable | CrateType::Dylib | CrateType::Staticlib | CrateType::Cdylib => true,

src/gcc_util.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@ pub(crate) fn global_gcc_features(sess: &Session, diagnostics: bool) -> Vec<Stri
9494
};
9595
sess.dcx().emit_warn(unknown_feature);
9696
}
97-
Some((_, Stability::Stable, _)) => {}
98-
Some((_, Stability::Unstable(_), _)) => {
97+
Some(&(_, Stability::Stable, _)) => {}
98+
Some(&(_, Stability::Unstable(_), _)) => {
9999
// An unstable feature. Warn about using it.
100100
sess.dcx().emit_warn(UnstableCTargetFeature { feature });
101101
}
102-
Some((_, Stability::Forbidden { .. }, _)) => {
102+
Some(&(_, Stability::Forbidden { .. }, _)) => {
103103
sess.dcx().emit_err(ForbiddenCTargetFeature { feature });
104104
}
105105
}

src/intrinsic/simd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
379379
// Make sure this is actually a SIMD vector.
380380
let idx_ty = args[2].layout.ty;
381381
let n: u64 = if idx_ty.is_simd()
382-
&& matches!(idx_ty.simd_size_and_type(bx.cx.tcx).1.kind(), ty::Uint(ty::UintTy::U32))
382+
&& matches!(*idx_ty.simd_size_and_type(bx.cx.tcx).1.kind(), ty::Uint(ty::UintTy::U32))
383383
{
384384
idx_ty.simd_size_and_type(bx.cx.tcx).0
385385
} else {

src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
// Some "regular" crates we want to share with rustc
2828
extern crate object;
2929
extern crate smallvec;
30+
// FIXME: clippy bug: remove the #[allow] when it's fixed.
31+
#[allow(unused_extern_crates)]
3032
extern crate tempfile;
3133
#[macro_use]
3234
extern crate tracing;
@@ -485,7 +487,7 @@ pub fn target_features(
485487
sess.target
486488
.rust_target_features()
487489
.iter()
488-
.filter(|(_, gate, _)| gate.is_supported())
490+
.filter(|&&(_, gate, _)| gate.is_supported())
489491
.filter_map(|&(feature, gate, _)| {
490492
if sess.is_nightly_build() || allow_unstable || gate.is_stable() {
491493
Some(feature)

0 commit comments

Comments
 (0)