Skip to content

const: don't ICE when encountering a mutable ref to immutable memory #130394

New issue

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

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

Already on GitHub? # to your account

Merged
merged 1 commit into from
Sep 16, 2024

Conversation

RalfJung
Copy link
Member

Turns out that this can actually happen -- thanks to @matthiaskrgr for producing a testcase. :)

Fixes #130392

@rustbot
Copy link
Collaborator

rustbot commented Sep 15, 2024

r? @pnkfelix

rustbot has assigned @pnkfelix.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 15, 2024
@rustbot
Copy link
Collaborator

rustbot commented Sep 15, 2024

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri

@@ -1,4 +1,3 @@
//@ stderr-per-bitwidth
Copy link
Member Author

Choose a reason for hiding this comment

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

This is unrelated to the PR, I just noticed there's no reason to have per-bitwidth error files here.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah there's a lot of silliness in our test annotations. Glad to have a random improvement like this ❤️

@saethlin
Copy link
Member

r? saethlin
@bors r+

@bors
Copy link
Collaborator

bors commented Sep 15, 2024

📌 Commit d4918df has been approved by saethlin

It is now in the queue for this repository.

@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 Sep 15, 2024
@bors
Copy link
Collaborator

bors commented Sep 15, 2024

☔ The latest upstream changes (presumably #130390) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 15, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 15, 2024
…iaskrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#129439 (Implement feature `string_from_utf8_lossy_owned` for lossy conversion from `Vec<u8>` to `String` methods)
 - rust-lang#129828 (miri: treat non-memory local variables properly for data race detection)
 - rust-lang#130110 (make dist vendoring configurable)
 - rust-lang#130293 (Fix lint levels not getting overridden by attrs on `Stmt` nodes)
 - rust-lang#130342 (interpret, miri: fix dealing with overflow during slice indexing and allocation)

Failed merges:

 - rust-lang#130394 (const: don't ICE when encountering a mutable ref to immutable memory)

r? `@ghost`
`@rustbot` modify labels: rollup
@RalfJung
Copy link
Member Author

@bors r=saethlin

@bors
Copy link
Collaborator

bors commented Sep 15, 2024

📌 Commit 7dfffe7 has been approved by saethlin

It is now in the queue for this repository.

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 15, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 15, 2024
…iaskrgr

Rollup of 3 pull requests

Successful merges:

 - rust-lang#130151 (Use a small runner for msvc-ext2 job)
 - rust-lang#130394 (const: don't ICE when encountering a mutable ref to immutable memory)
 - rust-lang#130409 (tests: more ice tests)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 62445f1 into rust-lang:master Sep 16, 2024
6 checks passed
@rustbot rustbot added this to the 1.83.0 milestone Sep 16, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Sep 16, 2024
Rollup merge of rust-lang#130394 - RalfJung:mut-ref-to-immut, r=saethlin

const: don't ICE when encountering a mutable ref to immutable memory

Turns out that this can actually happen -- thanks to `@matthiaskrgr` for producing a testcase. :)

Fixes rust-lang#130392
@RalfJung RalfJung deleted the mut-ref-to-immut branch September 21, 2024 07:12
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE: the static const safety checks accepted mutable references they should not have accepted
5 participants