Skip to content

Commit

Permalink
normalize use of backticks for compiler messages in remaining modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Samy Kacimi committed Jul 23, 2019
1 parent 3ebca72 commit 66815c6
Show file tree
Hide file tree
Showing 27 changed files with 68 additions and 68 deletions.
2 changes: 1 addition & 1 deletion src/librustc/error_codes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/infer/lexical_region_resolve/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,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
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/infer/region_constraints/leak_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
});
}
Expand Down
6 changes: 3 additions & 3 deletions src/librustc/middle/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
},
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/middle/mem_categorization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(());
}
};
Expand Down Expand Up @@ -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(());
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/resolve_lifetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions src/librustc/query/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -643,19 +643,19 @@ 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
desc { "query a crate's configured panic strategy" }
}
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
Expand Down
14 changes: 7 additions & 7 deletions src/librustc/session/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand All @@ -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],
Expand All @@ -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"),
Expand Down Expand Up @@ -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"),
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/traits/error_reporting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
);
}
Expand Down
12 changes: 6 additions & 6 deletions src/librustc_data_structures/flock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
};
Expand All @@ -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,
Expand All @@ -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 })
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_driver/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);

Expand Down
10 changes: 5 additions & 5 deletions src/librustc_passes/rvalue_promotion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_resolve/build_reduced_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
8 changes: 4 additions & 4 deletions src/librustc_save_analysis/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
};
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
}
}
Expand Down Expand Up @@ -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;
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_target/spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
)+
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/cross/cross-fn-cache-hole.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ...

6 changes: 3 additions & 3 deletions src/test/ui/error-codes/E0137.stderr
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ...

Loading

0 comments on commit 66815c6

Please sign in to comment.