|
1 | 1 | use crate::infer::InferCtxt;
|
2 | 2 | use crate::traits::Obligation;
|
3 | 3 | use rustc_data_structures::fx::FxHashMap;
|
| 4 | +use rustc_hir as hir; |
4 | 5 | use rustc_hir::def_id::DefId;
|
5 |
| -use rustc_middle::ty::{self, ToPredicate, Ty}; |
| 6 | +use rustc_middle::ty::{self, ToPredicate, Ty, WithConstness}; |
6 | 7 |
|
7 | 8 | use super::FulfillmentError;
|
8 | 9 | use super::{ObligationCause, PredicateObligation};
|
@@ -47,9 +48,26 @@ pub trait TraitEngine<'tcx>: 'tcx {
|
47 | 48 |
|
48 | 49 | fn select_all_or_error(&mut self, infcx: &InferCtxt<'_, 'tcx>) -> Vec<FulfillmentError<'tcx>>;
|
49 | 50 |
|
| 51 | + fn select_all_with_constness_or_error( |
| 52 | + &mut self, |
| 53 | + infcx: &InferCtxt<'_, 'tcx>, |
| 54 | + _constness: hir::Constness, |
| 55 | + ) -> Vec<FulfillmentError<'tcx>> { |
| 56 | + self.select_all_or_error(infcx) |
| 57 | + } |
| 58 | + |
50 | 59 | fn select_where_possible(&mut self, infcx: &InferCtxt<'_, 'tcx>)
|
51 | 60 | -> Vec<FulfillmentError<'tcx>>;
|
52 | 61 |
|
| 62 | + // FIXME(fee1-dead) this should not provide a default body for chalk as chalk should be updated |
| 63 | + fn select_with_constness_where_possible( |
| 64 | + &mut self, |
| 65 | + infcx: &InferCtxt<'_, 'tcx>, |
| 66 | + _constness: hir::Constness, |
| 67 | + ) -> Vec<FulfillmentError<'tcx>> { |
| 68 | + self.select_where_possible(infcx) |
| 69 | + } |
| 70 | + |
53 | 71 | fn pending_obligations(&self) -> Vec<PredicateObligation<'tcx>>;
|
54 | 72 |
|
55 | 73 | fn relationships(&mut self) -> &mut FxHashMap<ty::TyVid, ty::FoundRelationships>;
|
|
0 commit comments