Skip to content

Commit 0a4a85e

Browse files
committed
Adjusted types and visibility in auto trait machinery.
1 parent 67c226a commit 0a4a85e

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/librustc/traits/auto_trait.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,21 @@ pub struct AutoTraitInfo<'cx> {
5757
}
5858

5959
pub struct AutoTraitFinder<'a, 'tcx: 'a> {
60-
pub tcx: &'a TyCtxt<'a, 'tcx, 'tcx>,
60+
tcx: &'a TyCtxt<'a, 'tcx, 'tcx>,
6161
}
6262

6363
impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> {
64-
pub fn find_auto_trait_generics<A, F>(
64+
pub fn new(tcx: &'a TyCtxt<'a, 'tcx, 'tcx>) -> Self {
65+
AutoTraitFinder { tcx }
66+
}
67+
68+
pub fn find_auto_trait_generics<A>(
6569
&self,
6670
did: DefId,
6771
trait_did: DefId,
6872
generics: &ty::Generics,
69-
auto_trait_callback: F)
73+
auto_trait_callback: impl for<'i> Fn(&InferCtxt<'_, 'tcx, 'i>, AutoTraitInfo<'i>) -> A)
7074
-> AutoTraitResult<A>
71-
where F: for<'b, 'cx, 'cx2> Fn(&InferCtxt<'b, 'cx, 'cx2>, AutoTraitInfo<'cx2>) -> A
7275
{
7376
let tcx = self.tcx;
7477
let ty = self.tcx.type_of(did);

src/librustdoc/clean/auto_trait.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub struct AutoTraitFinder<'a, 'tcx: 'a, 'rcx: 'a> {
2121

2222
impl<'a, 'tcx, 'rcx> AutoTraitFinder<'a, 'tcx, 'rcx> {
2323
pub fn new(cx: &'a core::DocContext<'a, 'tcx, 'rcx>) -> Self {
24-
let f = auto::AutoTraitFinder { tcx: &cx.tcx };
24+
let f = auto::AutoTraitFinder::new(&cx.tcx);
2525

2626
AutoTraitFinder { cx, f }
2727
}

0 commit comments

Comments
 (0)