Skip to content

Commit f039872

Browse files
committed
Enclose type in backticks for "reached the recursion limit while auto-dereferencing" error
1 parent b99f9f7 commit f039872

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

src/librustc_typeck/check/autoderef.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,15 @@ impl<'a, 'gcx, 'tcx> Iterator for Autoderef<'a, 'gcx, 'tcx> {
5959
if self.steps.len() >= *tcx.sess.recursion_limit.get() {
6060
// We've reached the recursion limit, error gracefully.
6161
let suggested_limit = *tcx.sess.recursion_limit.get() * 2;
62-
let msg = format!("reached the recursion limit while auto-dereferencing {:?}",
62+
let msg = format!("reached the recursion limit while auto-dereferencing `{:?}`",
6363
self.cur_ty);
6464
let error_id = (DiagnosticMessageId::ErrorId(55), Some(self.span), msg);
6565
let fresh = tcx.sess.one_time_diagnostics.borrow_mut().insert(error_id);
6666
if fresh {
6767
struct_span_err!(tcx.sess,
6868
self.span,
6969
E0055,
70-
"reached the recursion limit while auto-dereferencing {:?}",
70+
"reached the recursion limit while auto-dereferencing `{:?}`",
7171
self.cur_ty)
7272
.span_label(self.span, "deref recursion limit reached")
7373
.help(&format!(

src/librustc_typeck/diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ fn main() {
538538
let foo = Foo;
539539
let ref_foo = &&Foo;
540540
541-
// error, reached the recursion limit while auto-dereferencing &&Foo
541+
// error, reached the recursion limit while auto-dereferencing `&&Foo`
542542
ref_foo.foo();
543543
}
544544
```

src/test/ui/did_you_mean/recursion_limit_deref.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0055]: reached the recursion limit while auto-dereferencing I
1+
error[E0055]: reached the recursion limit while auto-dereferencing `I`
22
--> $DIR/recursion_limit_deref.rs:60:22
33
|
44
LL | let x: &Bottom = &t; //~ ERROR mismatched types

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0055]: reached the recursion limit while auto-dereferencing Foo
1+
error[E0055]: reached the recursion limit while auto-dereferencing `Foo`
22
--> $DIR/E0055.rs:21:13
33
|
44
LL | ref_foo.foo();

src/test/ui/infinite/infinite-autoderef.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ LL | x = box x;
77
| cyclic type of infinite size
88
| help: try using a conversion method: `box x.to_string()`
99

10-
error[E0055]: reached the recursion limit while auto-dereferencing Foo
10+
error[E0055]: reached the recursion limit while auto-dereferencing `Foo`
1111
--> $DIR/infinite-autoderef.rs:35:5
1212
|
1313
LL | Foo.foo;
1414
| ^^^^^^^ deref recursion limit reached
1515
|
1616
= help: consider adding a `#![recursion_limit="128"]` attribute to your crate
1717

18-
error[E0055]: reached the recursion limit while auto-dereferencing Foo
18+
error[E0055]: reached the recursion limit while auto-dereferencing `Foo`
1919
--> $DIR/infinite-autoderef.rs:35:9
2020
|
2121
LL | Foo.foo;
@@ -29,7 +29,7 @@ error[E0609]: no field `foo` on type `Foo`
2929
LL | Foo.foo;
3030
| ^^^ unknown field
3131

32-
error[E0055]: reached the recursion limit while auto-dereferencing Foo
32+
error[E0055]: reached the recursion limit while auto-dereferencing `Foo`
3333
--> $DIR/infinite-autoderef.rs:36:9
3434
|
3535
LL | Foo.bar();

src/test/ui/issues/issue-38940.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ fn main() {
4242
let t = Top::new();
4343
let x: &Bottom = &t;
4444
//~^ ERROR mismatched types
45-
//~| ERROR reached the recursion limit while auto-dereferencing I
45+
//~| ERROR reached the recursion limit while auto-dereferencing `I`
4646
}

src/test/ui/issues/issue-38940.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0055]: reached the recursion limit while auto-dereferencing I
1+
error[E0055]: reached the recursion limit while auto-dereferencing `I`
22
--> $DIR/issue-38940.rs:43:22
33
|
44
LL | let x: &Bottom = &t;

0 commit comments

Comments
 (0)