diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2014-05-05 18:56:44 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2014-05-06 23:12:54 -0700 |
| commit | 090040bf4037a094e50b03d79e4baf5cd89c912b (patch) | |
| tree | 27fa91d623889d59260d3db167abdfa8c4288849 /src/libstd/fmt | |
| parent | 24f6f26e633e50b5b59f9d0f6cca0b1e49e215d9 (diff) | |
| download | rust-090040bf4037a094e50b03d79e4baf5cd89c912b.tar.gz rust-090040bf4037a094e50b03d79e4baf5cd89c912b.zip | |
librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, except
for `~str`/`~[]`. Note that `~self` still remains, since I forgot to add support for `Box<self>` before the snapshot. How to update your code: * Instead of `~EXPR`, you should write `box EXPR`. * Instead of `~TYPE`, you should write `Box<Type>`. * Instead of `~PATTERN`, you should write `box PATTERN`. [breaking-change]
Diffstat (limited to 'src/libstd/fmt')
| -rw-r--r-- | src/libstd/fmt/mod.rs | 3 | ||||
| -rw-r--r-- | src/libstd/fmt/parse.rs | 9 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/libstd/fmt/mod.rs b/src/libstd/fmt/mod.rs index e225dc42e05..38456e195e3 100644 --- a/src/libstd/fmt/mod.rs +++ b/src/libstd/fmt/mod.rs @@ -492,6 +492,7 @@ use io; use iter::{Iterator, range}; use num::Signed; use option::{Option,Some,None}; +use owned::Box; use repr; use result::{Ok, Err}; use str::StrSlice; @@ -1113,7 +1114,7 @@ pub fn argumentuint<'a>(s: &'a uint) -> Argument<'a> { impl<T: Show> Show for @T { fn fmt(&self, f: &mut Formatter) -> Result { secret_show(&**self, f) } } -impl<T: Show> Show for ~T { +impl<T: Show> Show for Box<T> { fn fmt(&self, f: &mut Formatter) -> Result { secret_show(&**self, f) } } impl<'a, T: Show> Show for &'a T { diff --git a/src/libstd/fmt/parse.rs b/src/libstd/fmt/parse.rs index 0ba8cff742b..ba126e00153 100644 --- a/src/libstd/fmt/parse.rs +++ b/src/libstd/fmt/parse.rs @@ -17,6 +17,7 @@ use prelude::*; use char; +use owned::Box; use str; /// A piece is a portion of the format string which represents the next part @@ -41,7 +42,7 @@ pub struct Argument<'a> { /// How to format the argument pub format: FormatSpec<'a>, /// If not `None`, what method to invoke on the argument - pub method: Option<~Method<'a>> + pub method: Option<Box<Method<'a>>> } /// Specification for the formatting of an argument in the format string. @@ -435,7 +436,7 @@ impl<'a> Parser<'a> { /// Parses a method to be applied to the previously specified argument and /// its format. The two current supported methods are 'plural' and 'select' - fn method(&mut self) -> Option<~Method<'a>> { + fn method(&mut self) -> Option<Box<Method<'a>>> { if !self.wsconsume(',') { return None; } @@ -461,7 +462,7 @@ impl<'a> Parser<'a> { } /// Parses a 'select' statement (after the initial 'select' word) - fn select(&mut self) -> ~Method<'a> { + fn select(&mut self) -> Box<Method<'a>> { let mut other = None; let mut arms = vec!(); // Consume arms one at a time @@ -503,7 +504,7 @@ impl<'a> Parser<'a> { } /// Parses a 'plural' statement (after the initial 'plural' word) - fn plural(&mut self) -> ~Method<'a> { + fn plural(&mut self) -> Box<Method<'a>> { let mut offset = None; let mut other = None; let mut arms = vec!(); |
