Clippy improvements (#408)
* clippy: Allow subsec_nanos usage for now. The recommendation from clippy requires Rust 1.27, but we currently support Rust 1.25 and later. * Simplify ref pattern matches. This was recommended by clippy.
This commit is contained in:
committed by
Dan Gohman
parent
c0af810ec0
commit
76a7efc8db
@@ -5,6 +5,8 @@
|
|||||||
#![cfg_attr(feature = "std", warn(unstable_features))]
|
#![cfg_attr(feature = "std", warn(unstable_features))]
|
||||||
#![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))]
|
#![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))]
|
||||||
#![cfg_attr(feature="cargo-clippy", allow(
|
#![cfg_attr(feature="cargo-clippy", allow(
|
||||||
|
// This requires Rust 1.27 or later.
|
||||||
|
duration_subsec,
|
||||||
// Produces only a false positive:
|
// Produces only a false positive:
|
||||||
while_let_loop,
|
while_let_loop,
|
||||||
// Produces many false positives, but did produce some valid lints, now fixed:
|
// Produces many false positives, but did produce some valid lints, now fixed:
|
||||||
|
|||||||
@@ -362,15 +362,15 @@ impl<'a> RelocSink for FaerieRelocSink<'a> {
|
|||||||
name: &ir::ExternalName,
|
name: &ir::ExternalName,
|
||||||
addend: Addend,
|
addend: Addend,
|
||||||
) {
|
) {
|
||||||
let ref_name: String = match name {
|
let ref_name: String = match *name {
|
||||||
&ir::ExternalName::User { .. } => {
|
ir::ExternalName::User { .. } => {
|
||||||
if self.namespace.is_function(name) {
|
if self.namespace.is_function(name) {
|
||||||
self.namespace.get_function_decl(name).name.clone()
|
self.namespace.get_function_decl(name).name.clone()
|
||||||
} else {
|
} else {
|
||||||
self.namespace.get_data_decl(name).name.clone()
|
self.namespace.get_data_decl(name).name.clone()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&ir::ExternalName::LibCall(ref libcall) => {
|
ir::ExternalName::LibCall(ref libcall) => {
|
||||||
let sym = (self.libcall_names)(*libcall);
|
let sym = (self.libcall_names)(*libcall);
|
||||||
self.artifact
|
self.artifact
|
||||||
.declare(sym.clone(), faerie::Decl::FunctionImport)
|
.declare(sym.clone(), faerie::Decl::FunctionImport)
|
||||||
|
|||||||
@@ -5,7 +5,11 @@
|
|||||||
|
|
||||||
#![deny(missing_docs, trivial_numeric_casts, unused_extern_crates)]
|
#![deny(missing_docs, trivial_numeric_casts, unused_extern_crates)]
|
||||||
#![warn(unused_import_braces, unstable_features)]
|
#![warn(unused_import_braces, unstable_features)]
|
||||||
#![cfg_attr(feature = "cargo-clippy", allow(type_complexity))]
|
#![cfg_attr(feature = "cargo-clippy",
|
||||||
|
allow(
|
||||||
|
type_complexity,
|
||||||
|
// This requires Rust 1.27 or later.
|
||||||
|
duration_subsec))]
|
||||||
#![cfg_attr(
|
#![cfg_attr(
|
||||||
feature = "cargo-clippy",
|
feature = "cargo-clippy",
|
||||||
warn(
|
warn(
|
||||||
|
|||||||
Reference in New Issue
Block a user