Skip to content

Commit 8757974

Browse files
committed
---
yaml --- r: 60711 b: refs/heads/auto c: f254d11 h: refs/heads/master i: 60709: d09eff6 60707: 939b7d5 60703: 254be97 v: v3
1 parent 7b09177 commit 8757974

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
@@ -14,6 +14,6 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: d89a6ceb1b36e7460afece5b3392c8f24f7ef6ce
17+
refs/heads/auto: f254d119eab514c91fbd6590fba821ec7a0bfd7f
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1919
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c

branches/auto/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/auto/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)