Adjusted types and visibility in auto trait machinery.
This commit is contained in:
parent
67c226aece
commit
0a4a85e8ae
2 changed files with 8 additions and 5 deletions
|
@ -57,18 +57,21 @@ pub struct AutoTraitInfo<'cx> {
|
|||
}
|
||||
|
||||
pub struct AutoTraitFinder<'a, 'tcx: 'a> {
|
||||
pub tcx: &'a TyCtxt<'a, 'tcx, 'tcx>,
|
||||
tcx: &'a TyCtxt<'a, 'tcx, 'tcx>,
|
||||
}
|
||||
|
||||
impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> {
|
||||
pub fn find_auto_trait_generics<A, F>(
|
||||
pub fn new(tcx: &'a TyCtxt<'a, 'tcx, 'tcx>) -> Self {
|
||||
AutoTraitFinder { tcx }
|
||||
}
|
||||
|
||||
pub fn find_auto_trait_generics<A>(
|
||||
&self,
|
||||
did: DefId,
|
||||
trait_did: DefId,
|
||||
generics: &ty::Generics,
|
||||
auto_trait_callback: F)
|
||||
auto_trait_callback: impl for<'i> Fn(&InferCtxt<'_, 'tcx, 'i>, AutoTraitInfo<'i>) -> A)
|
||||
-> AutoTraitResult<A>
|
||||
where F: for<'b, 'cx, 'cx2> Fn(&InferCtxt<'b, 'cx, 'cx2>, AutoTraitInfo<'cx2>) -> A
|
||||
{
|
||||
let tcx = self.tcx;
|
||||
let ty = self.tcx.type_of(did);
|
||||
|
|
|
@ -21,7 +21,7 @@ pub struct AutoTraitFinder<'a, 'tcx: 'a, 'rcx: 'a> {
|
|||
|
||||
impl<'a, 'tcx, 'rcx> AutoTraitFinder<'a, 'tcx, 'rcx> {
|
||||
pub fn new(cx: &'a core::DocContext<'a, 'tcx, 'rcx>) -> Self {
|
||||
let f = auto::AutoTraitFinder { tcx: &cx.tcx };
|
||||
let f = auto::AutoTraitFinder::new(&cx.tcx);
|
||||
|
||||
AutoTraitFinder { cx, f }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue