Skip to content

Add a lint for non-exported local types in visible type signatures. #11773

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions src/libextra/btree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
///number of elements that a given node can contain.
#[allow(missing_doc)]
pub struct BTree<K, V> {
root: Node<K, V>,
len: uint,
lower_bound: uint,
upper_bound: uint
priv root: Node<K, V>,
priv len: uint,
priv lower_bound: uint,
priv upper_bound: uint
}

//We would probably want to remove the dependence on the Clone trait in the future.
Expand All @@ -47,9 +47,9 @@ impl<K: TotalOrd, V> BTree<K, V> {

///Helper function for clone: returns new BTree with supplied root node,
///length, and lower bound. For use when the length is known already.
pub fn new_with_node_len(n: Node<K, V>,
length: uint,
lb: uint) -> BTree<K, V> {
fn new_with_node_len(n: Node<K, V>,
length: uint,
lb: uint) -> BTree<K, V> {
BTree {
root: n,
len: length,
Expand Down Expand Up @@ -590,4 +590,3 @@ mod test_btree {
}

}

6 changes: 4 additions & 2 deletions src/libextra/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ pub struct TestOpts {
logfile: Option<Path>
}

type OptRes = Result<TestOpts, ~str>;
/// Result of parsing the options.
pub type OptRes = Result<TestOpts, ~str>;

fn optgroups() -> ~[getopts::groups::OptGroup] {
~[groups::optflag("", "ignored", "Run ignored tests"),
Expand Down Expand Up @@ -722,7 +723,8 @@ enum TestEvent {
TeResult(TestDesc, TestResult),
}

type MonitorMsg = (TestDesc, TestResult);
/// The message sent to the test monitor from the individual runners.
pub type MonitorMsg = (TestDesc, TestResult);

fn run_tests(opts: &TestOpts,
tests: ~[TestDescAndFn],
Expand Down
1 change: 1 addition & 0 deletions src/libextra/workcache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
// except according to those terms.

#[allow(missing_doc)];
#[allow(visible_local_types)];

use json;
use json::ToJson;
Expand Down
6 changes: 3 additions & 3 deletions src/libgreen/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@ pub struct SchedPool {
/// keep track of how many tasks are currently running in the pool and then
/// sending on a channel once the entire pool has been drained of all tasks.
#[deriving(Clone)]
struct TaskState {
cnt: UnsafeArc<AtomicUint>,
done: SharedChan<()>,
pub struct TaskState {
priv cnt: UnsafeArc<AtomicUint>,
priv done: SharedChan<()>,
}

impl SchedPool {
Expand Down
30 changes: 15 additions & 15 deletions src/libgreen/sched.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,52 +40,52 @@ pub struct Scheduler {
/// reawoken on the wrong pool of schedulers.
pool_id: uint,
/// There are N work queues, one per scheduler.
work_queue: deque::Worker<~GreenTask>,
priv work_queue: deque::Worker<~GreenTask>,
/// Work queues for the other schedulers. These are created by
/// cloning the core work queues.
work_queues: ~[deque::Stealer<~GreenTask>],
priv work_queues: ~[deque::Stealer<~GreenTask>],
/// The queue of incoming messages from other schedulers.
/// These are enqueued by SchedHandles after which a remote callback
/// is triggered to handle the message.
message_queue: mpsc::Consumer<SchedMessage, ()>,
priv message_queue: mpsc::Consumer<SchedMessage, ()>,
/// Producer used to clone sched handles from
message_producer: mpsc::Producer<SchedMessage, ()>,
priv message_producer: mpsc::Producer<SchedMessage, ()>,
/// A shared list of sleeping schedulers. We'll use this to wake
/// up schedulers when pushing work onto the work queue.
sleeper_list: SleeperList,
priv sleeper_list: SleeperList,
/// Indicates that we have previously pushed a handle onto the
/// SleeperList but have not yet received the Wake message.
/// Being `true` does not necessarily mean that the scheduler is
/// not active since there are multiple event sources that may
/// wake the scheduler. It just prevents the scheduler from pushing
/// multiple handles onto the sleeper list.
sleepy: bool,
priv sleepy: bool,
/// A flag to indicate we've received the shutdown message and should
/// no longer try to go to sleep, but exit instead.
no_sleep: bool,
priv no_sleep: bool,
stack_pool: StackPool,
/// The scheduler runs on a special task. When it is not running
/// it is stored here instead of the work queue.
sched_task: Option<~GreenTask>,
priv sched_task: Option<~GreenTask>,
/// An action performed after a context switch on behalf of the
/// code running before the context switch
cleanup_job: Option<CleanupJob>,
priv cleanup_job: Option<CleanupJob>,
/// If the scheduler shouldn't run some tasks, a friend to send
/// them to.
friend_handle: Option<SchedHandle>,
priv friend_handle: Option<SchedHandle>,
/// Should this scheduler run any task, or only pinned tasks?
run_anything: bool,
priv run_anything: bool,
/// A fast XorShift rng for scheduler use
rng: XorShiftRng,
priv rng: XorShiftRng,
/// A togglable idle callback
idle_callback: Option<~PausableIdleCallback>,
priv idle_callback: Option<~PausableIdleCallback>,
/// A countdown that starts at a random value and is decremented
/// every time a yield check is performed. When it hits 0 a task
/// will yield.
yield_check_count: uint,
priv yield_check_count: uint,
/// A flag to tell the scheduler loop it needs to do some stealing
/// in order to introduce randomness as part of a yield
steal_for_yield: bool,
priv steal_for_yield: bool,
/// Bookeeping for the number of tasks which are currently running around
/// inside this pool of schedulers
task_state: TaskState,
Expand Down
2 changes: 1 addition & 1 deletion src/libnative/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub mod timer;

mod timer_helper;

type IoResult<T> = Result<T, IoError>;
pub type IoResult<T> = Result<T, IoError>;

fn unimpl() -> IoError {
IoError {
Expand Down
1 change: 1 addition & 0 deletions src/libnative/io/timer_timerfd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ pub struct Timer {
priv on_worker: bool,
}

#[allow(visible_local_types)]
pub enum Req {
NewTimer(libc::c_int, Chan<()>, bool, imp::itimerspec),
RemoveTimer(libc::c_int, Chan<()>),
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/driver/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ pub fn phase_3_run_analysis_passes(sess: Session,
}

time(time_passes, "lint checking", (), |_|
lint::check_crate(ty_cx, method_map, &exported_items, crate));
lint::check_crate(ty_cx, method_map, &exported_items, &public_items, crate));

CrateAnalysis {
exp_map2: exp_map2,
Expand Down
2 changes: 2 additions & 0 deletions src/librustc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ This API is completely unstable and subject to change.

#[feature(macro_rules, globs, struct_variant, managed_boxes)];

#[allow(visible_local_types)];

extern mod extra;
extern mod syntax;

Expand Down
Loading