aboutsummaryrefslogtreecommitdiff
path: root/src/expand.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/expand.rs')
-rw-r--r--src/expand.rs15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/expand.rs b/src/expand.rs
index a4a463a..a7123e5 100644
--- a/src/expand.rs
+++ b/src/expand.rs
@@ -64,10 +64,13 @@ pub(crate) fn gen_function<'a, B: ToTokens + 'a>(
// unreachable, but does affect inference, so it needs to be written
// exactly that way for it to do its magic.
let fake_return_edge = quote_spanned! {return_span=>
- #[allow(unreachable_code, clippy::diverging_sub_expression, clippy::let_unit_value, clippy::unreachable)]
+ #[allow(
+ unknown_lints, unreachable_code, clippy::diverging_sub_expression,
+ clippy::let_unit_value, clippy::unreachable, clippy::let_with_type_underscore,
+ clippy::empty_loop
+ )]
if false {
- let __tracing_attr_fake_return: #return_type =
- unreachable!("this is just for type inference, and is unreachable code");
+ let __tracing_attr_fake_return: #return_type = loop {};
return __tracing_attr_fake_return;
}
};
@@ -179,7 +182,7 @@ fn gen_block<B: ToTokens>(
let quoted_fields: Vec<_> = param_names
.iter()
.filter(|(param, _)| {
- if args.skips.contains(param) {
+ if args.skip_all || args.skips.contains(param) {
return false;
}
@@ -340,7 +343,7 @@ fn gen_block<B: ToTokens>(
// regression in case the level is enabled.
let __tracing_attr_span;
let __tracing_attr_guard;
- if tracing::level_enabled!(#level) {
+ if tracing::level_enabled!(#level) || tracing::if_log_enabled!(#level, {true} else {false}) {
__tracing_attr_span = #span;
#follows_from
__tracing_attr_guard = __tracing_attr_span.enter();
@@ -561,7 +564,7 @@ impl<'block> AsyncInfo<'block> {
// last expression of the block: it determines the return value of the
// block, this is quite likely a `Box::pin` statement or an async block
let (last_expr_stmt, last_expr) = block.stmts.iter().rev().find_map(|stmt| {
- if let Stmt::Expr(expr, _) = stmt {
+ if let Stmt::Expr(expr, _semi) = stmt {
Some((stmt, expr))
} else {
None