Skip to content

Commit 5d4c5be

Browse files
committed
Auto merge of #62908 - fakenine:normalize_use_of_backticks_compiler_messages_p17, r=alexreg
normalize use of backticks for compiler messages in remaining modules #60532
2 parents a7f2867 + 66815c6 commit 5d4c5be

27 files changed

+68
-68
lines changed

src/librustc/error_codes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ Erroneous code example:
485485
fn foo() {}
486486
487487
#[main]
488-
fn f() {} // error: multiple functions with a #[main] attribute
488+
fn f() {} // error: multiple functions with a `#[main]` attribute
489489
```
490490
491491
This error indicates that the compiler found multiple functions with the

src/librustc/infer/lexical_region_resolve/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
874874
constraints.retain(|constraint| {
875875
let (edge_changed, retain) = body(constraint);
876876
if edge_changed {
877-
debug!("Updated due to constraint {:?}", constraint);
877+
debug!("updated due to constraint {:?}", constraint);
878878
changed = true;
879879
}
880880
retain

src/librustc/infer/region_constraints/leak_check.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ impl<'tcx> RegionConstraintCollector<'tcx> {
7878
}
7979

8080
return Err(if overly_polymorphic {
81-
debug!("Overly polymorphic!");
81+
debug!("overly polymorphic!");
8282
TypeError::RegionsOverlyPolymorphic(placeholder.name, tainted_region)
8383
} else {
84-
debug!("Not as polymorphic!");
84+
debug!("not as polymorphic!");
8585
TypeError::RegionsInsufficientlyPolymorphic(placeholder.name, tainted_region)
8686
});
8787
}

src/librustc/middle/entry.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ fn find_item(item: &Item, ctxt: &mut EntryContext<'_, '_>, at_root: bool) {
120120
ctxt.attr_main_fn = Some((item.hir_id, item.span));
121121
} else {
122122
struct_span_err!(ctxt.session, item.span, E0137,
123-
"multiple functions with a #[main] attribute")
124-
.span_label(item.span, "additional #[main] function")
125-
.span_label(ctxt.attr_main_fn.unwrap().1, "first #[main] function")
123+
"multiple functions with a `#[main]` attribute")
124+
.span_label(item.span, "additional `#[main]` function")
125+
.span_label(ctxt.attr_main_fn.unwrap().1, "first `#[main]` function")
126126
.emit();
127127
}
128128
},

