Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add back noalias to &mut parameters #12436

Closed
thestinger opened this issue Feb 21, 2014 · 0 comments · Fixed by #13935
Closed

add back noalias to &mut parameters #12436

thestinger opened this issue Feb 21, 2014 · 0 comments · Fixed by #13935
Labels
I-slow Issue: Problems and improvements with respect to performance of generated code.

Comments

@thestinger
Copy link
Contributor

This is blocked on #12429, at least when it comes to function signatures. Since @mut T and &const T are gone, there are currently never aliases of an &mut T parameter in sound code.

bors added a commit that referenced this issue May 5, 2014
This was removed because these could alias with `&const T` or `@mut T`
and those are now gone from the language. There are still aliasing
issues within local scopes, but this is correct for function parameters.

This also removes the no-op `noalias` marker on proc (not a pointer) and
leaves out the mention of #6750 because real type-based alias analysis
is not within the scope of best effort usage of the `noalias` attribute.

Test case:

    pub fn foo(x: &mut &mut u32) {
        **x = 5;
        **x = 5;
    }

Before:

    define void @_ZN3foo20h0ce94c9671b0150bdaa4v0.0E(i32** nocapture readonly) unnamed_addr #0 {
    entry-block:
      %1 = load i32** %0, align 8
      store i32 5, i32* %1, align 4
      %2 = load i32** %0, align 8
      store i32 5, i32* %2, align 4
      ret void
    }

After:

    define void @_ZN3foo20h0ce94c9671b0150bdaa4v0.0E(i32** noalias nocapture readonly) unnamed_addr #0 {
    entry-block:
      %1 = load i32** %0, align 8
      store i32 5, i32* %1, align 4
      ret void
    }

Closes #12436
lnicola pushed a commit to lnicola/rust that referenced this issue Aug 9, 2022
…ace, r=Veykril

Error Diagnostics appear in the wrong place

Fix rust-lang#12436
flip1995 pushed a commit to flip1995/rust that referenced this issue Apr 4, 2024
don't lint [`mixed_attributes_style`] when mixing docs and other attrs

add test files for issue rust-lang#12436

move [`mixed_attributes_style`] to `LateLintPass` to enable global `allow`

stop [`mixed_attributes_style`] from linting on different attributes

add `@compile-flags` to [`mixed_attributes_style`]'s test;

turns out not linting in test mod is not a FN.

Apply suggestions from code review

Co-authored-by: Timo <30553356+y21@users.noreply.github.com>

move [`mixed_attributes_style`] to late pass and stop it from linting on different kind of attributes
flip1995 pushed a commit to flip1995/rust that referenced this issue Apr 4, 2024
don't lint [`mixed_attributes_style`] when mixing docs and other attrs

fixes: rust-lang#12435
fixes: rust-lang#12436
fixes: rust-lang#12530

---

changelog: don't lint [`mixed_attributes_style`] when mixing different kind of attrs; and move it to late pass;
flip1995 pushed a commit to flip1995/rust that referenced this issue Apr 25, 2024
don't lint [`mixed_attributes_style`] when mixing docs and other attrs

fixes: rust-lang#12435
fixes: rust-lang#12436
fixes: rust-lang#12530

---

changelog: don't lint [`mixed_attributes_style`] when mixing different kind of attrs; and move it to late pass;
flip1995 pushed a commit to flip1995/rust that referenced this issue Apr 25, 2024
don't lint [`mixed_attributes_style`] when mixing docs and other attrs

fixes: rust-lang#12435
fixes: rust-lang#12436
fixes: rust-lang#12530

---

changelog: don't lint [`mixed_attributes_style`] when mixing different kind of attrs; and move it to late pass;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-slow Issue: Problems and improvements with respect to performance of generated code.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant