about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-07-08 19:26:30 +0000
committerbors <bors@rust-lang.org>2015-07-08 19:26:30 +0000
commit15952ac6cf39c593ae2b9c2cd161f2e221324e6a (patch)
treed98060271ef0c504b8228a8d439e4e3b431f2cc9
parent50df2a09b8b9dd4883eb27d833a8482799175a3b (diff)
parent546ce79570c618c0f5ffa72e85535675fab43408 (diff)
downloadrust-15952ac6cf39c593ae2b9c2cd161f2e221324e6a.tar.gz
rust-15952ac6cf39c593ae2b9c2cd161f2e221324e6a.zip
Auto merge of #26894 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #26687, #26784, #26850, #26889, #26891, #26892, #26893
- Failed merges: 
-rw-r--r--src/compiletest/runtest.rs5
-rw-r--r--src/doc/complement-design-faq.md2
-rw-r--r--src/doc/trpl/guessing-game.md8
-rw-r--r--src/libcore/fmt/mod.rs43
-rw-r--r--src/libcore/slice.rs4
-rw-r--r--src/librustc_resolve/lib.rs5
-rw-r--r--src/libstd/io/buffered.rs16
-rw-r--r--src/test/run-make/execution-engine/Makefile6
8 files changed, 71 insertions, 18 deletions
diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs
index 39d99af8d6a..93054f39790 100644
--- a/src/compiletest/runtest.rs
+++ b/src/compiletest/runtest.rs
@@ -1702,8 +1702,11 @@ fn run_codegen_test(config: &Config, props: &TestProps, testfile: &Path) {
 }
 
 fn charset() -> &'static str {
