Skip to content

Commit 54b096a

Browse files
committed
Fixes for code review.
1 parent 81684bf commit 54b096a

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/librustc/middle/privacy.rs

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ pub struct AccessLevels<Id = NodeId> {
4242

4343
impl<Id: Hash + Eq> AccessLevels<Id> {
4444
pub fn is_reachable(&self, id: Id) -> bool {
45-
// self.map.contains_key(&id)
4645
self.map.get(&id) >= Some(&AccessLevel::Reachable)
4746
}
4847
pub fn is_exported(&self, id: Id) -> bool {

src/test/run-pass/issue-50865-private-impl-trait/auxiliary/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//

src/test/run-pass/issue-50865-private-impl-trait/main.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -11,7 +11,12 @@
1111
// aux-build:lib.rs
1212

1313
// Regression test for #50865.
14-
// FIXME: explain.
14+
// When using generics or specifying the type directly, this example
15+
// codegens `foo` internally. However, when using a private `impl Trait`
16+
// function which references another private item, `foo` (in this case)
17+
// wouldn't be codegenned until main.rs used `bar`, as with impl Trait
18+
// it is not cast to `fn()` automatically to satisfy e.g.
19+
// `fn foo() -> fn() { ... }`.
1520

1621
extern crate lib;
1722

0 commit comments

Comments
 (0)