Skip to content

[WIP] str is dead, long live str([u8])! #19612

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 39 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
681bbd3
librustc: add "str" lang item
Dec 4, 2014
f63b8e4
librustc: use "str" lang item in `mk_str`/`mk_str_slice`
Dec 5, 2014
5c73c5d
librustc[_trans]: fix fallout of changing `mk_str_slice` signature
Dec 5, 2014
c977921
librustc: add `is_str` utility function
Dec 5, 2014
c00d178
librustc: kill `ty_str`
Dec 5, 2014
b00cc6b
librustc_trans: kill `ty_str`
Dec 5, 2014
b4b2551
libsyntax: kill `TyStr`
Dec 5, 2014
10b2f55
librustc: kill `TyStr`
Dec 5, 2014
a55ae0e
libsyntax: use the full path of `str` in `format_args!`
Dec 5, 2014
2727aa1
libcore: use full path of `str` in `panic!` macro
Dec 5, 2014
52cae4c
libcore: make `str` a library type
Dec 5, 2014
6e5f5d9
libunicode: fix fallout
Dec 5, 2014
8608ac7
librand: fix fallout
Dec 5, 2014
8ad9238
libcollections: fix fallout
Dec 5, 2014
be8c54c
librustrt: fix fallout
Dec 5, 2014
31a3b28
libstd: use full path of `str` in `panic!` macro
Dec 5, 2014
e373977
libstd: fix fallout
Dec 5, 2014
005cdb7
libfmt_macros: fix fallout
Dec 5, 2014
54c55cf
libserialize: fix fallout
Dec 5, 2014
7f6b844
librbml: fix fallout
Dec 5, 2014
adab4be
libsyntax: fix fallout
Dec 5, 2014
bd7ccae
librustc_back: fix fallout
Dec 6, 2014
1174f1c
librustc: fix fallout
Dec 6, 2014
d3d5374
librustc_trans: fix fallout
Dec 6, 2014
99fb6c1
librustdoc: kill `ty_str` and `TyStr`
Dec 6, 2014
d11d28d
librustdoc: fix fallout
Dec 6, 2014
ca8649f
compiletest: fix fallout
Dec 6, 2014
c73df95
Fix run-pass tests
Dec 6, 2014
fd0a965
FIXME I broke run-pass/unsized3
Dec 6, 2014
c373b72
Fix compile-fail tests
Dec 6, 2014
ce37ad9
libstd: fix unit tests
Dec 6, 2014
47fb373
libcollections: fix unit tests
Dec 6, 2014
d49859f
libgraphviz: fix unit tests
Dec 6, 2014
702031c
libsyntax: fix unit tests
Dec 6, 2014
de8d4a4
libserialize: fix doc tests
Dec 6, 2014
f53120d
Fix bench
Dec 6, 2014
7620208
Fix guides
Dec 6, 2014
80ca6e5
Fix pretty test
Dec 6, 2014
cebddbb
libstd: fix fallout
Dec 6, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
librustdoc: fix fallout
  • Loading branch information
Jorge Aparicio committed Dec 6, 2014
commit d11d28da99fe49f1659e351d3e55cc7be5d66eb7
12 changes: 6 additions & 6 deletions src/librustdoc/html/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use std::ascii::AsciiExt;
use std::cell::{RefCell, Cell};
use std::fmt;
use std::slice;
use std::str;
use std::str as str_;
use std::collections::HashMap;

use html::toc::TocBuilder;
Expand Down Expand Up @@ -166,14 +166,14 @@ pub fn render(w: &mut fmt::Formatter, s: &str, print_toc: bool) -> fmt::Result {
let my_opaque: &MyOpaque = &*((*opaque).opaque as *const MyOpaque);
let text = slice::from_raw_buf(&(*orig_text).data,
(*orig_text).size as uint);
let origtext = str::from_utf8(text).unwrap();
let origtext = str_::from_utf8(text).unwrap();
debug!("docblock: ==============\n{}\n=======", text);
let rendered = if lang.is_null() {
false
} else {
let rlang = slice::from_raw_buf(&(*lang).data,
(*lang).size as uint);
let rlang = str::from_utf8(rlang).unwrap();
let rlang = str_::from_utf8(rlang).unwrap();
if LangString::parse(rlang).notrust {
(my_opaque.dfltblk)(ob, orig_text, lang,
opaque as *mut libc::c_void);
Expand Down Expand Up @@ -317,14 +317,14 @@ pub fn find_testable_code(doc: &str, tests: &mut ::test::Collector) {
} else {
let lang = slice::from_raw_buf(&(*lang).data,
(*lang).size as uint);
let s = str::from_utf8(lang).unwrap();
let s = str_::from_utf8(lang).unwrap();
LangString::parse(s)
};
if block_info.notrust { return }
let text = slice::from_raw_buf(&(*text).data, (*text).size as uint);
let opaque = opaque as *mut hoedown_html_renderer_state;
let tests = &mut *((*opaque).opaque as *mut ::test::Collector);
let text = str::from_utf8(text).unwrap();
let text = str_::from_utf8(text).unwrap();
let lines = text.lines().map(|l| {
stripped_filtered_line(l).unwrap_or(l)
});
Expand All @@ -345,7 +345,7 @@ pub fn find_testable_code(doc: &str, tests: &mut ::test::Collector) {
tests.register_header("", level as u32);
} else {
let text = slice::from_raw_buf(&(*text).data, (*text).size as uint);
let text = str::from_utf8(text).unwrap();
let text = str_::from_utf8(text).unwrap();
tests.register_header(text, level as u32);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/librustdoc/html/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ use std::fmt;
use std::io::fs::PathExtensions;
use std::io::{fs, File, BufferedWriter, BufferedReader};
use std::io;
use std::str;
use std::str as str_;
use std::string::String;
use std::sync::Arc;

Expand Down Expand Up @@ -739,7 +739,7 @@ impl<'a> SourceCollector<'a> {
filename.ends_with("macros>") => return Ok(()),
Err(e) => return Err(e)
};
let contents = str::from_utf8(contents.as_slice()).unwrap();
let contents = str_::from_utf8(contents.as_slice()).unwrap();

// Remove the utf-8 BOM if any
let contents = if contents.starts_with("\ufeff") {
Expand Down
4 changes: 2 additions & 2 deletions src/librustdoc/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use std::dynamic_lib::DynamicLibrary;
use std::io::{Command, TempDir};
use std::io;
use std::os;
use std::str;
use std::str as str_;
use std::string::String;

use std::collections::{HashSet, HashMap};
Expand Down Expand Up @@ -198,7 +198,7 @@ fn runtest(test: &str, cratename: &str, libs: Vec<Path>, externs: core::Externs,
panic!("test executable succeeded when it should have failed");
} else if !should_fail && !out.status.success() {
panic!("test executable failed:\n{}",
str::from_utf8(out.error.as_slice()));
str_::from_utf8(out.error.as_slice()));
}
}
}
Expand Down