about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-01-24 21:00:31 -0800
committerAlex Crichton <alex@alexcrichton.com>2014-01-26 15:42:15 -0800
commitcdfdc1eb6b9ff58b4a264d1c112dfcbf6e9187ae (patch)
tree648f2dad8b0b1d0a079a569deaf304e241b15512 /src
parent26114838944128ffe66d1e9fc897cb45b1a5eb1d (diff)
downloadrust-cdfdc1eb6b9ff58b4a264d1c112dfcbf6e9187ae.tar.gz
rust-cdfdc1eb6b9ff58b4a264d1c112dfcbf6e9187ae.zip
Move extra::flate to libflate
This is hopefully the beginning of the long-awaited dissolution of libextra.
Using the newly created build infrastructure for building libraries, I decided
to move the first module out of libextra.

While not being a particularly meaty module in and of itself, the flate module
is required by rustc and additionally has a native C dependency. I was able to
very easily split out the C dependency from rustrt, update librustc, and
magically everything gets installed to the right locations and built
automatically.

This is meant to be a proof-of-concept commit to how easy it is to remove
modules from libextra now. I didn't put any effort into modernizing the
interface of libflate or updating it other than to remove the one glob import it
had.
Diffstat (limited to 'src')
-rw-r--r--src/libextra/lib.rs1
-rw-r--r--src/libflate/lib.rs (renamed from src/libextra/flate.rs)8
-rw-r--r--src/librustc/lib.rs1
-rw-r--r--src/librustc/metadata/loader.rs2
-rw-r--r--src/librustc/middle/trans/base.rs2
-rw-r--r--src/librustdoc/html/markdown.rs4
6 files changed, 12 insertions, 6 deletions
diff --git a/src/libextra/lib.rs b/src/libextra/lib.rs
index fc0cc045175..5a4fedd2b2a 100644
--- a/src/libextra/lib.rs
+++ b/src/libextra/lib.rs
@@ -82,7 +82,6 @@ pub mod rational;
 pub mod complex;
 pub mod stats;
 pub mod semver;
-pub mod flate;
 pub mod hex;
 pub mod uuid;
 
diff --git a/src/libextra/flate.rs b/src/libflate/lib.rs
index faceb17af47..f746fe4ec32 100644
--- a/src/libextra/flate.rs
+++ b/src/libflate/lib.rs
@@ -14,6 +14,10 @@ Simple compression
 
 */
 
+#[crate_id = "flate#0.10-pre"];
+#[crate_type = "rlib"];
+#[crate_type = "dylib"];
+#[license = "MIT/ASL2"];
 #[allow(missing_doc)];
 
 use std::libc::{c_void, size_t, c_int};
@@ -23,7 +27,7 @@ use std::vec;
 pub mod rustrt {
     use std::libc::{c_int, c_void, size_t};
 
-    #[link(name = "rustrt", kind = "static")]
+    #[link(name = "miniz", kind = "static")]
     extern {
         pub fn tdefl_compress_mem_to_heap(psrc_buf: *c_void,
                                           src_buf_len: size_t,
@@ -91,7 +95,7 @@ pub fn inflate_bytes_zlib(bytes: &[u8]) -> ~[u8] {
 
 #[cfg(test)]
 mod tests {
-    use super::*;
+    use super::{inflate_bytes, deflate_bytes};
     use std::rand;
     use std::rand::Rng;
 
diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs
index f7ee736f144..62232360c33 100644
--- a/src/librustc/lib.rs
+++ b/src/librustc/lib.rs
@@ -30,6 +30,7 @@ This API is completely unstable and subject to change.
 #[feature(macro_rules, globs, struct_variant, managed_boxes)];
 
 extern mod extra;
+extern mod flate;
 extern mod syntax;
 
 use back::link;
diff --git a/src/librustc/metadata/loader.rs b/src/librustc/metadata/loader.rs
index 72f2e1baddd..8b7da1f8310 100644
--- a/src/librustc/metadata/loader.rs
+++ b/src/librustc/metadata/loader.rs
@@ -33,7 +33,7 @@ use std::os::consts::{macos, freebsd, linux, android, win32};
 use std::ptr;
 use std::str;
 use std::vec;
-use extra::flate;
+use flate;
 
 pub enum Os {
     OsMacos,
diff --git a/src/librustc/middle/trans/base.rs b/src/librustc/middle/trans/base.rs
index 5b246daa6c5..9744c395b7c 100644
--- a/src/librustc/middle/trans/base.rs
+++ b/src/librustc/middle/trans/base.rs
@@ -2683,7 +2683,7 @@ pub fn crate_ctxt_to_encode_parms<'r>(cx: &'r CrateContext, ie: encoder::encode_
 }
 
 pub fn write_metadata(cx: &CrateContext, crate: &ast::Crate) -> ~[u8] {
-    use extra::flate;
+    use flate;
 
     if !cx.sess.building_library.get() {
         return ~[]
diff --git a/src/librustdoc/html/markdown.rs b/src/librustdoc/html/markdown.rs
index 5d0728c8cdf..d53adb78a30 100644
--- a/src/librustdoc/html/markdown.rs
+++ b/src/librustdoc/html/markdown.rs
@@ -16,7 +16,9 @@
 //! functionality through a unit-struct, `Markdown`, which has an implementation
 //! of `fmt::Default`. Example usage:
 //!
-//! ```rust
+//! ```rust,ignore
+//! use rustdoc::html::markdown::Markdown;
+//!
 //! let s = "My *markdown* _text_";
 //! let html = format!("{}", Markdown(s));
 //! // ... something using html