Uh oh!
There was an error while loading. Please reload this page.
Mark &mut parameters as noalias - #6742
Conversation
This marks `&mut` function arguments with the `noalias` attribute. Since the borrow checker enforces this property, this is worth doing. I'm not sure if the place I'm doing it in is ideal, but it generates the correct code. Closes#6350
brson
commented
May 26, 2013
Do we actually know that all &mut parameters are no-alias? This seems pretty unlikely to me. |
thestinger
commented
May 26, 2013
@brson: yes, LLVM's understanding of You're allowed to have other references to the memory before and after the function, and the function can create more references to the value from the pointer it's passed. Technically, |
brson
commented
May 26, 2013
@thestinger If all Rust code was safe and obeyed borrow semantics then this would be true, but there is plenty of unsafe code that mutates immutable pointers. Do all those unsafe blocks preserve the assumption that |
thestinger
commented
May 26, 2013
@brson: I don't think we'll be able to do this for immutable pointers for a long time - but I doubt there's anything breaking the rules for To break the rules, the function would need to have two borrowed pointer parameters with one or both being |
6743: Don't insert blank lines between doc attributes r=Veykril a=Veykril Fixesrust-lang#6742. Doc attributes should be concatenated via a single linebreak as written in the [rustdoc book](https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html). Also changed the loop to use an iterator to get rid of the `docs.trim_end_matches("\n\n").to_owned()` part using `Itertools::intersperse`. Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
This marks
&mutfunction arguments with thenoaliasattribute. Since the borrow checker enforces this property, this is worth doing.I'm not sure if the place I'm doing it in is ideal, but it generates the correct code.
Closes#6350