From 31fcda170a0671195b7a1506b09c5f655fc4d7e9 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Mon, 3 Aug 2020 21:13:13 -0400 Subject: Fix async-std at the price of breaking half the test suite - Don't mark impl trait as an error --- src/librustc_privacy/lib.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/librustc_privacy') diff --git a/src/librustc_privacy/lib.rs b/src/librustc_privacy/lib.rs index fc00050f405..797b2d35e9d 100644 --- a/src/librustc_privacy/lib.rs +++ b/src/librustc_privacy/lib.rs @@ -778,13 +778,8 @@ impl Visitor<'tcx> for EmbargoVisitor<'tcx> { } // The interface is empty. hir::ItemKind::GlobalAsm(..) => {} - hir::ItemKind::OpaqueTy(..) => { - // FIXME: This is some serious pessimization intended to workaround deficiencies - // in the reachability pass (`middle/reachable.rs`). Types are marked as link-time - // reachable if they are returned via `impl Trait`, even from private functions. - let exist_level = cmp::max(item_level, Some(AccessLevel::ReachableFromImplTrait)); - self.reach(item.hir_id, exist_level).generics().predicates().ty(); - } + // assume the type is never reachable - since it's opaque, no one can use it from this interface + hir::ItemKind::OpaqueTy(..) => {} // Visit everything. hir::ItemKind::Const(..) | hir::ItemKind::Static(..) -- cgit 1.4.1-3-g733a5