Point at def span on incorrect panic or alloc error handler
This commit is contained in:
parent
e6b35b0e11
commit
70ed4f972e
3 changed files with 6 additions and 8 deletions
|
@ -1178,6 +1178,7 @@ fn check_fn<'a, 'gcx, 'tcx>(inherited: &'a Inherited<'a, 'gcx, 'tcx>,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
let span = fcx.tcx.sess.source_map().def_span(span);
|
||||||
fcx.tcx.sess.span_err(span, "function should have one argument");
|
fcx.tcx.sess.span_err(span, "function should have one argument");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -1226,6 +1227,7 @@ fn check_fn<'a, 'gcx, 'tcx>(inherited: &'a Inherited<'a, 'gcx, 'tcx>,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
let span = fcx.tcx.sess.source_map().def_span(span);
|
||||||
fcx.tcx.sess.span_err(span, "function should have one argument");
|
fcx.tcx.sess.span_err(span, "function should have one argument");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
error: function should have one argument
|
error: function should have one argument
|
||||||
--> $DIR/alloc-error-handler-bad-signature-3.rs:20:1
|
--> $DIR/alloc-error-handler-bad-signature-3.rs:20:1
|
||||||
|
|
|
|
||||||
LL | / fn oom() -> ! { //~ ERROR function should have one argument
|
LL | fn oom() -> ! { //~ ERROR function should have one argument
|
||||||
LL | | loop {}
|
| ^^^^^^^^^^^^^
|
||||||
LL | | }
|
|
||||||
| |_^
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
error: function should have one argument
|
error: function should have one argument
|
||||||
--> $DIR/panic-handler-bad-signature-3.rs:20:1
|
--> $DIR/panic-handler-bad-signature-3.rs:20:1
|
||||||
|
|
|
|
||||||
LL | / fn panic() -> ! { //~ ERROR function should have one argument
|
LL | fn panic() -> ! { //~ ERROR function should have one argument
|
||||||
LL | | loop {}
|
| ^^^^^^^^^^^^^^^
|
||||||
LL | | }
|
|
||||||
| |_^
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue