Skip to content

Commit

Permalink
Auto merge of #106371 - RalfJung:no-ret-position-noalias, r=nikic
Browse files Browse the repository at this point in the history
do not add noalias in return position

`noalias` as a return attribute in LLVM indicates that the returned pointer does not alias anything else that is reachable from the caller, *including things reachable before this function call*. This is clearly not the case with a function like `fn id(Box<T>) -> Box<T>`, so we cannot use this attribute.

Fixes rust-lang/unsafe-code-guidelines#385 (including an actual miscompilation that `@comex` managed to produce).
  • Loading branch information
bors committed Jan 3, 2023
2 parents 3cf246c + 9f6039a commit 8bc84fd
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 8bc84fd

Please sign in to comment.