Rollup merge of #111885 - compiler-errors:rust-call-abi-sized, r=eholk
Don't ICE on unsized `extern "rust-call"` call Conceptually builds on #111864, but doesn't depend on it.
This commit is contained in:
commit
b7706e891d
5 changed files with 40 additions and 2 deletions
|
@ -2663,9 +2663,15 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
|||
| ObligationCauseCode::LetElse
|
||||
| ObligationCauseCode::BinOp { .. }
|
||||
| ObligationCauseCode::AscribeUserTypeProvePredicate(..)
|
||||
| ObligationCauseCode::RustCall
|
||||
| ObligationCauseCode::DropImpl
|
||||
| ObligationCauseCode::ConstParam(_) => {}
|
||||
ObligationCauseCode::RustCall => {
|
||||
if let Some(pred) = predicate.to_opt_poly_trait_pred()
|
||||
&& Some(pred.def_id()) == self.tcx.lang_items().sized_trait()
|
||||
{
|
||||
err.note("argument required to be sized due to `extern \"rust-call\"` ABI");
|
||||
}
|
||||
}
|
||||
ObligationCauseCode::SliceOrArrayElem => {
|
||||
err.note("slice and array elements must have `Sized` type");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue