Skip to content

Commit 1c86021

Browse files
committed
---
yaml --- r: 73452 b: refs/heads/dist-snap c: f254d11 h: refs/heads/master v: v3
1 parent 6da16eb commit 1c86021

File tree

3 files changed

+16
-40
lines changed

3 files changed

+16
-40
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: d89a6ceb1b36e7460afece5b3392c8f24f7ef6ce
10+
refs/heads/dist-snap: f254d119eab514c91fbd6590fba821ec7a0bfd7f
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: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1694,7 +1694,20 @@ 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-
llvm::LLVMGetParam(cx.llfn, arg_n as c_uint)
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
16981711
}
16991712
})
17001713
}

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

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -451,32 +451,16 @@ 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-
458454
match copy doc.desc {
459455
Some(desc) => {
460-
ctxt.w.put_line(list_item_indent(fmt!("* `%s` - %s", sig, desc)));
456+
ctxt.w.put_line(fmt!("* `%s` - %s", sig, desc));
461457
}
462458
None => {
463459
ctxt.w.put_line(fmt!("* `%s`", sig));
464460
}
465461
}
466462
}
467463

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-
480464
fn write_trait(ctxt: &Ctxt, doc: doc::TraitDoc) {
481465
write_common(ctxt, doc.desc(), doc.sections());
482466
write_methods(ctxt, doc.methods);
@@ -823,9 +807,7 @@ mod test {
823807
assert!(str::contains(
824808
markdown,
825809
"\n\n#### Variants\n\
826-
\n\
827810
\n* `b` - test\
828-
\n\
829811
\n* `c` - test\n\n"));
830812
}
831813

@@ -835,24 +817,7 @@ mod test {
835817
assert!(str::contains(
836818
markdown,
837819
"\n\n#### Variants\n\
838-
\n\
839820
\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\
856821
\n* `c`\n\n"));
857822
}
858823

@@ -862,9 +827,7 @@ mod test {
862827
assert!(str::contains(
863828
markdown,
864829
"\n\n#### Variants\n\
865-
\n\
866830
\n* `b(int)`\
867-
\n\
868831
\n* `c(int)` - a\n\n"));
869832
}
870833

0 commit comments

Comments
 (0)