Skip to content

Commit 614e793

Browse files
Add comment on macro hygenics bug
Co-authored-by: Jubilee <[email protected]>
1 parent ae03f89 commit 614e793

File tree

1 file changed

+3
-1
lines changed
  • library/std/src/sys/pal/windows

1 file changed

+3
-1
lines changed

library/std/src/sys/pal/windows/api.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ macro_rules! wide_str {
4848

4949
/// Creates a UTF-16 string from a str without null termination.
5050
macro_rules! utf16 {
51-
// Note: this macro uses triple underscores to avoid const cycles
51+
// Note: this macro uses triple underscores to avoid const cycles which,
52+
// despite macro hygienics, occur if we use a const with the same name
53+
// as an argument to the macro, see issue rust-lang/rust#123691
5254
($str:expr) => {{
5355
const ___UTF8: &str = $str;
5456
const ___UTF16_LEN: usize = crate::sys::pal::windows::api::utf16_len(___UTF8);

0 commit comments

Comments
 (0)