Skip to content

Commit 61f972b

Browse files
authored
Merge pull request rust-lang#3838 from calebcartwright/static-raw-ident-prefix
add static support for raw prefix identifiers
2 parents 383306e + ed697c9 commit 61f972b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/items.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1722,7 +1722,7 @@ fn rewrite_static(
17221722
static_parts.defaultness.map_or("", format_defaultness),
17231723
static_parts.prefix,
17241724
format_mutability(static_parts.mutability),
1725-
static_parts.ident,
1725+
rewrite_ident(context, static_parts.ident),
17261726
colon,
17271727
);
17281728
// 2 = " =".len()

tests/target/raw_identifiers.rs

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
use r#foo as r#alias_foo;
88

9+
// https://github.com/rust-lang/rustfmt/issues/3837
10+
pub(crate) static r#break: &'static str = "foo";
11+
912
fn main() {
1013
#[r#attr]
1114
r#foo::r#bar();

0 commit comments

Comments
 (0)