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