Skip to content

Commit

Permalink
Macro source_location_current! returns full qualified None
Browse files Browse the repository at this point in the history
  • Loading branch information
SpriteOvO committed Feb 20, 2025
1 parent 98cbfd2 commit df2aeff
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion spdlog/src/source_location.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,16 @@ macro_rules! __private_source_location_current_inner {
#[cfg(not(feature = "source-location"))]
macro_rules! __private_source_location_current_inner {
() => {
None
Option::<$crate::SourceLocation>::None
};
}

#[cfg(test)]
mod tests {
#[test]
fn option_type_inference() {
// When feature `source-location` is disabled, the macro must return a full
// qualified `None`, otherwise the compiler cannot infer the `Option` type.
_ = source_location_current!();
}
}

0 comments on commit df2aeff

Please sign in to comment.