rollup merge of #21258: aturon/stab-3-index
Conflicts: src/libcore/ops.rs src/librustc_typeck/astconv.rs src/libstd/io/mem.rs src/libsyntax/parse/lexer/mod.rs
This commit is contained in:
commit
886c6f3534
59 changed files with 352 additions and 429 deletions
|
@ -29,7 +29,7 @@ impl<'a> fmt::Display for Escape<'a> {
|
|||
for (i, ch) in s.bytes().enumerate() {
|
||||
match ch as char {
|
||||
'<' | '>' | '&' | '\'' | '"' => {
|
||||
try!(fmt.write_str(pile_o_bits.slice(last, i)));
|
||||
try!(fmt.write_str(&pile_o_bits[last.. i]));
|
||||
let s = match ch as char {
|
||||
'>' => ">",
|
||||
'<' => "<",
|
||||
|
@ -46,7 +46,7 @@ impl<'a> fmt::Display for Escape<'a> {
|
|||
}
|
||||
|
||||
if last < s.len() {
|
||||
try!(fmt.write_str(pile_o_bits.slice_from(last)));
|
||||
try!(fmt.write_str(&pile_o_bits[last..]));
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
@ -146,7 +146,7 @@ extern {
|
|||
fn stripped_filtered_line<'a>(s: &'a str) -> Option<&'a str> {
|
||||
let trimmed = s.trim();
|
||||
if trimmed.starts_with("# ") {
|
||||
Some(trimmed.slice_from(2))
|
||||
Some(&trimmed[2..])
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
|
|
@ -749,7 +749,7 @@ impl<'a> SourceCollector<'a> {
|
|||
|
||||
// Remove the utf-8 BOM if any
|
||||
let contents = if contents.starts_with("\u{feff}") {
|
||||
contents.slice_from(3)
|
||||
&contents[3..]
|
||||
} else {
|
||||
contents
|
||||
};
|
||||
|
@ -1469,7 +1469,7 @@ fn full_path(cx: &Context, item: &clean::Item) -> String {
|
|||
fn shorter<'a>(s: Option<&'a str>) -> &'a str {
|
||||
match s {
|
||||
Some(s) => match s.find_str("\n\n") {
|
||||
Some(pos) => s.slice_to(pos),
|
||||
Some(pos) => &s[..pos],
|
||||
None => s,
|
||||
},
|
||||
None => ""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue