Enclose type in backticks for "reached the recursion limit while auto-dereferencing" error
This commit is contained in:
parent
b99f9f775c
commit
f039872766
7 changed files with 10 additions and 10 deletions
|
@ -59,7 +59,7 @@ impl<'a, 'gcx, 'tcx> Iterator for Autoderef<'a, 'gcx, 'tcx> {
|
||||||
if self.steps.len() >= *tcx.sess.recursion_limit.get() {
|
if self.steps.len() >= *tcx.sess.recursion_limit.get() {
|
||||||
// We've reached the recursion limit, error gracefully.
|
// We've reached the recursion limit, error gracefully.
|
||||||
let suggested_limit = *tcx.sess.recursion_limit.get() * 2;
|
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);
|
self.cur_ty);
|
||||||
let error_id = (DiagnosticMessageId::ErrorId(55), Some(self.span), msg);
|
let error_id = (DiagnosticMessageId::ErrorId(55), Some(self.span), msg);
|
||||||
let fresh = tcx.sess.one_time_diagnostics.borrow_mut().insert(error_id);
|
let fresh = tcx.sess.one_time_diagnostics.borrow_mut().insert(error_id);
|
||||||
|
@ -67,7 +67,7 @@ impl<'a, 'gcx, 'tcx> Iterator for Autoderef<'a, 'gcx, 'tcx> {
|
||||||
struct_span_err!(tcx.sess,
|
struct_span_err!(tcx.sess,
|
||||||
self.span,
|
self.span,
|
||||||
E0055,
|
E0055,
|
||||||
"reached the recursion limit while auto-dereferencing {:?}",
|
"reached the recursion limit while auto-dereferencing `{:?}`",
|
||||||
self.cur_ty)
|
self.cur_ty)
|
||||||
.span_label(self.span, "deref recursion limit reached")
|
.span_label(self.span, "deref recursion limit reached")
|
||||||
.help(&format!(
|
.help(&format!(
|
||||||
|
|
|
@ -538,7 +538,7 @@ fn main() {
|
||||||
let foo = Foo;
|
let foo = Foo;
|
||||||
let ref_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();
|
ref_foo.foo();
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
@ -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
|
--> $DIR/recursion_limit_deref.rs:60:22
|
||||||
|
|
|
|
||||||
LL | let x: &Bottom = &t; //~ ERROR mismatched types
|
LL | let x: &Bottom = &t; //~ ERROR mismatched types
|
||||||
|
|
|
@ -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
|
--> $DIR/E0055.rs:21:13
|
||||||
|
|
|
|
||||||
LL | ref_foo.foo();
|
LL | ref_foo.foo();
|
||||||
|
|
|
@ -7,7 +7,7 @@ LL | x = box x;
|
||||||
| cyclic type of infinite size
|
| cyclic type of infinite size
|
||||||
| help: try using a conversion method: `box x.to_string()`
|
| 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
|
--> $DIR/infinite-autoderef.rs:35:5
|
||||||
|
|
|
|
||||||
LL | Foo.foo;
|
LL | Foo.foo;
|
||||||
|
@ -15,7 +15,7 @@ LL | Foo.foo;
|
||||||
|
|
|
|
||||||
= help: consider adding a `#![recursion_limit="128"]` attribute to your crate
|
= 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
|
--> $DIR/infinite-autoderef.rs:35:9
|
||||||
|
|
|
|
||||||
LL | Foo.foo;
|
LL | Foo.foo;
|
||||||
|
@ -29,7 +29,7 @@ error[E0609]: no field `foo` on type `Foo`
|
||||||
LL | Foo.foo;
|
LL | Foo.foo;
|
||||||
| ^^^ unknown field
|
| ^^^ 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
|
--> $DIR/infinite-autoderef.rs:36:9
|
||||||
|
|
|
|
||||||
LL | Foo.bar();
|
LL | Foo.bar();
|
||||||
|
|
|
@ -42,5 +42,5 @@ fn main() {
|
||||||
let t = Top::new();
|
let t = Top::new();
|
||||||
let x: &Bottom = &t;
|
let x: &Bottom = &t;
|
||||||
//~^ ERROR mismatched types
|
//~^ ERROR mismatched types
|
||||||
//~| ERROR reached the recursion limit while auto-dereferencing I
|
//~| ERROR reached the recursion limit while auto-dereferencing `I`
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
--> $DIR/issue-38940.rs:43:22
|
||||||
|
|
|
|
||||||
LL | let x: &Bottom = &t;
|
LL | let x: &Bottom = &t;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue