Skip to content

Commit 60a4938

Browse files
author
Samy Kacimi
committed
normalize use of backticks in compiler messages for librustc_typecheck
#60532
1 parent dd2e804 commit 60a4938

13 files changed

+26
-26
lines changed

Diff for: src/librustc_typeck/check/coercion.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
459459
let (unsize_did, coerce_unsized_did) = if let (Some(u), Some(cu)) = traits {
460460
(u, cu)
461461
} else {
462-
debug!("Missing Unsize or CoerceUnsized traits");
462+
debug!("missing Unsize or CoerceUnsized traits");
463463
return Err(TypeError::Mismatch);
464464
};
465465

Diff for: src/librustc_typeck/check/generator_interior.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ pub fn resolve_interior<'a, 'tcx>(
130130
// if a Sync generator contains an &'α T, we need to check whether &'α T: Sync),
131131
// so knowledge of the exact relationships between them isn't particularly important.
132132

133-
debug!("Types in generator {:?}, span = {:?}", type_list, body.value.span);
133+
debug!("types in generator {:?}, span = {:?}", type_list, body.value.span);
134134

135135
// Replace all regions inside the generator interior with late bound regions
136136
// Note that each region slot in the types gets a new fresh late bound region,
@@ -144,7 +144,7 @@ pub fn resolve_interior<'a, 'tcx>(
144144

145145
let witness = fcx.tcx.mk_generator_witness(ty::Binder::bind(type_list));
146146

147-
debug!("Types in generator after region replacement {:?}, span = {:?}",
147+
debug!("types in generator after region replacement {:?}, span = {:?}",
148148
witness, body.value.span);
149149

150150
// Unify the type variable inside the generator with the new witness

Diff for: src/librustc_typeck/check/method/probe.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1230,7 +1230,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
12301230
if nightly_options::is_nightly_build() {
12311231
for (candidate, feature) in unstable_candidates {
12321232
diag.help(&format!(
1233-
"add #![feature({})] to the crate attributes to enable `{}`",
1233+
"add `#![feature({})]` to the crate attributes to enable `{}`",
12341234
feature,
12351235
self.tcx.def_path_str(candidate.item.def_id),
12361236
));
@@ -1432,7 +1432,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
14321432
/// candidate method where the method name may have been misspelt. Similarly to other
14331433
/// Levenshtein based suggestions, we provide at most one such suggestion.
14341434
fn probe_for_lev_candidate(&mut self) -> Result<Option<ty::AssocItem>, MethodError<'tcx>> {
1435-
debug!("Probing for method names similar to {:?}",
1435+
debug!("probing for method names similar to {:?}",
14361436
self.method_name);
14371437

14381438
let steps = self.steps.clone();

Diff for: src/librustc_typeck/check/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,7 @@ impl<'a, 'tcx> Visitor<'tcx> for GatherLocalsVisitor<'a, 'tcx> {
983983
};
984984
self.assign(local.span, local.hir_id, local_ty);
985985

986-
debug!("Local variable {:?} is assigned type {}",
986+
debug!("local variable {:?} is assigned type {}",
987987
local.pat,
988988
self.fcx.ty_to_string(
989989
self.fcx.locals.borrow().get(&local.hir_id).unwrap().clone().decl_ty));
@@ -1000,7 +1000,7 @@ impl<'a, 'tcx> Visitor<'tcx> for GatherLocalsVisitor<'a, 'tcx> {
10001000
traits::VariableType(p.hir_id));
10011001
}
10021002

1003-
debug!("Pattern binding {} is assigned to {} with type {:?}",
1003+
debug!("pattern binding {} is assigned to {} with type {:?}",
10041004
ident,
10051005
self.fcx.ty_to_string(
10061006
self.fcx.locals.borrow().get(&p.hir_id).unwrap().clone().decl_ty),
@@ -4462,7 +4462,7 @@ pub fn check_bounds_are_used<'tcx>(tcx: TyCtxt<'tcx>, generics: &ty::Generics, t
44624462

44634463
for leaf_ty in ty.walk() {
44644464
if let ty::Param(ty::ParamTy { index, .. }) = leaf_ty.sty {
4465-
debug!("Found use of ty param num {}", index);
4465+
debug!("found use of ty param num {}", index);
44664466
types_used[index as usize - own_counts.lifetimes] = true;
44674467
} else if let ty::Error = leaf_ty.sty {
44684468
// If there is already another error, do not emit

Diff for: src/librustc_typeck/check/regionck.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ impl<'a, 'tcx> RegionCtxt<'a, 'tcx> {
799799
debug!("callee_region={:?}", callee_region);
800800

801801
for arg_expr in arg_exprs {
802-
debug!("Argument: {:?}", arg_expr);
802+
debug!("argument: {:?}", arg_expr);
803803

804804
// ensure that any regions appearing in the argument type are
805805
// valid for at least the lifetime of the function:

Diff for: src/librustc_typeck/check/writeback.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ impl<'cx, 'tcx> WritebackCx<'cx, 'tcx> {
646646
let n_ty = self.fcx.node_ty(hir_id);
647647
let n_ty = self.resolve(&n_ty, &span);
648648
self.write_ty_to_tables(hir_id, n_ty);
649-
debug!("Node {:?} has type {:?}", hir_id, n_ty);
649+
debug!("node {:?} has type {:?}", hir_id, n_ty);
650650

651651
// Resolve any substitutions
652652
if let Some(substs) = self.fcx.tables.borrow().node_substs_opt(hir_id) {
@@ -665,13 +665,13 @@ impl<'cx, 'tcx> WritebackCx<'cx, 'tcx> {
665665
.remove(hir_id);
666666
match adjustment {
667667
None => {
668-
debug!("No adjustments for node {:?}", hir_id);
668+
debug!("no adjustments for node {:?}", hir_id);
669669
}
670670

671671
Some(adjustment) => {
672672
let resolved_adjustment = self.resolve(&adjustment, &span);
673673
debug!(
674-
"Adjustments for node {:?}: {:?}",
674+
"adjustments for node {:?}: {:?}",
675675
hir_id, resolved_adjustment
676676
);
677677
self.tables
@@ -689,7 +689,7 @@ impl<'cx, 'tcx> WritebackCx<'cx, 'tcx> {
689689
.remove(hir_id);
690690
match adjustment {
691691
None => {
692-
debug!("No pat_adjustments for node {:?}", hir_id);
692+
debug!("no pat_adjustments for node {:?}", hir_id);
693693
}
694694

695695
Some(adjustment) => {

Diff for: src/librustc_typeck/collect.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -2256,7 +2256,7 @@ fn compute_sig_of_foreign_fn_decl<'tcx>(
22562256
tcx.hir().hir_to_pretty_string(ast_ty.hir_id)
22572257
),
22582258
)
2259-
.help("add #![feature(simd_ffi)] to the crate attributes to enable")
2259+
.help("add `#![feature(simd_ffi)]` to the crate attributes to enable")
22602260
.emit();
22612261
}
22622262
};
@@ -2479,7 +2479,7 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, id: DefId) -> CodegenFnAttrs {
24792479
}
24802480
} else if attr.check_name(sym::target_feature) {
24812481
if tcx.fn_sig(id).unsafety() == Unsafety::Normal {
2482-
let msg = "#[target_feature(..)] can only be applied to `unsafe` functions";
2482+
let msg = "`#[target_feature(..)]` can only be applied to `unsafe` functions";
24832483
tcx.sess.struct_span_err(attr.span, msg)
24842484
.span_label(attr.span, "can only be applied to `unsafe` functions")
24852485
.span_label(tcx.def_span(id), "not an `unsafe` function")
@@ -2593,8 +2593,8 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, id: DefId) -> CodegenFnAttrs {
25932593
if let Some(span) = inline_span {
25942594
tcx.sess.span_err(
25952595
span,
2596-
"cannot use #[inline(always)] with \
2597-
#[target_feature]",
2596+
"cannot use `#[inline(always)]` with \
2597+
`#[target_feature]`",
25982598
);
25992599
}
26002600
}

Diff for: src/librustc_typeck/error_codes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4848,6 +4848,6 @@ register_diagnostics! {
48484848
E0641, // cannot cast to/from a pointer with an unknown kind
48494849
E0645, // trait aliases not finished
48504850
E0719, // duplicate values for associated type binding
4851-
E0722, // Malformed #[optimize] attribute
4851+
E0722, // Malformed `#[optimize]` attribute
48524852
E0724, // `#[ffi_returns_twice]` is only allowed in foreign functions
48534853
}

Diff for: src/librustc_typeck/variance/solve.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ impl<'a, 'tcx> SolveContext<'a, 'tcx> {
6464
let old_value = self.solutions[inferred];
6565
let new_value = glb(variance, old_value);
6666
if old_value != new_value {
67-
debug!("Updating inferred {} \
67+
debug!("updating inferred {} \
6868
from {:?} to {:?} due to {:?}",
6969
inferred,
7070
old_value,

Diff for: src/test/ui/feature-gates/feature-gate-simd-ffi.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ error: use of SIMD type `LocalSimd` in FFI is highly experimental and may result
44
LL | fn baz() -> LocalSimd;
55
| ^^^^^^^^^
66
|
7-
= help: add #![feature(simd_ffi)] to the crate attributes to enable
7+
= help: add `#![feature(simd_ffi)]` to the crate attributes to enable
88

99
error: use of SIMD type `LocalSimd` in FFI is highly experimental and may result in invalid code
1010
--> $DIR/feature-gate-simd-ffi.rs:10:15
1111
|
1212
LL | fn qux(x: LocalSimd);
1313
| ^^^^^^^^^
1414
|
15-
= help: add #![feature(simd_ffi)] to the crate attributes to enable
15+
= help: add `#![feature(simd_ffi)]` to the crate attributes to enable
1616

1717
error: aborting due to 2 previous errors
1818

Diff for: src/test/ui/inference/inference_unstable.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ LL | assert_eq!('x'.ipu_flatten(), 1);
88
= warning: once this method is added to the standard library, the ambiguity may cause an error or change in behavior!
99
= note: for more information, see issue #48919 <https://github.com/rust-lang/rust/issues/48919>
1010
= help: call with fully qualified syntax `inference_unstable_itertools::IpuItertools::ipu_flatten(...)` to keep using the current method
11-
= help: add #![feature(ipu_flatten)] to the crate attributes to enable `inference_unstable_iterator::IpuIterator::ipu_flatten`
11+
= help: add `#![feature(ipu_flatten)]` to the crate attributes to enable `inference_unstable_iterator::IpuIterator::ipu_flatten`
1212

Diff for: src/test/ui/target-feature-wrong.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
unsafe fn foo() {}
2626

2727
#[target_feature(enable = "sse2")]
28-
//~^ ERROR #[target_feature(..)] can only be applied to `unsafe` functions
28+
//~^ ERROR `#[target_feature(..)]` can only be applied to `unsafe` functions
2929
//~| NOTE can only be applied to `unsafe` functions
3030
fn bar() {}
3131
//~^ NOTE not an `unsafe` function
@@ -36,7 +36,7 @@ mod another {}
3636
//~^ NOTE not a function
3737

3838
#[inline(always)]
39-
//~^ ERROR: cannot use #[inline(always)]
39+
//~^ ERROR: cannot use `#[inline(always)]`
4040
#[target_feature(enable = "sse2")]
4141
unsafe fn test() {}
4242

Diff for: src/test/ui/target-feature-wrong.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ error: malformed `target_feature` attribute input
2222
LL | #[target_feature(disable = "baz")]
2323
| ^^^^^^^^^^^^^^^ help: must be of the form: `enable = ".."`
2424

25-
error: #[target_feature(..)] can only be applied to `unsafe` functions
25+
error: `#[target_feature(..)]` can only be applied to `unsafe` functions
2626
--> $DIR/target-feature-wrong.rs:27:1
2727
|
2828
LL | #[target_feature(enable = "sse2")]
@@ -40,7 +40,7 @@ LL |
4040
LL | mod another {}
4141
| -------------- not a function
4242

43-
error: cannot use #[inline(always)] with #[target_feature]
43+
error: cannot use `#[inline(always)]` with `#[target_feature]`
4444
--> $DIR/target-feature-wrong.rs:38:1
4545
|
4646
LL | #[inline(always)]

0 commit comments

Comments
 (0)