Skip to content

normalize use of backticks in compiler messages for libsyntax_ext #62702

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/libsyntax_ext/deriving/clone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pub fn expand_deriving_clone(cx: &mut ExtCtxt<'_>,
}
}

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

let inline = cx.meta_word(span, sym::inline);
Expand Down
6 changes: 3 additions & 3 deletions src/libsyntax_ext/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ pub fn expand_test_or_bench(
if let Annotatable::Item(i) = item { i }
else {
cx.parse_sess.span_diagnostic.span_fatal(item.span(),
"#[test] attribute is only allowed on non associated functions").raise();
"`#[test]` attribute is only allowed on non associated functions").raise();
};

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

Expand Down Expand Up @@ -167,7 +167,7 @@ pub fn expand_test_or_bench(
ast::ItemKind::ExternCrate(Some(sym::test))
);

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

vec![
// Access to libtest under a gensymed name
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/test-attr-non-associated-functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ struct A {}

impl A {
#[test]
fn new() -> A { //~ ERROR #[test] attribute is only allowed on non associated functions
fn new() -> A { //~ ERROR `#[test]` attribute is only allowed on non associated functions
A {}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/test-attr-non-associated-functions.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error: #[test] attribute is only allowed on non associated functions
error: `#[test]` attribute is only allowed on non associated functions
--> $DIR/test-attr-non-associated-functions.rs:9:5
|
LL | / fn new() -> A {
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/test-on-macro.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
warning: #[test] attribute should not be used on macros. Use #[cfg(test)] instead.
warning: `#[test]` attribute should not be used on macros. Use `#[cfg(test)]` instead.
--> $DIR/test-on-macro.rs:11:1
|
LL | foo!();
Expand Down