diff options
| author | bors <bors@rust-lang.org> | 2014-11-26 12:02:16 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-11-26 12:02:16 +0000 |
| commit | 8fb027e398ef756b7b02a270ef0304be92e70f4d (patch) | |
| tree | e842ec33ca78ddc8223bdbfc0e6839f7d3643618 /src/libsyntax/parse/parser.rs | |
| parent | 61af40278909eb899f1bdfbb8c45d4e4fb3dad5d (diff) | |
| parent | 3293ab14e24d136d0482bb18afef577aebed251e (diff) | |
| download | rust-8fb027e398ef756b7b02a270ef0304be92e70f4d.tar.gz rust-8fb027e398ef756b7b02a270ef0304be92e70f4d.zip | |
auto merge of #19252 : japaric/rust/cow, r=aturon
- Add `IntoCow` trait, and put it in the prelude
- Add `is_owned`/`is_borrowed` methods to `Cow`
- Add `CowString`/`CowVec` type aliases (to `Cow<'_, String, str>`/`Cow<'_, Vec, [T]>` respectively)
- `Cow` implements: `Show`, `Hash`, `[Partial]{Eq,Ord}`
- `impl BorrowFrom<Cow<'a, T, B>> for B`
[breaking-change]s:
- `IntoMaybeOwned` has been removed from the prelude
- libcollections: `SendStr` is now an alias to `CowString<'static>` (it was aliased to `MaybeOwned<'static>`)
- libgraphviz:
- `LabelText` variants now wrap `CowString` instead of `MaybeOwned`
- `Nodes` and `Edges` are now type aliases to `CowVec` (they were aliased to `MaybeOwnedVec`)
- libstd/path: `Display::as_maybe_owned` has been renamed to `Display::as_cow` and now returns a `CowString`
- These functions now accept/return `Cow` instead of `MaybeOwned[Vector]`:
- libregex: `Replacer::reg_replace`
- libcollections: `str::from_utf8_lossy`
- libgraphviz: `Id::new`, `Id::name`, `LabelText::pre_escaped_content`
- libstd: `TaskBuilder::named`
r? @aturon
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index a9306c71240..c731a0005f8 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -4966,10 +4966,10 @@ impl<'a> Parser<'a> { let mut err = String::from_str("circular modules: "); let len = included_mod_stack.len(); for p in included_mod_stack.slice(i, len).iter() { - err.push_str(p.display().as_maybe_owned().as_slice()); + err.push_str(p.display().as_cow().as_slice()); err.push_str(" -> "); } - err.push_str(path.display().as_maybe_owned().as_slice()); + err.push_str(path.display().as_cow().as_slice()); self.span_fatal(id_sp, err.as_slice()); } None => () |
