Return-position noalias
· Issue #385 · rust-lang/unsafe-code-guidelines (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Description
LLVM supports the noalias
attribute in return position, and Rust uses that for functions that return Box
. However the semantics of that are mostly unclear I think -- this has very little to do with argument-position noalias
.
I think in Stacked Borrows terms it corresponds to something like: give the return value a fresh tag, and remove all other tags from the stack.
Questions:
- Is that the right semantics?
- Should there be some way to get return-position
noalias
without usingBox
? @gnzlbg recently mentioned a usecase for that.