src/librustc/middle/mem_categorization.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@ impl<'a, 'tcx> MemCategorizationContext<'a, 'tcx> {
994994
let deref_ty = match base_cmt_ty.builtin_deref(true) {
995995
Some(mt) => mt.ty,
996996
None => {
997-
debug!("Explicit deref of non-derefable type: {:?}", base_cmt_ty);
997+
debug!("explicit deref of non-derefable type: {:?}", base_cmt_ty);
998998
return Err(());
999999
}
10001000
};
@@ -1317,7 +1317,7 @@ impl<'a, 'tcx> MemCategorizationContext<'a, 'tcx> {
13171317
let element_ty = match cmt.ty.builtin_index() {
13181318
Some(ty) => ty,
13191319
None => {
1320-
debug!("Explicit index of non-indexable type {:?}", cmt);
1320+
debug!("explicit index of non-indexable type {:?}", cmt);
13211321
return Err(());
13221322
}
13231323
};

src/librustc/middle/resolve_lifetime.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1645,7 +1645,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
16451645
}
16461646
}
16471647
Some(LifetimeUseSet::Many) => {
1648-
debug!("Not one use lifetime");
1648+
debug!("not one use lifetime");
16491649
}
16501650
None => {
16511651
let hir_id = self.tcx.hir().as_local_hir_id(def_id).unwrap();

src/librustc/query/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -643,19 +643,19 @@ rustc_queries! {
643643
}
644644
query is_sanitizer_runtime(_: CrateNum) -> bool {
645645
fatal_cycle
646-
desc { "query a crate is #![sanitizer_runtime]" }
646+
desc { "query a crate is `#![sanitizer_runtime]`" }
647647
}
648648
query is_profiler_runtime(_: CrateNum) -> bool {
649649
fatal_cycle
650-
desc { "query a crate is #![profiler_runtime]" }
650+
desc { "query a crate is `#![profiler_runtime]`" }
651651
}
652652
query panic_strategy(_: CrateNum) -> PanicStrategy {
653653
fatal_cycle
654654
desc { "query a crate's configured panic strategy" }
655655
}
656656
query is_no_builtins(_: CrateNum) -> bool {
657657
fatal_cycle
658-
desc { "test whether a crate has #![no_builtins]" }
658+
desc { "test whether a crate has `#![no_builtins]`" }
659659
}
660660
query symbol_mangling_version(_: CrateNum) -> SymbolManglingVersion {
661661
fatal_cycle

src/librustc/session/config.rs

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

src/librustc/traits/error_reporting.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1656,7 +1656,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
16561656
ObligationCauseCode::TrivialBound => {
16571657
err.help("see issue #48214");
16581658
if tcx.sess.opts.unstable_features.is_nightly_build() {
1659-
err.help("add #![feature(trivial_bounds)] to the \
1659+
err.help("add `#![feature(trivial_bounds)]` to the \
16601660
crate attributes to enable",
16611661
);
16621662
}

src/librustc_data_structures/flock.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -238,14 +238,14 @@ cfg_if! {
238238
.write(true);
239239
}
240240

241-
debug!("Attempting to open lock file `{}`", p.display());
241+
debug!("attempting to open lock file `{}`", p.display());
242242
let file = match open_options.open(p) {
243243
Ok(file) => {
244-
debug!("Lock file opened successfully");
244+
debug!("lock file opened successfully");
245245
file
246246
}
247247
Err(err) => {
248-
debug!("Error opening lock file: {}", err);
248+
debug!("error opening lock file: {}", err);
249249
return Err(err)
250250
}
251251
};
@@ -262,7 +262,7 @@ cfg_if! {
262262
dwFlags |= LOCKFILE_EXCLUSIVE_LOCK;
263263
}
264264

265-
debug!("Attempting to acquire lock on lock file `{}`",
265+
debug!("attempting to acquire lock on lock file `{}`",
266266
p.display());
267267
LockFileEx(file.as_raw_handle(),
268268
dwFlags,
@@ -273,10 +273,10 @@ cfg_if! {
273273
};
274274
if ret == 0 {
275275
let err = io::Error::last_os_error();
276-
debug!("Failed acquiring file lock: {}", err);
276+
debug!("failed acquiring file lock: {}", err);
277277
Err(err)
278278
} else {
279-
debug!("Successfully acquired lock.");
279+
debug!("successfully acquired lock");
280280
Ok(Lock { _file: file })
281281
}
282282
}

src/librustc_driver/pretty.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,7 @@ fn print_with_analysis(
892892
suffix (b::c::d)");
893893
let hir_id = tcx.hir().node_to_hir_id(nodeid);
894894
let node = tcx.hir().find(hir_id).unwrap_or_else(|| {
895-
tcx.sess.fatal(&format!("--pretty flowgraph couldn't find id: {}", nodeid))
895+
tcx.sess.fatal(&format!("`--pretty=flowgraph` couldn't find ID: {}", nodeid))
896896
});
897897

898898
match blocks::Code::from_node(&tcx.hir(), hir_id) {
@@ -904,7 +904,7 @@ fn print_with_analysis(
904904
print_flowgraph(variants, tcx, code, mode, out)
905905
}
906906
None => {
907-
let message = format!("--pretty=flowgraph needs block, fn, or method; \
907+
let message = format!("`--pretty=flowgraph` needs block, fn, or method; \
908908
got {:?}",
909909
node);
910910

src/librustc_passes/rvalue_promotion.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ fn check_expr_kind<'a, 'tcx>(
311311
}
312312
hir::ExprKind::Cast(ref from, _) => {
313313
let expr_promotability = v.check_expr(from);
314-
debug!("Checking const cast(id={})", from.hir_id);
314+
debug!("checking const cast(id={})", from.hir_id);
315315
let cast_in = CastTy::from_ty(v.tables.expr_ty(from));
316316
let cast_out = CastTy::from_ty(v.tables.expr_ty(e));
317317
match (cast_in, cast_out) {
@@ -338,15 +338,15 @@ fn check_expr_kind<'a, 'tcx>(
338338
if v.in_static {
339339
for attr in &v.tcx.get_attrs(did)[..] {
340340
if attr.check_name(sym::thread_local) {
341-
debug!("Reference to Static(id={:?}) is unpromotable \
342-
due to a #[thread_local] attribute", did);
341+
debug!("reference to `Static(id={:?})` is unpromotable \
342+
due to a `#[thread_local]` attribute", did);
343343
return NotPromotable;
344344
}
345345
}
346346
Promotable
347347
} else {
348-
debug!("Reference to Static(id={:?}) is unpromotable as it is not \
349-
referenced from a static", did);
348+
debug!("reference to `Static(id={:?})` is unpromotable as it is not \
349+
referenced from a static", did);
350350
NotPromotable
351351
}
352352
}

src/librustc_resolve/build_reduced_graph.rs

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

src/librustc_save_analysis/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ impl<'l, 'tcx> SaveContext<'l, 'tcx> {
111111
let span = match self.tcx.extern_crate(n.as_def_id()) {
112112
Some(&ExternCrate { span, .. }) => span,
113113
None => {
114-
debug!("Skipping crate {}, no data", n);
114+
debug!("skipping crate {}, no data", n);
115115
continue;
116116
}
117117
};
@@ -469,7 +469,7 @@ impl<'l, 'tcx> SaveContext<'l, 'tcx> {
469469
)
470470
}
471471
None => {
472-
debug!("Could not find container for method {} at {:?}", id, span);
472+
debug!("could not find container for method {} at {:?}", id, span);
473473
// This is not necessarily a bug, if there was a compilation error,
474474
// the tables we need might not exist.
475475
return None;
@@ -550,7 +550,7 @@ impl<'l, 'tcx> SaveContext<'l, 'tcx> {
550550
}
551551
ty::Tuple(..) => None,
552552
_ => {
553-
debug!("Expected struct or union type, found {:?}", ty);
553+
debug!("expected struct or union type, found {:?}", ty);
554554
None
555555
}
556556
}
@@ -580,7 +580,7 @@ impl<'l, 'tcx> SaveContext<'l, 'tcx> {
580580
let method_id = match self.tables.type_dependent_def_id(expr_hir_id) {
581581
Some(id) => id,
582582
None => {
583-
debug!("Could not resolve method id for {:?}", expr);
583+
debug!("could not resolve method id for {:?}", expr);
584584
return None;
585585
}
586586
};

src/librustc_target/spec/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ macro_rules! supported_targets {
287287
// run-time that the parser works correctly
288288
t = Target::from_json(t.to_json())
289289
.map_err(LoadTargetError::Other)?;
290-
debug!("Got builtin target: {:?}", t);
290+
debug!("got builtin target: {:?}", t);
291291
Ok(t)
292292
},
293293
)+

src/test/ui/cross/cross-fn-cache-hole.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ LL | | }
1111
| |_^ the trait `Bar<u32>` is not implemented for `i32`
1212
|
1313
= help: see issue #48214
14-
= help: add #![feature(trivial_bounds)] to the crate attributes to enable
14+
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
1515

1616
error: aborting due to previous error
1717

src/test/ui/deprecation/deprecated-macro_escape-inner.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ warning: macro_escape is a deprecated synonym for macro_use
44
LL | #![macro_escape]
55
| ^^^^^^^^^^^^^^^^
66
|
7-
= help: consider an outer attribute, #[macro_use] mod ...
7+
= help: consider an outer attribute, `#[macro_use]` mod ...
88

src/test/ui/error-codes/E0137.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
error[E0137]: multiple functions with a #[main] attribute
1+
error[E0137]: multiple functions with a `#[main]` attribute
22
--> $DIR/E0137.rs:7:1
33
|
44
LL | fn foo() {}
5-
| ----------- first #[main] function
5+
| ----------- first `#[main]` function
66
...
77
LL | fn f() {}
8-
| ^^^^^^^^^ additional #[main] function
8+
| ^^^^^^^^^ additional `#[main]` function
99

1010
error: aborting due to previous error
1111

src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ warning: macro_escape is a deprecated synonym for macro_use
184184
LL | mod inner { #![macro_escape] }
185185
| ^^^^^^^^^^^^^^^^
186186
|
187-
= help: consider an outer attribute, #[macro_use] mod ...
187+
= help: consider an outer attribute, `#[macro_use]` mod ...
188188

189189
warning: the feature `rust1` has been stable since 1.0.0 and no longer requires an attribute to enable
190190
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:89:12

src/test/ui/feature-gate/issue-43106-gating-of-macro_escape.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ warning: macro_escape is a deprecated synonym for macro_use
44
LL | #![macro_escape]
55
| ^^^^^^^^^^^^^^^^
66
|
7-
= help: consider an outer attribute, #[macro_use] mod ...
7+
= help: consider an outer attribute, `#[macro_use]` mod ...
88

0 commit comments

Comments
 (0)