Skip to content

Commit

Permalink
fix: support raw prefix identifiers in statics
Browse files Browse the repository at this point in the history
  • Loading branch information
calebcartwright committed Oct 5, 2019
1 parent 383306e commit ed697c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1722,7 +1722,7 @@ fn rewrite_static(
static_parts.defaultness.map_or("", format_defaultness),
static_parts.prefix,
format_mutability(static_parts.mutability),
static_parts.ident,
rewrite_ident(context, static_parts.ident),
colon,
);
// 2 = " =".len()
Expand Down
3 changes: 3 additions & 0 deletions tests/target/raw_identifiers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

use r#foo as r#alias_foo;

// https://github.com/rust-lang/rustfmt/issues/3837
pub(crate) static r#break: &'static str = "foo";

fn main() {
#[r#attr]
r#foo::r#bar();
Expand Down

0 comments on commit ed697c9

Please sign in to comment.