Skip to content

Commit

Permalink
Enclose type in backticks for "reached the recursion limit while auto…
Browse files Browse the repository at this point in the history
…-dereferencing" error
  • Loading branch information
varkor committed Nov 21, 2018
1 parent b99f9f7 commit f039872
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/librustc_typeck/check/autoderef.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ impl<'a, 'gcx, 'tcx> Iterator for Autoderef<'a, 'gcx, 'tcx> {
if self.steps.len() >= *tcx.sess.recursion_limit.get() {
// We've reached the recursion limit, error gracefully.
let suggested_limit = *tcx.sess.recursion_limit.get() * 2;
let msg = format!("reached the recursion limit while auto-dereferencing {:?}",
let msg = format!("reached the recursion limit while auto-dereferencing `{:?}`",
self.cur_ty);
let error_id = (DiagnosticMessageId::ErrorId(55), Some(self.span), msg);
let fresh = tcx.sess.one_time_diagnostics.borrow_mut().insert(error_id);
if fresh {
struct_span_err!(tcx.sess,
self.span,
E0055,
"reached the recursion limit while auto-dereferencing {:?}",
"reached the recursion limit while auto-dereferencing `{:?}`",
self.cur_ty)
.span_label(self.span, "deref recursion limit reached")
.help(&format!(
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_typeck/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ fn main() {
let foo = Foo;
let ref_foo = &&Foo;
// error, reached the recursion limit while auto-dereferencing &&Foo
// error, reached the recursion limit while auto-dereferencing `&&Foo`
ref_foo.foo();
}
```
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/did_you_mean/recursion_limit_deref.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0055]: reached the recursion limit while auto-dereferencing I
error[E0055]: reached the recursion limit while auto-dereferencing `I`
--> $DIR/recursion_limit_deref.rs:60:22
|
LL | let x: &Bottom = &t; //~ ERROR mismatched types
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/error-codes/E0055.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0055]: reached the recursion limit while auto-dereferencing Foo
error[E0055]: reached the recursion limit while auto-dereferencing `Foo`
--> $DIR/E0055.rs:21:13
|
LL | ref_foo.foo();
Expand Down
6 changes: 3 additions & 3 deletions src/test/ui/infinite/infinite-autoderef.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ LL | x = box x;
| cyclic type of infinite size
| help: try using a conversion method: `box x.to_string()`

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

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

error[E0055]: reached the recursion limit while auto-dereferencing Foo
error[E0055]: reached the recursion limit while auto-dereferencing `Foo`
--> $DIR/infinite-autoderef.rs:36:9
|
LL | Foo.bar();
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-38940.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ fn main() {
let t = Top::new();
let x: &Bottom = &t;
//~^ ERROR mismatched types
//~| ERROR reached the recursion limit while auto-dereferencing I
//~| ERROR reached the recursion limit while auto-dereferencing `I`
}
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-38940.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0055]: reached the recursion limit while auto-dereferencing I
error[E0055]: reached the recursion limit while auto-dereferencing `I`
--> $DIR/issue-38940.rs:43:22
|
LL | let x: &Bottom = &t;
Expand Down

0 comments on commit f039872

Please sign in to comment.