diff options
| author | Gary Guo <gary@garyguo.net> | 2021-10-11 20:52:36 +0100 |
|---|---|---|
| committer | Gary Guo <gary@garyguo.net> | 2021-10-11 20:52:36 +0100 |
| commit | 148f456cc6fd12a19f45a75b1fd758605c657d0d (patch) | |
| tree | 61e445424d906660496af241aa92146e628027bd /compiler/rustc_trait_selection | |
| parent | 1067e2ca5e9cfe5c79f956e49ffc684c5142d49b (diff) | |
Fix ICE 89775
Diffstat (limited to 'compiler/rustc_trait_selection')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs | 4 |
1 files changed, 3 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 a73d2285d45..1a8f863952e 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs @@ -704,7 +704,9 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> { .filter_map(|lang_item| self.tcx.lang_items().require(*lang_item).ok()) .collect(); - never_suggest_borrow.push(self.tcx.get_diagnostic_item(sym::Send).unwrap()); + if let Some(def_id) = self.tcx.get_diagnostic_item(sym::Send) { + never_suggest_borrow.push(def_id); + } let param_env = obligation.param_env; let trait_ref = poly_trait_ref.skip_binder(); |
