Skip to content

Commit df2aeff

Browse files
committed
Macro source_location_current! returns full qualified None
1 parent 98cbfd2 commit df2aeff

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

spdlog/src/source_location.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,16 @@ macro_rules! __private_source_location_current_inner {
138138
#[cfg(not(feature = "source-location"))]
139139
macro_rules! __private_source_location_current_inner {
140140
() => {
141-
None
141+
Option::<$crate::SourceLocation>::None
142142
};
143143
}
144+
145+
#[cfg(test)]
146+
mod tests {
147+
#[test]
148+
fn option_type_inference() {
149+
// When feature `source-location` is disabled, the macro must return a full
150+
// qualified `None`, otherwise the compiler cannot infer the `Option` type.
151+
_ = source_location_current!();
152+
}
153+
}

0 commit comments

Comments
 (0)