Skip to content

Commit

Permalink
Silence over-opinionated clippy::{complexity,style} lints in emitte…
Browse files Browse the repository at this point in the history
…d code
  • Loading branch information
danielhenrymantilla committed Aug 11, 2024
1 parent e0cd5ad commit fe1c5e8
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fix-hidden-lifetime-bug"
version = "0.2.6"
version = "0.2.7"
authors = [
"Daniel Henry-Mantilla <daniel.henry.mantilla@gmail.com>",
]
Expand All @@ -14,7 +14,7 @@ keywords = ["impl", "lifetime", "bug", "hidden", "bound"]

[dependencies.proc-macros]
package = "fix-hidden-lifetime-bug-proc_macros"
version = "=0.2.6"
version = "=0.2.7"
path = "src/proc_macros"
optional = true

Expand Down
2 changes: 1 addition & 1 deletion src/proc_macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ proc-macro = true

[package]
name = "fix-hidden-lifetime-bug-proc_macros"
version = "0.2.6"
version = "0.2.7"
authors = [
"Daniel Henry-Mantilla <daniel.henry.mantilla@gmail.com>",
]
Expand Down
7 changes: 5 additions & 2 deletions src/proc_macros/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![allow(nonstandard_style, unused_imports)]
#![allow(nonstandard_style, unused_imports, clippy::complexity, clippy::style)]

//! Internal crate, do not use it directly.
Expand Down Expand Up @@ -100,6 +100,9 @@ fn fix_fn (
lifetimes,
&mut fun.sig.output,
);
fun.attrs.push(parse_quote!(
#[allow(clippy::style, clippy::pedantic, clippy::complexity)]
));
Ok(fun)
}

Expand All @@ -114,7 +117,7 @@ fn fix_impl (
"`#[fix_hidden_lifetime_bug]` does not support traits yet.",
));
}
let items = mem::replace(&mut impl_.items, vec![]);
let items = mem::take(&mut impl_.items);
impl_.items = items.into_iter().map(|it| Ok(match it {
| ImplItem::Method(mut fun) => {
let mut process_current = false;
Expand Down
2 changes: 1 addition & 1 deletion tests/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fn baz<'a, 'b> (it: &'a mut &'b ()) -> impl 'a + Send {
if false {
// Make sure we didn't accidentally lose the `: 'a`-ness.
let _: Box<dyn Send + 'a> = Box::new(baz(it));
loop {}
unreachable!();
}
it
}
Expand Down

0 comments on commit fe1c5e8

Please sign in to comment.