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

Unify const-checking structured errors for &mut and &raw mut #77420

Merged
merged 2 commits into from
Oct 22, 2020

Conversation

ecstatic-morse
Copy link
Contributor

@ecstatic-morse ecstatic-morse commented Oct 1, 2020

Resolves #77414 as well as a FIXME.

@rust-highfive
Copy link
Collaborator

r? @davidtwco

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 1, 2020
@ecstatic-morse ecstatic-morse force-pushed the const-checking-raw-mut-ref branch from f64ec95 to c1494d6 Compare October 1, 2020 18:22
@camelid camelid added the A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html label Oct 1, 2020
@@ -1,14 +1,14 @@
#![feature(raw_ref_op)]

const A: () = { let mut x = 2; &raw mut x; }; //~ ERROR `&raw mut` is not allowed
const A: () = { let mut x = 2; &raw mut x; }; //~ mutable reference
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this test's annotations still have ERROR in them?

Suggested change
const A: () = { let mut x = 2; &raw mut x; }; //~ mutable reference
const A: () = { let mut x = 2; &raw mut x; }; //~ ERROR mutable reference

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was under the impression that it was required for the annotation.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's good to have but not a necessity iirc.

Copy link
Member

@davidtwco davidtwco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, r=me after resolving previous comment

@Dylan-DPC-zz
Copy link

@bors r=davidtwco

@bors
Copy link
Contributor

bors commented Oct 21, 2020

📌 Commit c1494d6 has been approved by davidtwco

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 21, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 22, 2020
Rollup of 10 pull requests

Successful merges:

 - rust-lang#77420 (Unify const-checking structured errors for `&mut` and `&raw mut`)
 - rust-lang#77554 (Support signed integers and `char` in v0 mangling)
 - rust-lang#77976 (Mark inout asm! operands as used in liveness pass)
 - rust-lang#78009 (Haiku: explicitly set CMAKE_SYSTEM_NAME when cross-compiling)
 - rust-lang#78084 (Greatly improve display for small mobile devices screens)
 - rust-lang#78155 (Fix two small issues in compiler/rustc_lint/src/types.rs)
 - rust-lang#78156 (Fixed build failure of `rustfmt`)
 - rust-lang#78172 (Add test case for rust-lang#77062)
 - rust-lang#78188 (Add tracking issue number for pin_static_ref)
 - rust-lang#78200 (Add `ControlFlow::is_{break,continue}` methods)

Failed merges:

r? `@ghost`
@bors bors merged commit 6245b95 into rust-lang:master Oct 22, 2020
@rustbot rustbot added this to the 1.49.0 milestone Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature const_mut_refs incorrectly suggested for the use of raw_mut! in static
7 participants