Fix the fallout

This commit is contained in:
Vadim Petrochenkov 2015-11-21 17:39:15 +03:00
parent f3f27a5c64
commit 26a2f852be
13 changed files with 27 additions and 50 deletions

View File

@ -78,7 +78,7 @@ pub struct Node<K, V> {
_capacity: usize,
}
struct NodeSlice<'a, K: 'a, V: 'a> {
pub struct NodeSlice<'a, K: 'a, V: 'a> {
keys: &'a [K],
vals: &'a [V],
pub edges: &'a [Node<K, V>],
@ -87,7 +87,7 @@ struct NodeSlice<'a, K: 'a, V: 'a> {
has_edges: bool,
}
struct MutNodeSlice<'a, K: 'a, V: 'a> {
pub struct MutNodeSlice<'a, K: 'a, V: 'a> {
keys: &'a [K],
vals: &'a mut [V],
pub edges: &'a mut [Node<K, V>],
@ -1344,7 +1344,7 @@ fn min_load_from_capacity(cap: usize) -> usize {
/// A trait for pairs of `Iterator`s, one over edges and the other over key/value pairs. This is
/// necessary, as the `MoveTraversalImpl` needs to have a destructor that deallocates the `Node`,
/// and a pair of `Iterator`s would require two independent destructors.
trait TraversalImpl {
pub trait TraversalImpl {
type Item;
type Edge;
@ -1358,7 +1358,7 @@ trait TraversalImpl {
/// A `TraversalImpl` that actually is backed by two iterators. This works in the non-moving case,
/// as no deallocation needs to be done.
#[derive(Clone)]
struct ElemsAndEdges<Elems, Edges>(Elems, Edges);
pub struct ElemsAndEdges<Elems, Edges>(Elems, Edges);
impl<K, V, E, Elems: DoubleEndedIterator, Edges: DoubleEndedIterator>
TraversalImpl for ElemsAndEdges<Elems, Edges>
@ -1375,7 +1375,7 @@ impl<K, V, E, Elems: DoubleEndedIterator, Edges: DoubleEndedIterator>
}
/// A `TraversalImpl` taking a `Node` by value.
struct MoveTraversalImpl<K, V> {
pub struct MoveTraversalImpl<K, V> {
keys: RawItems<K>,
vals: RawItems<V>,
edges: RawItems<Node<K, V>>,
@ -1436,7 +1436,7 @@ impl<K, V> Drop for MoveTraversalImpl<K, V> {
/// An abstraction over all the different kinds of traversals a node supports
#[derive(Clone)]
struct AbsTraversal<Impl> {
pub struct AbsTraversal<Impl> {
inner: Impl,
head_is_edge: bool,
tail_is_edge: bool,

View File

@ -209,7 +209,7 @@ struct ArmBlocks {
}
#[derive(Clone, Debug)]
struct Candidate<'pat, 'tcx:'pat> {
pub struct Candidate<'pat, 'tcx:'pat> {
// all of these must be satisfied...
match_pairs: Vec<MatchPair<'pat, 'tcx>>,
@ -235,7 +235,7 @@ struct Binding<'tcx> {
}
#[derive(Clone, Debug)]
struct MatchPair<'pat, 'tcx:'pat> {
pub struct MatchPair<'pat, 'tcx:'pat> {
// this lvalue...
lvalue: Lvalue<'tcx>,
@ -278,7 +278,7 @@ enum TestKind<'tcx> {
}
#[derive(Debug)]
struct Test<'tcx> {
pub struct Test<'tcx> {
span: Span,
kind: TestKind<'tcx>,
}

View File

@ -18,7 +18,7 @@ use rustc_front::hir;
use syntax::ast;
use syntax::codemap::Span;
struct Builder<'a, 'tcx: 'a> {
pub struct Builder<'a, 'tcx: 'a> {
hir: Cx<'a, 'tcx>,
cfg: CFG<'tcx>,
scopes: Vec<scope::Scope<'tcx>>,
@ -40,7 +40,7 @@ struct CFG<'tcx> {
// convenient.
#[must_use] // if you don't use one of these results, you're leaving a dangling edge
struct BlockAnd<T>(BasicBlock, T);
pub struct BlockAnd<T>(BasicBlock, T);
trait BlockAndExtension {
fn and<T>(self, v: T) -> BlockAnd<T>;

View File

@ -14,7 +14,7 @@ use std::os::windows::prelude::*;
use std::ptr;
use libc::{c_void, c_long};
type DWORD = u32;
pub type DWORD = u32;
type LPCWSTR = *const u16;
type LONG = c_long;
type LPDWORD = *mut DWORD;
@ -34,7 +34,7 @@ const SYNCHRONIZE: REGSAM = 0x00100000;
const REG_SZ: DWORD = 1;
const ERROR_SUCCESS: i32 = 0;
enum __HKEY__ {}
pub enum __HKEY__ {}
pub type HKEY = *mut __HKEY__;
pub type PHKEY = *mut HKEY;
pub type REGSAM = DWORD;

View File

@ -145,7 +145,7 @@ impl FunctionDebugContext {
}
}
struct FunctionDebugContextData {
pub struct FunctionDebugContextData {
scope_map: RefCell<NodeMap<DIScope>>,
fn_metadata: DISubprogram,
argument_counter: Cell<usize>,

View File

@ -123,7 +123,7 @@ pub enum BucketState<K, V, M> {
// A GapThenFull encapsulates the state of two consecutive buckets at once.
// The first bucket, called the gap, is known to be empty.
// The second bucket is full.
struct GapThenFull<K, V, M> {
pub struct GapThenFull<K, V, M> {
gap: EmptyBucket<K, V, ()>,
full: FullBucket<K, V, M>,
}

View File

@ -13,7 +13,7 @@
use std::marker;
struct arc_destruct<T: Sync> {
pub struct arc_destruct<T: Sync> {
_data: isize,
_marker: marker::PhantomData<T>
}
@ -37,7 +37,7 @@ fn init() -> arc_destruct<context_res> {
arc(context_res())
}
struct context_res {
pub struct context_res {
ctx : isize,
}

View File

@ -49,7 +49,7 @@ struct UsedStruct1 {
}
struct UsedStruct2(isize);
struct UsedStruct3;
struct UsedStruct4;
pub struct UsedStruct4;
// this struct is never used directly, but its method is, so we don't want
// to warn it
struct SemiUsedStruct;

View File

@ -32,7 +32,7 @@ impl Public<Private<isize>> {
pub fn a(&self) -> Private<isize> { panic!() }
fn b(&self) -> Private<isize> { panic!() }
pub fn c() -> Private<isize> { panic!() } //~ ERROR private type in exported type signature
pub fn c() -> Private<isize> { panic!() }
fn d() -> Private<isize> { panic!() }
}
impl Public<isize> {
@ -75,8 +75,8 @@ pub trait PubTrait {
}
impl PubTrait for Public<isize> {
fn bar(&self) -> Private<isize> { panic!() }
fn baz() -> Private<isize> { panic!() }
fn bar(&self) -> Private<isize> { panic!() } //~ ERROR private type in exported type signature
fn baz() -> Private<isize> { panic!() } //~ ERROR private type in exported type signature
}
impl PubTrait for Public<Private<isize>> {
fn bar(&self) -> Private<isize> { panic!() }
@ -108,7 +108,7 @@ pub trait ParamTrait<T> {
fn foo() -> T;
}
impl ParamTrait<Private<isize>> //~ ERROR private type in exported type signature
impl ParamTrait<Private<isize>>
for Public<isize> {
fn foo() -> Private<isize> { panic!() }
}

View File

@ -182,7 +182,7 @@ use self::Enum1::{Variant1, Variant2};
use std::marker::PhantomData;
use std::ptr;
struct Struct1;
pub struct Struct1;
struct GenericStruct<T1, T2>(PhantomData<(T1,T2)>);
enum Enum1 {

View File

@ -13,11 +13,11 @@
use std::marker::PhantomData;
struct DeterministicHasher;
struct RandomHasher;
pub struct DeterministicHasher;
pub struct RandomHasher;
struct MyHashMap<K, V, H=DeterministicHasher> {
pub struct MyHashMap<K, V, H=DeterministicHasher> {
data: PhantomData<(K, V, H)>
}

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
trait Test { type T; }
pub trait Test { type T; }
impl Test for u32 {
type T = i32;

View File

@ -1,23 +0,0 @@
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// pretty-expanded FIXME #23616
#![feature(visible_private_types)]
trait Foo { fn dummy(&self) { } }
pub trait Bar : Foo {}
struct Baz;
pub fn f(_: Baz) {}
fn main() {}