Skip to content

Commit 693fc37

Browse files
committed
Fix issue #364 - Broken # operator in macros
Caused by inability to access private field, so was not caught by unit tests as those are in the same crate.
1 parent 66f082b commit 693fc37

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77
## [Unreleased]
88

99
### Fixes
10+
* Fix use of `#` operator in macros due to private field (issue #364)
11+
* Thanks to @Manishearth for identifying this.
1012
* ci: Check the tests pass with `-Zminimal-versions`
1113

1214
## 2.8.1 - 2025-10-05

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3541,7 +3541,7 @@ where
35413541
/// be used directly.
35423542
#[cfg(has_std_error)]
35433543
#[doc(hidden)]
3544-
pub struct ErrorTagWrapper<E>(E);
3544+
pub struct ErrorTagWrapper<E>(pub E);
35453545

35463546
#[cfg(has_std_error)]
35473547
#[test]

tests/issue364.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#![cfg(feature = "std")]
2+
use slog::Logger;
3+
use std::io::{Error, ErrorKind};
4+
5+
#[test]
6+
fn ok() {
7+
repro(slog::Logger::root(slog::Discard, slog::o!()))
8+
}
9+
10+
fn repro(log: Logger) {
11+
let err = Error::new(ErrorKind::Other, "some error");
12+
slog::info!(log, "oops"; "err" => #err);
13+
}

0 commit comments

Comments
 (0)