Skip to content

Commit 922dcfd

Browse files
committed
Switch some tuple structs to pub fields
This commit deals with the fallout of the previous change by making tuples structs have public fields where necessary (now that the fields are private by default).
1 parent 6831979 commit 922dcfd

File tree

25 files changed

+56
-48
lines changed

25 files changed

+56
-48
lines changed

src/librand/distributions/exponential.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use distributions::{ziggurat, ziggurat_tables, Sample, IndependentSample};
2828
/// Generate Normal Random
2929
/// Samples*](http://www.doornik.com/research/ziggurat.pdf). Nuffield
3030
/// College, Oxford
31-
pub struct Exp1(f64);
31+
pub struct Exp1(pub f64);
3232

3333
// This could be done via `-rng.gen::<f64>().ln()` but that is slower.
3434
impl Rand for Exp1 {

src/librand/distributions/normal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use distributions::{ziggurat, ziggurat_tables, Sample, IndependentSample};
2727
/// Generate Normal Random
2828
/// Samples*](http://www.doornik.com/research/ziggurat.pdf). Nuffield
2929
/// College, Oxford
30-
pub struct StandardNormal(f64);
30+
pub struct StandardNormal(pub f64);
3131

3232
impl Rand for StandardNormal {
3333
fn rand<R:Rng>(rng: &mut R) -> StandardNormal {

src/librand/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ pub fn random<T: Rand>() -> T {
658658
/// let Open01(val) = random::<Open01<f32>>();
659659
/// println!("f32 from (0,1): {}", val);
660660
/// ```
661-
pub struct Open01<F>(F);
661+
pub struct Open01<F>(pub F);
662662

663663
/// A wrapper for generating floating point numbers uniformly in the
664664
/// closed interval `[0,1]` (including both endpoints).
@@ -674,7 +674,7 @@ pub struct Open01<F>(F);
674674
/// let Closed01(val) = random::<Closed01<f32>>();
675675
/// println!("f32 from [0,1]: {}", val);
676676
/// ```
677-
pub struct Closed01<F>(F);
677+
pub struct Closed01<F>(pub F);
678678

679679
#[cfg(test)]
680680
mod test {

src/librustc/middle/graph.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ pub struct Edge<E> {
5454
}
5555

5656
#[deriving(Eq)]
57-
pub struct NodeIndex(uint);
57+
pub struct NodeIndex(pub uint);
5858
pub static InvalidNodeIndex: NodeIndex = NodeIndex(uint::MAX);
5959

6060
#[deriving(Eq)]
61-
pub struct EdgeIndex(uint);
61+
pub struct EdgeIndex(pub uint);
6262
pub static InvalidEdgeIndex: EdgeIndex = EdgeIndex(uint::MAX);
6363

6464
// Use a private field here to guarantee no more instances are created:

src/librustc/middle/trans/basic_block.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use lib::llvm::{llvm, BasicBlockRef};
1212
use middle::trans::value::{Users, Value};
1313
use std::iter::{Filter, Map};
1414

15-
pub struct BasicBlock(BasicBlockRef);
15+
pub struct BasicBlock(pub BasicBlockRef);
1616

1717
pub type Preds<'a> = Map<'a, Value, BasicBlock, Filter<'a, Value, Users>>;
1818

src/librustc/middle/trans/value.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use middle::trans::basic_block::BasicBlock;
1313
use middle::trans::common::Block;
1414
use std::libc::c_uint;
1515

16-
pub struct Value(ValueRef);
16+
pub struct Value(pub ValueRef);
1717

1818
macro_rules! opt_val ( ($e:expr) => (
1919
unsafe {

src/librustc/middle/ty.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -869,13 +869,13 @@ impl CLike for BuiltinBound {
869869
}
870870

871871
#[deriving(Clone, Eq, TotalEq, Hash)]
872-
pub struct TyVid(uint);
872+
pub struct TyVid(pub uint);
873873

874874
#[deriving(Clone, Eq, TotalEq, Hash)]
875-
pub struct IntVid(uint);
875+
pub struct IntVid(pub uint);
876876

877877
#[deriving(Clone, Eq, TotalEq, Hash)]
878-
pub struct FloatVid(uint);
878+
pub struct FloatVid(pub uint);
879879

880880
#[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
881881
pub struct RegionVid {

src/librustc/middle/typeck/infer/coercion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ use syntax::ast;
8383
// Note: Coerce is not actually a combiner, in that it does not
8484
// conform to the same interface, though it performs a similar
8585
// function.
86-
pub struct Coerce<'f>(CombineFields<'f>);
86+
pub struct Coerce<'f>(pub CombineFields<'f>);
8787

8888
impl<'f> Coerce<'f> {
8989
pub fn get_ref<'a>(&'a self) -> &'a CombineFields<'f> {

src/librustc/middle/typeck/infer/glb.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use collections::HashMap;
2828
use util::common::{indenter};
2929
use util::ppaux::mt_to_str;
3030

31-
pub struct Glb<'f>(CombineFields<'f>); // "greatest lower bound" (common subtype)
31+
pub struct Glb<'f>(pub CombineFields<'f>); // "greatest lower bound" (common subtype)
3232

3333
impl<'f> Glb<'f> {
3434
pub fn get_ref<'a>(&'a self) -> &'a CombineFields<'f> { let Glb(ref v) = *self; v }

src/librustc/middle/typeck/infer/lub.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use syntax::ast::{ExternFn, ImpureFn, UnsafeFn};
2727
use syntax::ast::{Onceness, Purity};
2828
use util::ppaux::mt_to_str;
2929

30-
pub struct Lub<'f>(CombineFields<'f>); // least-upper-bound: common supertype
30+
pub struct Lub<'f>(pub CombineFields<'f>); // least-upper-bound: common supertype
3131

3232
impl<'f> Lub<'f> {
3333
pub fn get_ref<'a>(&'a self) -> &'a CombineFields<'f> { let Lub(ref v) = *self; v }

0 commit comments

Comments
 (0)