diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2014-05-14 21:01:21 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2014-05-16 11:41:27 -0700 |
| commit | 67e39a8e7686bd33b9a8fbfc926f619029a33ac0 (patch) | |
| tree | 5951a3335b0bafb1b0919357ee07f6a68d7c7d4f | |
| parent | ce11f19695f0615bdb9de3702519920584c6102d (diff) | |
| download | rust-67e39a8e7686bd33b9a8fbfc926f619029a33ac0.tar.gz rust-67e39a8e7686bd33b9a8fbfc926f619029a33ac0.zip | |
libfmt_macros: Remove all uses of `~str` from `libfmt_macros`
| -rw-r--r-- | src/libfmt_macros/lib.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/ext/format.rs | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/libfmt_macros/lib.rs b/src/libfmt_macros/lib.rs index 2151e535480..e12026340d8 100644 --- a/src/libfmt_macros/lib.rs +++ b/src/libfmt_macros/lib.rs @@ -203,7 +203,7 @@ pub struct Parser<'a> { cur: str::CharOffsets<'a>, depth: uint, /// Error messages accumulated during parsing - pub errors: Vec<~str>, + pub errors: Vec<StrBuf>, } impl<'a> Iterator<Piece<'a>> for Parser<'a> { @@ -246,10 +246,10 @@ impl<'a> Parser<'a> { } /// Notifies of an error. The message doesn't actually need to be of type - /// ~str, but I think it does when this eventually uses conditions so it + /// StrBuf, but I think it does when this eventually uses conditions so it /// might as well start using it now. fn err(&mut self, msg: &str) { - self.errors.push(msg.to_owned()); + self.errors.push(msg.to_strbuf()); } /// Optionally consumes the specified character. If the character is not at diff --git a/src/libsyntax/ext/format.rs b/src/libsyntax/ext/format.rs index e92ce139d00..01124fdfa54 100644 --- a/src/libsyntax/ext/format.rs +++ b/src/libsyntax/ext/format.rs @@ -886,7 +886,9 @@ pub fn expand_preparsed_format_args(ecx: &mut ExtCtxt, sp: Span, } match parser.errors.shift() { Some(error) => { - cx.ecx.span_err(efmt.span, "invalid format string: " + error); + cx.ecx.span_err(efmt.span, + format_strbuf!("invalid format string: {}", + error).as_slice()); return DummyResult::raw_expr(sp); } None => {} |
