diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2014-03-02 11:23:04 +1100 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2014-03-12 11:31:05 +1100 |
| commit | 6fa4bbeed425ae99d15322fbaa05d1abeae6547f (patch) | |
| tree | 17f9edde3db9c624e476ac2f6c585792ddb1890b /src/libsyntax | |
| parent | 74bfa7108a62c053fdeae2bb093f8035e19e2ef2 (diff) | |
| download | rust-6fa4bbeed425ae99d15322fbaa05d1abeae6547f.tar.gz rust-6fa4bbeed425ae99d15322fbaa05d1abeae6547f.zip | |
std: Move rand to librand.
This functionality is not super-core and so doesn't need to be included in std. It's possible that std may need rand (it does a little bit now, for io::test) in which case the functionality required could be moved to a secret hidden module and reexposed by librand. Unfortunately, using #[deprecated] here is hard: there's too much to mock to make it feasible, since we have to ensure that programs still typecheck to reach the linting phase.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ext/deriving/rand.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libsyntax/ext/deriving/rand.rs b/src/libsyntax/ext/deriving/rand.rs index da9679eb655..2d16c87b78b 100644 --- a/src/libsyntax/ext/deriving/rand.rs +++ b/src/libsyntax/ext/deriving/rand.rs @@ -26,7 +26,7 @@ pub fn expand_deriving_rand(cx: &mut ExtCtxt, let trait_def = TraitDef { span: span, attributes: Vec::new(), - path: Path::new(vec!("std", "rand", "Rand")), + path: Path::new(vec!("rand", "Rand")), additional_bounds: Vec::new(), generics: LifetimeBounds::empty(), methods: vec!( @@ -35,7 +35,7 @@ pub fn expand_deriving_rand(cx: &mut ExtCtxt, generics: LifetimeBounds { lifetimes: Vec::new(), bounds: vec!(("R", - vec!( Path::new(vec!("std", "rand", "Rng")) ))) + vec!( Path::new(vec!("rand", "Rng")) ))) }, explicit_self: None, args: vec!( @@ -58,7 +58,6 @@ fn rand_substructure(cx: &mut ExtCtxt, trait_span: Span, substr: &Substructure) _ => cx.bug("Incorrect number of arguments to `rand` in `deriving(Rand)`") }; let rand_ident = vec!( - cx.ident_of("std"), cx.ident_of("rand"), cx.ident_of("Rand"), cx.ident_of("rand") @@ -89,7 +88,7 @@ fn rand_substructure(cx: &mut ExtCtxt, trait_span: Span, substr: &Substructure) Vec::new()); let rand_name = cx.expr_path(rand_name); - // ::std::rand::Rand::rand(rng) + // ::rand::Rand::rand(rng) let rv_call = cx.expr_call(trait_span, rand_name, vec!( *rng.get(0) )); |
