Auto merge of #62908 - fakenine:normalize_use_of_backticks_compiler_messages_p17, r=alexreg

normalize use of backticks for compiler messages in remaining modules

https://github.com/rust-lang/rust/issues/60532
This commit is contained in:
bors 2019-07-24 10:03:20 +00:00
commit 27a6a304e2
27 changed files with 68 additions and 68 deletions

View File

@ -485,7 +485,7 @@ Erroneous code example:
fn foo() {}
#[main]
fn f() {} // error: multiple functions with a #[main] attribute
fn f() {} // error: multiple functions with a `#[main]` attribute
```
This error indicates that the compiler found multiple functions with the

View File

@ -874,7 +874,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
constraints.retain(|constraint| {
let (edge_changed, retain) = body(constraint);
if edge_changed {
debug!("Updated due to constraint {:?}", constraint);
debug!("updated due to constraint {:?}", constraint);
changed = true;
}
retain

View File

@ -78,10 +78,10 @@ impl<'tcx> RegionConstraintCollector<'tcx> {
}
return Err(if overly_polymorphic {
debug!("Overly polymorphic!");
debug!("overly polymorphic!");
TypeError::RegionsOverlyPolymorphic(placeholder.name, tainted_region)
} else {
debug!("Not as polymorphic!");
debug!("not as polymorphic!");
TypeError::RegionsInsufficientlyPolymorphic(placeholder.name, tainted_region)
});
}

View File

@ -120,9 +120,9 @@ fn find_item(item: &Item, ctxt: &mut EntryContext<'_, '_>, at_root: bool) {
ctxt.attr_main_fn = Some((item.hir_id, item.span));
} else {
struct_span_err!(ctxt.session, item.span, E0137,
"multiple functions with a #[main] attribute")
.span_label(item.span, "additional #[main] function")
.span_label(ctxt.attr_main_fn.unwrap().1, "first #[main] function")
"multiple functions with a `#[main]` attribute")
.span_label(item.span, "additional `#[main]` function")
.span_label(ctxt.attr_main_fn.unwrap().1, "first `#[main]` function")
.emit();
}
},

View File

