-
Notifications
You must be signed in to change notification settings - Fork 277
Fix up some possible lifetime issues in newer editions #707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -126,7 +126,7 @@ macro_rules! __log { | |
| $crate::__private_api::format_args!($($arg)+), | ||
| lvl, | ||
| &($target, $crate::__private_api::module_path!(), $crate::__private_api::loc()), | ||
| &[$(($crate::__log_key!($key), $crate::__log_value!($key $(:$capture)* = $($value)*))),+] as &[_], | ||
| &[$(($crate::__log_key!($key), $crate::__log_value!($key $(:$capture)* = $($value)*))),+], | ||
| ); | ||
| } | ||
| }); | ||
|
|
@@ -431,9 +431,7 @@ macro_rules! __log_logger { | |
| $crate::__private_api::GlobalLogger | ||
| }}; | ||
|
|
||
| ($logger:expr) => {{ | ||
| &($logger) | ||
| }}; | ||
| ($logger:expr) => {&($logger)}; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The code block shouldn't matter right? (fine with the code change though) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You'd think not, but this is one of the edition-based lifetime changes. In the 2024 edition, this borrow is for a lifetime that doesn't outlive the block. |
||
| } | ||
|
|
||
| // These macros use a pattern of #[cfg]s to produce nicer error | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with the change. I do wonder if this changes the binary size as now create code per
N/size, but I don't know if this will impact anything.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't actually trigger the same build failure reported in #706 yet, so this one is purely speculative right now.
The change in code size is a good point, I'll measure it and see what impact it has. I wouldn't be surprised if it made no difference, but is definitely worth checking.