Make a span more useful
This commit is contained in:
parent
5518d1931d
commit
4d2e965106
2 changed files with 6 additions and 12 deletions
|
@ -1328,6 +1328,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
|
||||||
ty::Generator(..) => "generator",
|
ty::Generator(..) => "generator",
|
||||||
_ => "function",
|
_ => "function",
|
||||||
};
|
};
|
||||||
|
let span = self.tcx.sess.source_map().guess_head_span(span);
|
||||||
let mut err = struct_span_err!(
|
let mut err = struct_span_err!(
|
||||||
self.tcx.sess,
|
self.tcx.sess,
|
||||||
span,
|
span,
|
||||||
|
|
|
@ -1,18 +1,11 @@
|
||||||
error[E0631]: type mismatch in generator arguments
|
error[E0631]: type mismatch in generator arguments
|
||||||
--> $DIR/issue-88653.rs:9:5
|
--> $DIR/issue-88653.rs:9:5
|
||||||
|
|
|
|
||||||
LL | |bar| {
|
LL | |bar| {
|
||||||
| ^----
|
| ^^^^^
|
||||||
| |
|
| |
|
||||||
| _____found signature of `fn(bool) -> _`
|
| expected signature of `fn((bool,)) -> _`
|
||||||
| |
|
| found signature of `fn(bool) -> _`
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
LL | |
|
|
||||||
... |
|
|
||||||
LL | | }
|
|
||||||
LL | | }
|
|
||||||
| |_____^ expected signature of `fn((bool,)) -> _`
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue