diff options
| author | Michael Goulet <michael@errs.io> | 2023-05-23 18:15:00 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-06-06 20:57:00 +0000 |
| commit | b95ea45a60faac4219226d13f9c6c7fffd0b8cef (patch) | |
| tree | ac79f368bae5b344fda8f5e45b27b255093505ab /compiler/rustc_trait_selection/src | |
| parent | b7095f55721645cbc73027792c00844734f0f2a3 (diff) | |
| download | rust-b95ea45a60faac4219226d13f9c6c7fffd0b8cef.tar.gz rust-b95ea45a60faac4219226d13f9c6c7fffd0b8cef.zip | |
Note why rust-call abi requires sized obl
Diffstat (limited to 'compiler/rustc_trait_selection/src')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs index 80d0faca670..2937d9509f8 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs @@ -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"); } |