@ -994,7 +994,7 @@ impl<'a, 'tcx> MemCategorizationContext<'a, 'tcx> {
let deref_ty = match base_cmt_ty.builtin_deref(true) {
Some(mt) => mt.ty,
None => {
debug!("Explicit deref of non-derefable type: {:?}", base_cmt_ty);
debug!("explicit deref of non-derefable type: {:?}", base_cmt_ty);
return Err(());
}
};
@ -1317,7 +1317,7 @@ impl<'a, 'tcx> MemCategorizationContext<'a, 'tcx> {
let element_ty = match cmt.ty.builtin_index() {
Some(ty) => ty,
None => {
debug!("Explicit index of non-indexable type {:?}", cmt);
debug!("explicit index of non-indexable type {:?}", cmt);
return Err(());
}
};

View File

@ -1645,7 +1645,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
}
}
Some(LifetimeUseSet::Many) => {
debug!("Not one use lifetime");
debug!("not one use lifetime");
}
None => {
let hir_id = self.tcx.hir().as_local_hir_id(def_id).unwrap();

View File

@ -643,11 +643,11 @@ rustc_queries! {
}
query is_sanitizer_runtime(_: CrateNum) -> bool {
fatal_cycle
desc { "query a crate is #![sanitizer_runtime]" }
desc { "query a crate is `#![sanitizer_runtime]`" }
}
query is_profiler_runtime(_: CrateNum) -> bool {
fatal_cycle
desc { "query a crate is #![profiler_runtime]" }
desc { "query a crate is `#![profiler_runtime]`" }
}
query panic_strategy(_: CrateNum) -> PanicStrategy {
fatal_cycle
@ -655,7 +655,7 @@ rustc_queries! {
}
query is_no_builtins(_: CrateNum) -> bool {
fatal_cycle
desc { "test whether a crate has #![no_builtins]" }
desc { "test whether a crate has `#![no_builtins]`" }
}
query symbol_mangling_version(_: CrateNum) -> SymbolManglingVersion {
fatal_cycle

View File

@ -1144,9 +1144,9 @@ options! {CodegenOptions, CodegenSetter, basic_codegen_options,
lto: LtoCli = (LtoCli::Unspecified, parse_lto, [TRACKED],
"perform LLVM link-time optimizations"),
target_cpu: Option<String> = (None, parse_opt_string, [TRACKED],
"select target processor (rustc --print target-cpus for details)"),
"select target processor (`rustc --print target-cpus` for details)"),
target_feature: String = (String::new(), parse_string, [TRACKED],
"target specific attributes (rustc --print target-features for details)"),
"target specific attributes (`rustc --print target-features` for details)"),
passes: Vec<String> = (Vec::new(), parse_list, [TRACKED],
"a list of extra LLVM passes to run (space separated)"),
llvm_args: Vec<String> = (Vec::new(), parse_list, [TRACKED],
@ -1172,9 +1172,9 @@ options! {CodegenOptions, CodegenSetter, basic_codegen_options,
no_redzone: Option<bool> = (None, parse_opt_bool, [TRACKED],
"disable the use of the redzone"),
relocation_model: Option<String> = (None, parse_opt_string, [TRACKED],
"choose the relocation model to use (rustc --print relocation-models for details)"),
"choose the relocation model to use (`rustc --print relocation-models` for details)"),
code_model: Option<String> = (None, parse_opt_string, [TRACKED],
"choose the code model to use (rustc --print code-models for details)"),
"choose the code model to use (`rustc --print code-models` for details)"),
metadata: Vec<String> = (Vec::new(), parse_list, [TRACKED],
"metadata to mangle symbol names with"),
extra_filename: String = (String::new(), parse_string, [UNTRACKED],
@ -1184,7 +1184,7 @@ options! {CodegenOptions, CodegenSetter, basic_codegen_options,
remark: Passes = (Passes::Some(Vec::new()), parse_passes, [UNTRACKED],
"print remarks for these optimization passes (space separated, or \"all\")"),
no_stack_check: bool = (false, parse_bool, [UNTRACKED],
"the --no-stack-check flag is deprecated and does nothing"),
"the `--no-stack-check` flag is deprecated and does nothing"),
debuginfo: Option<usize> = (None, parse_opt_uint, [TRACKED],
"debug info emission level, 0 = no debug info, 1 = line tables only, \
2 = full debug info with variable and type information"),
@ -1400,9 +1400,9 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
thinlto: Option<bool> = (None, parse_opt_bool, [TRACKED],
"enable ThinLTO when possible"),
inline_in_all_cgus: Option<bool> = (None, parse_opt_bool, [TRACKED],
"control whether #[inline] functions are in all cgus"),
"control whether `#[inline]` functions are in all CGUs"),
tls_model: Option<String> = (None, parse_opt_string, [TRACKED],
"choose the TLS model to use (rustc --print tls-models for details)"),
"choose the TLS model to use (`rustc --print tls-models` for details)"),
saturating_float_casts: bool = (false, parse_bool, [TRACKED],
"make float->int casts UB-free: numbers outside the integer type's range are clipped to \
the max/min integer respectively, and NaN is mapped to 0"),

View File

@ -1656,7 +1656,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
ObligationCauseCode::TrivialBound => {
err.help("see issue #48214");
if tcx.sess.opts.unstable_features.is_nightly_build() {
err.help("add #![feature(trivial_bounds)] to the \
err.help("add `#![feature(trivial_bounds)]` to the \
crate attributes to enable",
);
}

View File

@ -238,14 +238,14 @@ cfg_if! {
.write(true);
}
debug!("Attempting to open lock file `{}`", p.display());
debug!("attempting to open lock file `{}`", p.display());
let file = match open_options.open(p) {
Ok(file) => {
debug!("Lock file opened successfully");
debug!("lock file opened successfully");
file
}
Err(err) => {
debug!("Error opening lock file: {}", err);
debug!("error opening lock file: {}", err);
return Err(err)
}
};
@ -262,7 +262,7 @@ cfg_if! {
dwFlags |= LOCKFILE_EXCLUSIVE_LOCK;
}
debug!("Attempting to acquire lock on lock file `{}`",
debug!("attempting to acquire lock on lock file `{}`",
p.display());
LockFileEx(file.as_raw_handle(),
dwFlags,
@ -273,10 +273,10 @@ cfg_if! {
};
if ret == 0 {
let err = io::Error::last_os_error();
debug!("Failed acquiring file lock: {}", err);
debug!("failed acquiring file lock: {}", err);
Err(err)
} else {
debug!("Successfully acquired lock.");
debug!("successfully acquired lock");
Ok(Lock { _file: file })
}
}

View File

@ -892,7 +892,7 @@ fn print_with_analysis(
suffix (b::c::d)");
let hir_id = tcx.hir().node_to_hir_id(nodeid);
let node = tcx.hir().find(hir_id).unwrap_or_else(|| {
tcx.sess.fatal(&format!("--pretty flowgraph couldn't find id: {}", nodeid))
tcx.sess.fatal(&format!("`--pretty=flowgraph` couldn't find ID: {}", nodeid))
});
match blocks::Code::from_node(&tcx.hir(), hir_id) {
@ -904,7 +904,7 @@ fn print_with_analysis(
print_flowgraph(variants, tcx, code, mode, out)
}
None => {
let message = format!("--pretty=flowgraph needs block, fn, or method; \
let message = format!("`--pretty=flowgraph` needs block, fn, or method; \
got {:?}",
node);

View File

@ -311,7 +311,7 @@ fn check_expr_kind<'a, 'tcx>(
}
hir::ExprKind::Cast(ref from, _) => {
let expr_promotability = v.check_expr(from);
debug!("Checking const cast(id={})", from.hir_id);
debug!("checking const cast(id={})", from.hir_id);
let cast_in = CastTy::from_ty(v.tables.expr_ty(from));
let cast_out = CastTy::from_ty(v.tables.expr_ty(e));
match (cast_in, cast_out) {
@ -338,15 +338,15 @@ fn check_expr_kind<'a, 'tcx>(
if v.in_static {
for attr in &v.tcx.get_attrs(did)[..] {
if attr.check_name(sym::thread_local) {
debug!("Reference to Static(id={:?}) is unpromotable \
due to a #[thread_local] attribute", did);
debug!("reference to `Static(id={:?})` is unpromotable \
due to a `#[thread_local]` attribute", did);
return NotPromotable;
}
}
Promotable
} else {
debug!("Reference to Static(id={:?}) is unpromotable as it is not \
referenced from a static", did);
debug!("reference to `Static(id={:?})` is unpromotable as it is not \
referenced from a static", did);
NotPromotable
}
}

View File

@ -898,7 +898,7 @@ impl<'a> Resolver<'a> {
let msg = "macro_escape is a deprecated synonym for macro_use";
let mut err = self.session.struct_span_warn(attr.span, msg);
if let ast::AttrStyle::Inner = attr.style {
err.help("consider an outer attribute, #[macro_use] mod ...").emit();
err.help("consider an outer attribute, `#[macro_use]` mod ...").emit();
} else {
err.emit();
}

View File

@ -111,7 +111,7 @@ impl<'l, 'tcx> SaveContext<'l, 'tcx> {
let span = match self.tcx.extern_crate(n.as_def_id()) {
Some(&ExternCrate { span, .. }) => span,
None => {
debug!("Skipping crate {}, no data", n);
debug!("skipping crate {}, no data", n);
continue;
}
};
@ -469,7 +469,7 @@ impl<'l, 'tcx> SaveContext<'l, 'tcx> {
)
}
None => {
debug!("Could not find container for method {} at {:?}", id, span);
debug!("could not find container for method {} at {:?}", id, span);
// This is not necessarily a bug, if there was a compilation error,
// the tables we need might not exist.
return None;
@ -550,7 +550,7 @@ impl<'l, 'tcx> SaveContext<'l, 'tcx> {
}
ty::Tuple(..) => None,
_ => {
debug!("Expected struct or union type, found {:?}", ty);
debug!("expected struct or union type, found {:?}", ty);
None
}
}
@ -580,7 +580,7 @@ impl<'l, 'tcx> SaveContext<'l, 'tcx> {
let method_id = match self.tables.type_dependent_def_id(expr_hir_id) {
Some(id) => id,
None => {
debug!("Could not resolve method id for {:?}", expr);
debug!("could not resolve method id for {:?}", expr);
return None;
}
};

View File

@ -287,7 +287,7 @@ macro_rules! supported_targets {
// run-time that the parser works correctly
t = Target::from_json(t.to_json())
.map_err(LoadTargetError::Other)?;
debug!("Got builtin target: {:?}", t);
debug!("got builtin target: {:?}", t);
Ok(t)
},
)+

View File

@ -11,7 +11,7 @@ LL | | }
| |_^ the trait `Bar<u32>` is not implemented for `i32`
|
= help: see issue #48214
= help: add #![feature(trivial_bounds)] to the crate attributes to enable
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
error: aborting due to previous error

View File

@ -4,5 +4,5 @@ warning: macro_escape is a deprecated synonym for macro_use
LL | #![macro_escape]
| ^^^^^^^^^^^^^^^^
|
= help: consider an outer attribute, #[macro_use] mod ...
= help: consider an outer attribute, `#[macro_use]` mod ...

View File

@ -1,11 +1,11 @@
error[E0137]: multiple functions with a #[main] attribute
error[E0137]: multiple functions with a `#[main]` attribute
--> $DIR/E0137.rs:7:1
|
LL | fn foo() {}
| ----------- first #[main] function
| ----------- first `#[main]` function
...
LL | fn f() {}
| ^^^^^^^^^ additional #[main] function
| ^^^^^^^^^ additional `#[main]` function
error: aborting due to previous error

View File

@ -184,7 +184,7 @@ warning: macro_escape is a deprecated synonym for macro_use
LL | mod inner { #![macro_escape] }
| ^^^^^^^^^^^^^^^^
|
= help: consider an outer attribute, #[macro_use] mod ...
= help: consider an outer attribute, `#[macro_use]` mod ...
warning: the feature `rust1` has been stable since 1.0.0 and no longer requires an attribute to enable
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:89:12

View File

@ -4,5 +4,5 @@ warning: macro_escape is a deprecated synonym for macro_use
LL | #![macro_escape]
| ^^^^^^^^^^^^^^^^
|
= help: consider an outer attribute, #[macro_use] mod ...
= help: consider an outer attribute, `#[macro_use]` mod ...

View File

@ -5,7 +5,7 @@ LL | enum E where i32: Foo { V }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `i32`
|
= help: see issue #48214
= help: add #![feature(trivial_bounds)] to the crate attributes to enable
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
error[E0277]: the trait bound `i32: Foo` is not satisfied
--> $DIR/feature-gate-trivial_bounds.rs:12:1
@ -14,7 +14,7 @@ LL | struct S where i32: Foo;
| ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `i32`
|
= help: see issue #48214
= help: add #![feature(trivial_bounds)] to the crate attributes to enable
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
error[E0277]: the trait bound `i32: Foo` is not satisfied
--> $DIR/feature-gate-trivial_bounds.rs:14:1
@ -23,7 +23,7 @@ LL | trait T where i32: Foo {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `i32`
|
= help: see issue #48214
= help: add #![feature(trivial_bounds)] to the crate attributes to enable
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
error[E0277]: the trait bound `i32: Foo` is not satisfied
--> $DIR/feature-gate-trivial_bounds.rs:16:1
@ -32,7 +32,7 @@ LL | union U where i32: Foo { f: i32 }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `i32`
|
= help: see issue #48214
= help: add #![feature(trivial_bounds)] to the crate attributes to enable
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
error[E0277]: the trait bound `i32: Foo` is not satisfied
--> $DIR/feature-gate-trivial_bounds.rs:20:1
@ -47,7 +47,7 @@ LL | | }
| |_^ the trait `Foo` is not implemented for `i32`
|
= help: see issue #48214
= help: add #![feature(trivial_bounds)] to the crate attributes to enable
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
error[E0277]: the trait bound `i32: Foo` is not satisfied
--> $DIR/feature-gate-trivial_bounds.rs:28:1
@ -62,7 +62,7 @@ LL | | }
| |_^ the trait `Foo` is not implemented for `i32`
|
= help: see issue #48214
= help: add #![feature(trivial_bounds)] to the crate attributes to enable
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
error[E0277]: the trait bound `std::string::String: std::ops::Neg` is not satisfied
--> $DIR/feature-gate-trivial_bounds.rs:36:1
@ -73,7 +73,7 @@ LL | | }
| |_^ the trait `std::ops::Neg` is not implemented for `std::string::String`
|
= help: see issue #48214
= help: add #![feature(trivial_bounds)] to the crate attributes to enable
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
error[E0277]: `i32` is not an iterator
--> $DIR/feature-gate-trivial_bounds.rs:40:1
@ -86,7 +86,7 @@ LL | | }
= help: the trait `std::iter::Iterator` is not implemented for `i32`
= note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end`
= help: see issue #48214
= help: add #![feature(trivial_bounds)] to the crate attributes to enable
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/feature-gate-trivial_bounds.rs:52:1
@ -97,7 +97,7 @@ LL | struct TwoStrs(str, str) where str: Sized;
= help: the trait `std::marker::Sized` is not implemented for `str`
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
= help: see issue #48214
= help: add #![feature(trivial_bounds)] to the crate attributes to enable
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
error[E0277]: the size for values of type `(dyn A + 'static)` cannot be known at compilation time
--> $DIR/feature-gate-trivial_bounds.rs:55:1
@ -111,7 +111,7 @@ LL | | }
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
= note: required because it appears within the type `Dst<(dyn A + 'static)>`
= help: see issue #48214
= help: add #![feature(trivial_bounds)] to the crate attributes to enable
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/feature-gate-trivial_bounds.rs:59:1
@ -124,7 +124,7 @@ LL | | }
= help: the trait `std::marker::Sized` is not implemented for `str`
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
= help: see issue #48214
= help: add #![feature(trivial_bounds)] to the crate attributes to enable
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
error: aborting due to 11 previous errors

View File

@ -5,5 +5,5 @@ fn bar() {
}
#[main]
fn foo() { //~ ERROR multiple functions with a #[main] attribute
fn foo() { //~ ERROR multiple functions with a `#[main]` attribute
}

View File

@ -1,13 +1,13 @@
error[E0137]: multiple functions with a #[main] attribute
error[E0137]: multiple functions with a `#[main]` attribute
--> $DIR/multiple-main-2.rs:8:1
|
LL | / fn bar() {
LL | | }
| |_- first #[main] function
| |_- first `#[main]` function
...
LL | / fn foo() {
LL | | }
| |_^ additional #[main] function
| |_^ additional `#[main]` function
error: aborting due to previous error

View File

@ -6,6 +6,6 @@ fn main1() {
mod foo {
#[main]
fn main2() { //~ ERROR multiple functions with a #[main] attribute
fn main2() { //~ ERROR multiple functions with a `#[main]` attribute
}
}

View File

@ -1,13 +1,13 @@
error[E0137]: multiple functions with a #[main] attribute
error[E0137]: multiple functions with a `#[main]` attribute
--> $DIR/multiple-main-3.rs:9:5
|
LL | / fn main1() {
LL | | }
| |_- first #[main] function
| |_- first `#[main]` function
...
LL | / fn main2() {
LL | | }
| |_____^ additional #[main] function
| |_____^ additional `#[main]` function
error: aborting due to previous error

View File

@ -143,7 +143,7 @@ pub fn check(path: &Path, bad: &mut bool, verbose: bool) -> CollectedFeatures {
println!("Expected a gate test for the feature '{}'.", name);
println!("Hint: create a failing test file named 'feature-gate-{}.rs'\
\n in the 'ui' test suite, with its failures due to\
\n missing usage of #![feature({})].", name, name);
\n missing usage of `#![feature({})]`.", name, name);
println!("Hint: If you already have such a test and don't want to rename it,\
\n you can also add a // gate-test-{} line to the test file.",
name);

View File

@ -17,7 +17,7 @@ pub fn check(path: &Path, bad: &mut bool) {
if !contents.starts_with("//") && contents.contains("#[test]") {
tidy_error!(
bad,
"{} contains #[test]; libcore tests must be placed inside \
"`{}` contains `#[test]`; libcore tests must be placed inside \
`src/libcore/tests/`",
subpath.display()
);