Skip to content

Commit 6da16eb

Browse files
committed
---
yaml --- r: 73451 b: refs/heads/dist-snap c: d89a6ce h: refs/heads/master i: 73449: bf430e6 73447: b621ed7 v: v3
1 parent 9f6b448 commit 6da16eb

File tree

4 files changed

+65
-16
lines changed

4 files changed

+65
-16
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
99
refs/heads/incoming: b50030718cf28f2a5a81857a26b57442734fe854
10-
refs/heads/dist-snap: 2c2346e3d4f999b95a56444d978c3ea792828263
10+
refs/heads/dist-snap: d89a6ceb1b36e7460afece5b3392c8f24f7ef6ce
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/librustc/middle/trans/base.rs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1694,20 +1694,7 @@ pub fn create_llargs_for_fn_args(cx: fn_ctxt,
16941694
vec::from_fn(args.len(), |i| {
16951695
unsafe {
16961696
let arg_n = first_real_arg + i;
1697-
let arg = &args[i];
1698-
let llarg = llvm::LLVMGetParam(cx.llfn, arg_n as c_uint);
1699-
1700-
// Mark `&mut T` as no-alias, as the borrowck pass ensures it's true
1701-
match arg.ty.node {
1702-
ast::ty_rptr(_, mt) => {
1703-
if mt.mutbl == ast::m_mutbl {
1704-
llvm::LLVMAddAttribute(llarg, lib::llvm::NoAliasAttribute as c_uint);
1705-
}
1706-
}
1707-
_ => {}
1708-
}
1709-
1710-
llarg
1697+
llvm::LLVMGetParam(cx.llfn, arg_n as c_uint)
17111698
}
17121699
})
17131700
}

branches/dist-snap/src/librustdoc/markdown_pass.rs

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,16 +451,32 @@ fn write_variants(
451451
fn write_variant(ctxt: &Ctxt, doc: doc::VariantDoc) {
452452
assert!(doc.sig.is_some());
453453
let sig = (&doc.sig).get();
454+
455+
// space out list items so they all end up within paragraph elements
456+
ctxt.w.put_line(~"");
457+
454458
match copy doc.desc {
455459
Some(desc) => {
456-
ctxt.w.put_line(fmt!("* `%s` - %s", sig, desc));
460+
ctxt.w.put_line(list_item_indent(fmt!("* `%s` - %s", sig, desc)));
457461
}
458462
None => {
459463
ctxt.w.put_line(fmt!("* `%s`", sig));
460464
}
461465
}
462466
}
463467

468+
fn list_item_indent(item: &str) -> ~str {
469+
let mut indented = ~[];
470+
for str::each_line_any(item) |line| {
471+
indented.push(line);
472+
}
473+
474+
// separate markdown elements within `*` lists must be indented by four
475+
// spaces, or they will escape the list context. indenting everything
476+
// seems fine though.
477+
str::connect_slices(indented, "\n ")
478+
}
479+
464480
fn write_trait(ctxt: &Ctxt, doc: doc::TraitDoc) {
465481
write_common(ctxt, doc.desc(), doc.sections());
466482
write_methods(ctxt, doc.methods);
@@ -807,7 +823,9 @@ mod test {
807823
assert!(str::contains(
808824
markdown,
809825
"\n\n#### Variants\n\
826+
\n\
810827
\n* `b` - test\
828+
\n\
811829
\n* `c` - test\n\n"));
812830
}
813831

@@ -817,7 +835,24 @@ mod test {
817835
assert!(str::contains(
818836
markdown,
819837
"\n\n#### Variants\n\
838+
\n\
820839
\n* `b`\
840+
\n\
841+
\n* `c`\n\n"));
842+
}
843+
844+
#[test]
845+
fn should_write_variant_list_with_indent() {
846+
let markdown = render(
847+
~"enum a { #[doc = \"line 1\\n\\nline 2\"] b, c }");
848+
assert!(str::contains(
849+
markdown,
850+
"\n\n#### Variants\n\
851+
\n\
852+
\n* `b` - line 1\
853+
\n \
854+
\n line 2\
855+
\n\
821856
\n* `c`\n\n"));
822857
}
823858

@@ -827,7 +862,9 @@ mod test {
827862
assert!(str::contains(
828863
markdown,
829864
"\n\n#### Variants\n\
865+
\n\
830866
\n* `b(int)`\
867+
\n\
831868
\n* `c(int)` - a\n\n"));
832869
}
833870

branches/dist-snap/src/libstd/os.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,11 @@ pub fn mkdir_recursive(p: &Path, mode: c_int) -> bool {
675675
/// Lists the contents of a directory
676676
#[allow(non_implicitly_copyable_typarams)]
677677
pub fn list_dir(p: &Path) -> ~[~str] {
678+
if p.components.is_empty() && !p.is_absolute() {
679+
// Not sure what the right behavior is here, but this
680+
// prevents a bounds check failure later
681+
return ~[];
682+
}
678683
unsafe {
679684
#[cfg(target_os = "linux")]
680685
#[cfg(target_os = "android")]
@@ -1596,6 +1601,26 @@ mod tests {
15961601
}
15971602
}
15981603
1604+
#[test]
1605+
fn list_dir_empty_path() {
1606+
let dirs = os::list_dir(&Path(""));
1607+
assert!(dirs.is_empty());
1608+
}
1609+
1610+
#[test]
1611+
#[cfg(not(windows))]
1612+
fn list_dir_root() {
1613+
let dirs = os::list_dir(&Path("/"));
1614+
assert!(dirs.len() > 1);
1615+
}
1616+
#[test]
1617+
#[cfg(windows)]
1618+
fn list_dir_root() {
1619+
let dirs = os::list_dir(&Path("C:\\"));
1620+
assert!(dirs.len() > 1);
1621+
}
1622+
1623+
15991624
#[test]
16001625
fn path_is_dir() {
16011626
assert!((os::path_is_dir(&Path("."))));

0 commit comments

Comments
 (0)