Skip to content

Commit a36763a

Browse files
author
Samy Kacimi
committed
normalize use of backticks in compiler messages for libsyntax_ext
#60532
1 parent 4b65a86 commit a36763a

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

src/libsyntax_ext/deriving/clone.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ pub fn expand_deriving_clone(cx: &mut ExtCtxt<'_>,
7373
}
7474
}
7575

76-
_ => cx.span_bug(span, "#[derive(Clone)] on trait item or impl item"),
76+
_ => cx.span_bug(span, "`#[derive(Clone)]` on trait item or impl item"),
7777
}
7878

7979
let inline = cx.meta_word(span, sym::inline);

src/libsyntax_ext/test.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ pub fn expand_test_or_bench(
4242
if let Annotatable::Item(i) = item { i }
4343
else {
4444
cx.parse_sess.span_diagnostic.span_fatal(item.span(),
45-
"#[test] attribute is only allowed on non associated functions").raise();
45+
"`#[test]` attribute is only allowed on non associated functions").raise();
4646
};
4747

4848
if let ast::ItemKind::Mac(_) = item.node {
4949
cx.parse_sess.span_diagnostic.span_warn(item.span,
50-
"#[test] attribute should not be used on macros. Use #[cfg(test)] instead.");
50+
"`#[test]` attribute should not be used on macros. Use `#[cfg(test)]` instead.");
5151
return vec![Annotatable::Item(item)];
5252
}
5353

@@ -167,7 +167,7 @@ pub fn expand_test_or_bench(
167167
ast::ItemKind::ExternCrate(Some(sym::test))
168168
);
169169

170-
log::debug!("Synthetic test item:\n{}\n", pprust::item_to_string(&test_const));
170+
log::debug!("synthetic test item:\n{}\n", pprust::item_to_string(&test_const));
171171

172172
vec![
173173
// Access to libtest under a gensymed name

src/test/ui/test-attr-non-associated-functions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ struct A {}
66

77
impl A {
88
#[test]
9-
fn new() -> A { //~ ERROR #[test] attribute is only allowed on non associated functions
9+
fn new() -> A { //~ ERROR `#[test]` attribute is only allowed on non associated functions
1010
A {}
1111
}
1212
}

src/test/ui/test-attr-non-associated-functions.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: #[test] attribute is only allowed on non associated functions
1+
error: `#[test]` attribute is only allowed on non associated functions
22
--> $DIR/test-attr-non-associated-functions.rs:9:5
33
|
44
LL | / fn new() -> A {

src/test/ui/test-on-macro.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
warning: #[test] attribute should not be used on macros. Use #[cfg(test)] instead.
1+
warning: `#[test]` attribute should not be used on macros. Use `#[cfg(test)]` instead.
22
--> $DIR/test-on-macro.rs:11:1
33
|
44
LL | foo!();

0 commit comments

Comments
 (0)