mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 16:54:01 +00:00
make issue33140_self_ty return Option<EarlyBinder<Ty>>
This commit is contained in:
parent
af3c8b2726
commit
d659c7c343
@ -781,7 +781,7 @@ rustc_queries! {
|
||||
separate_provide_extern
|
||||
}
|
||||
|
||||
query issue33140_self_ty(key: DefId) -> Option<ty::Ty<'tcx>> {
|
||||
query issue33140_self_ty(key: DefId) -> Option<ty::EarlyBinder<ty::Ty<'tcx>>> {
|
||||
desc { |tcx| "computing Self type wrt issue #33140 `{}`", tcx.def_path_str(key) }
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,9 @@
|
||||
use rustc_data_structures::fx::FxIndexSet;
|
||||
use rustc_hir as hir;
|
||||
use rustc_index::bit_set::BitSet;
|
||||
use rustc_middle::ty::{self, Binder, Predicate, PredicateKind, ToPredicate, Ty, TyCtxt};
|
||||
use rustc_middle::ty::{
|
||||
self, Binder, EarlyBinder, Predicate, PredicateKind, ToPredicate, Ty, TyCtxt,
|
||||
};
|
||||
use rustc_session::config::TraitSolver;
|
||||
use rustc_span::def_id::{DefId, CRATE_DEF_ID};
|
||||
use rustc_trait_selection::traits;
|
||||
@ -355,7 +357,7 @@ fn instance_def_size_estimate<'tcx>(
|
||||
/// If `def_id` is an issue 33140 hack impl, returns its self type; otherwise, returns `None`.
|
||||
///
|
||||
/// See [`ty::ImplOverlapKind::Issue33140`] for more details.
|
||||
fn issue33140_self_ty(tcx: TyCtxt<'_>, def_id: DefId) -> Option<Ty<'_>> {
|
||||
fn issue33140_self_ty(tcx: TyCtxt<'_>, def_id: DefId) -> Option<EarlyBinder<Ty<'_>>> {
|
||||
debug!("issue33140_self_ty({:?})", def_id);
|
||||
|
||||
let trait_ref = tcx
|
||||
@ -394,7 +396,7 @@ fn issue33140_self_ty(tcx: TyCtxt<'_>, def_id: DefId) -> Option<Ty<'_>> {
|
||||
|
||||
if self_ty_matches {
|
||||
debug!("issue33140_self_ty - MATCHES!");
|
||||
Some(self_ty)
|
||||
Some(EarlyBinder(self_ty))
|
||||
} else {
|
||||
debug!("issue33140_self_ty - non-matching self type");
|
||||
None
|
||||
|
Loading…
Reference in New Issue
Block a user