-    if cfg!(any(target_os = "bitrig", target_os = "freebsd")) {
+    // FreeBSD 10.1 defaults to GDB 6.1.1 which doesn't support "auto" charset
+    if cfg!(target_os = "bitrig") {
         "auto"
+    } else if cfg!(target_os = "freebsd") {
+        "ISO-8859-1"
     } else {
         "UTF-8"
     }
diff --git a/src/doc/complement-design-faq.md b/src/doc/complement-design-faq.md
index e887ed0cc52..5e99876f5da 100644
--- a/src/doc/complement-design-faq.md
+++ b/src/doc/complement-design-faq.md
@@ -99,7 +99,7 @@ Second, it makes cost explicit. In general, the only safe way to have a
 non-exhaustive match would be to panic the thread if nothing is matched, though
 it could fall through if the type of the `match` expression is `()`. This sort
 of hidden cost and special casing is against the language's philosophy. It's
-easy to ignore certain cases by using the `_` wildcard:
+easy to ignore all unspecified cases by using the `_` wildcard:
 
 ```rust,ignore
 match val.do_something() {
diff --git a/src/doc/trpl/guessing-game.md b/src/doc/trpl/guessing-game.md
index a599b8a855e..1784c253f7f 100644
--- a/src/doc/trpl/guessing-game.md
+++ b/src/doc/trpl/guessing-game.md
@@ -360,10 +360,12 @@ rand="0.3.0"
 The `[dependencies]` section of `Cargo.toml` is like the `[package]` section:
 everything that follows it is part of it, until the next section starts.
 Cargo uses the dependencies section to know what dependencies on external
-crates you have, and what versions you require. In this case, we’ve used version `0.3.0`.
+crates you have, and what versions you require. In this case, we’ve specified version `0.3.0`,
+which Cargo understands to be any release that’s compatible with this specific version.
 Cargo understands [Semantic Versioning][semver], which is a standard for writing version
-numbers. If we wanted to use the latest version we could use `*` or we could use a range
-of versions. [Cargo’s documentation][cargodoc] contains more details.
+numbers. If we wanted to use only `0.3.0` exactly, we could use `=0.3.0`. If we
+wanted to use the latest version we could use `*`; We could use a range of
+versions. [Cargo’s documentation][cargodoc] contains more details.
 
 [semver]: http://semver.org
 [cargodoc]: http://doc.crates.io/crates-io.html
diff --git a/src/libcore/fmt/mod.rs b/src/libcore/fmt/mod.rs
index 0bb519ec095..47030bf0fb3 100644
--- a/src/libcore/fmt/mod.rs
+++ b/src/libcore/fmt/mod.rs
@@ -273,6 +273,8 @@ impl<'a> Display for Arguments<'a> {
 ///
 /// Generally speaking, you should just `derive` a `Debug` implementation.
 ///
+/// When used with the alternate format specifier `#?`, the output is pretty-printed.
+///
 /// For more information on formatters, see [the module-level documentation][module].
 ///
 /// [module]: ../index.html
@@ -314,6 +316,12 @@ impl<'a> Display for Arguments<'a> {
 /// println!("The origin is: {:?}", origin);
 /// ```
 ///
+/// This outputs:
+///
+/// ```text
+/// The origin is: Point { x: 0, y: 0 }
+/// ```
+///
 /// There are a number of `debug_*` methods on `Formatter` to help you with manual
 /// implementations, such as [`debug_struct`][debug_struct].
 ///
@@ -321,6 +329,29 @@ impl<'a> Display for Arguments<'a> {
 /// on `Formatter` support pretty printing using the alternate flag: `{:#?}`.
 ///
 /// [debug_struct]: ../std/fmt/struct.Formatter.html#method.debug_struct
+///
+/// Pretty printing with `#?`:
+///
+/// ```
+/// #[derive(Debug)]
+/// struct Point {
+///     x: i32,
+///     y: i32,
+/// }
+///
+/// let origin = Point { x: 0, y: 0 };
+///
+/// println!("The origin is: {:#?}", origin);
+/// ```
+///
+/// This outputs:
+///
+/// ```text
+/// The origin is: Point {
+///     x: 0,
+///     y: 0
+/// }
+/// ```
 #[stable(feature = "rust1", since = "1.0.0")]
 #[rustc_on_unimplemented = "`{Self}` cannot be formatted using `:?`; if it is \
                             defined in your crate, add `#[derive(Debug)]` or \
@@ -379,6 +410,8 @@ pub trait Display {
 ///
 /// The `Octal` trait should format its output as a number in base-8.
 ///
+/// The alternate flag, `#`, adds a `0o` in front of the output.
+///
 /// For more information on formatters, see [the module-level documentation][module].
 ///
 /// [module]: ../index.html
@@ -391,6 +424,7 @@ pub trait Display {
 /// let x = 42; // 42 is '52' in octal
 ///
 /// assert_eq!(format!("{:o}", x), "52");
+/// assert_eq!(format!("{:#o}", x), "0o52");
 /// ```
 ///
 /// Implementing `Octal` on a type:
@@ -423,6 +457,8 @@ pub trait Octal {
 ///
 /// The `Binary` trait should format its output as a number in binary.
 ///
+/// The alternate flag, `#`, adds a `0b` in front of the output.
+///
 /// For more information on formatters, see [the module-level documentation][module].
 ///
 /// [module]: ../index.html
@@ -435,6 +471,7 @@ pub trait Octal {
 /// let x = 42; // 42 is '101010' in binary
 ///
 /// assert_eq!(format!("{:b}", x), "101010");
+/// assert_eq!(format!("{:#b}", x), "0b101010");
 /// ```
 ///
 /// Implementing `Binary` on a type:
@@ -468,6 +505,8 @@ pub trait Binary {
 /// The `LowerHex` trait should format its output as a number in hexidecimal, with `a` through `f`
 /// in lower case.
 ///
+/// The alternate flag, `#`, adds a `0x` in front of the output.
+///
 /// For more information on formatters, see [the module-level documentation][module].
 ///
 /// [module]: ../index.html
@@ -480,6 +519,7 @@ pub trait Binary {
 /// let x = 42; // 42 is '2a' in hex
 ///
 /// assert_eq!(format!("{:x}", x), "2a");
+/// assert_eq!(format!("{:#x}", x), "0x2a");
 /// ```
 ///
 /// Implementing `LowerHex` on a type:
@@ -513,6 +553,8 @@ pub trait LowerHex {
 /// The `UpperHex` trait should format its output as a number in hexidecimal, with `A` through `F`
 /// in upper case.
 ///
+/// The alternate flag, `#`, adds a `0x` in front of the output.
+///
 /// For more information on formatters, see [the module-level documentation][module].
 ///
 /// [module]: ../index.html
@@ -525,6 +567,7 @@ pub trait LowerHex {
 /// let x = 42; // 42 is '2A' in hex
 ///
 /// assert_eq!(format!("{:X}", x), "2A");
+/// assert_eq!(format!("{:#X}", x), "0x2A");
 /// ```
 ///
 /// Implementing `UpperHex` on a type:
diff --git a/src/libcore/slice.rs b/src/libcore/slice.rs
index a8c995f37cc..797f9c36872 100644
--- a/src/libcore/slice.rs
+++ b/src/libcore/slice.rs
@@ -1368,10 +1368,14 @@ pub fn mut_ref_slice<'a, A>(s: &'a mut A) -> &'a mut [A] {
 ///
 /// The `len` argument is the number of **elements**, not the number of bytes.
 ///
+/// # Unsafety
+///
 /// This function is unsafe as there is no guarantee that the given pointer is
 /// valid for `len` elements, nor whether the lifetime inferred is a suitable
 /// lifetime for the returned slice.
 ///
+/// `p` must be non-null, even for zero-length slices.
+///
 /// # Caveat
 ///
 /// The lifetime for the returned slice is inferred from its usage. To
diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs
index 5d10b0d9a57..0ec3979ccfb 100644
--- a/src/librustc_resolve/lib.rs
+++ b/src/librustc_resolve/lib.rs
@@ -1844,11 +1844,6 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
                         visit::walk_ty_param_bounds_helper(this, bounds);
 
                         for trait_item in trait_items {
-                            // Create a new rib for the trait_item-specific type
-                            // parameters.
-                            //
-                            // FIXME #4951: Do we need a node ID here?
-
                             match trait_item.node {
                                 ast::ConstTraitItem(_, ref default) => {
                                     // Only impose the restrictions of
diff --git a/src/libstd/io/buffered.rs b/src/libstd/io/buffered.rs
index 1d0152e2751..d389a0be117 100644
--- a/src/libstd/io/buffered.rs
+++ b/src/libstd/io/buffered.rs
@@ -21,7 +21,7 @@ use io::{self, DEFAULT_BUF_SIZE, Error, ErrorKind, SeekFrom};
 use ptr;
 use iter;
 
-/// Wraps a `Read` and buffers input from it
+/// Wraps a `Read` and buffers input from it.
 ///
 /// It can be excessively inefficient to work directly with a `Read` instance.
 /// For example, every call to `read` on `TcpStream` results in a system call.
@@ -54,13 +54,13 @@ pub struct BufReader<R> {
 }
 
 impl<R: Read> BufReader<R> {
-    /// Creates a new `BufReader` with a default buffer capacity
+    /// Creates a new `BufReader` with a default buffer capacity.
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn new(inner: R) -> BufReader<R> {
         BufReader::with_capacity(DEFAULT_BUF_SIZE, inner)
     }
 
-    /// Creates a new `BufReader` with the specified buffer capacity
+    /// Creates a new `BufReader` with the specified buffer capacity.
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn with_capacity(cap: usize, inner: R) -> BufReader<R> {
         let mut buf = Vec::with_capacity(cap);
@@ -183,7 +183,7 @@ impl<R: Seek> Seek for BufReader<R> {
     }
 }
 
-/// Wraps a Writer and buffers output to it
+/// Wraps a Writer and buffers output to it.
 ///
 /// It can be excessively inefficient to work directly with a `Write`. For
 /// example, every call to `write` on `TcpStream` results in a system call. A
@@ -205,13 +205,13 @@ pub struct BufWriter<W: Write> {
 pub struct IntoInnerError<W>(W, Error);
 
 impl<W: Write> BufWriter<W> {
-    /// Creates a new `BufWriter` with a default buffer capacity
+    /// Creates a new `BufWriter` with a default buffer capacity.
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn new(inner: W) -> BufWriter<W> {
         BufWriter::with_capacity(DEFAULT_BUF_SIZE, inner)
     }
 
-    /// Creates a new `BufWriter` with the specified buffer capacity
+    /// Creates a new `BufWriter` with the specified buffer capacity.
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn with_capacity(cap: usize, inner: W) -> BufWriter<W> {
         BufWriter {
@@ -253,11 +253,11 @@ impl<W: Write> BufWriter<W> {
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn get_ref(&self) -> &W { self.inner.as_ref().unwrap() }
 
-    /// Gets a mutable reference to the underlying write.
+    /// Gets a mutable reference to the underlying writer.
     ///
     /// # Warning
     ///
-    /// It is inadvisable to directly read from the underlying writer.
+    /// It is inadvisable to directly write to the underlying writer.
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn get_mut(&mut self) -> &mut W { self.inner.as_mut().unwrap() }
 
diff --git a/src/test/run-make/execution-engine/Makefile b/src/test/run-make/execution-engine/Makefile
index 387905f45d8..ef646c5bf5d 100644
--- a/src/test/run-make/execution-engine/Makefile
+++ b/src/test/run-make/execution-engine/Makefile
@@ -1,8 +1,14 @@
 -include ../tools.mk
 
+# FIXME: ignore freebsd
 # This is a basic test of LLVM ExecutionEngine functionality using compiled
 # Rust code built using the `rustc` crate.
 
+ifneq ($(shell uname),FreeBSD)
 all:
 	$(RUSTC) test.rs
 	$(call RUN,test $(RUSTC))
+else
+all:
+
+endif