rustc_borrowck: Stop suggesting the invalid syntax `&mut raw const` by Enselic · Pull Request #134244 · rust-lang/rust
rustbot
added
S-waiting-on-review
labels
Dec 13, 2024
rustbot
added
S-waiting-on-author
and removed S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.labels
Dec 13, 2024A legitimate suggestion would be to change from
&raw const val
to
&raw mut val
But until we have figured out how to make that happen we should at least
stop suggesting invalid syntax.
Enselic
changed the title
rustc_borrowck: Stop suggesting invalid syntax
rustc_borrowck: Stop suggesting the invalid syntax &mut raw const&mut raw const
bors
added
S-waiting-on-bors
and removed S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.labels
Dec 13, 2024matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request
Dec 13, 2024…=jieyouxu
rustc_borrowck: Stop suggesting the invalid syntax `&mut raw const`
A legitimate suggestion would be to change from
&raw const val
to
&raw mut val
But until we have figured out how to make that happen we should at least
stop suggesting invalid syntax.
I recommend review commit-by-commit.
Part of rust-lang#127562
This was referenced
Dec 13, 2024matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request
Dec 14, 2024…=jieyouxu
rustc_borrowck: Stop suggesting the invalid syntax `&mut raw const`
A legitimate suggestion would be to change from
&raw const val
to
&raw mut val
But until we have figured out how to make that happen we should at least
stop suggesting invalid syntax.
I recommend review commit-by-commit.
Part of rust-lang#127562
bors added a commit to rust-lang-ci/rust that referenced this pull request
Dec 14, 2024…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#134181 (Tweak multispan rendering to reduce output length) - rust-lang#134209 (validate `--skip` and `--exclude` paths) - rust-lang#134231 (rustdoc-search: fix mismatched path when parent re-exported twice) - rust-lang#134236 (crashes: more tests v2) - rust-lang#134240 (Only dist `llvm-objcopy` if llvm tools are enabled) - rust-lang#134244 (rustc_borrowck: Stop suggesting the invalid syntax `&mut raw const`) - rust-lang#134251 (A bunch of cleanups (part 2)) - rust-lang#134256 (Use a more precise span in placeholder_type_error_diag) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request
Dec 14, 2024Rollup merge of rust-lang#134244 - Enselic:no-mut-hint-for-raw-ref, r=jieyouxu rustc_borrowck: Stop suggesting the invalid syntax `&mut raw const` A legitimate suggestion would be to change from &raw const val to &raw mut val But until we have figured out how to make that happen we should at least stop suggesting invalid syntax. I recommend review commit-by-commit. Part of rust-lang#127562
Enselic
deleted the
no-mut-hint-for-raw-ref
branch
jhpratt added a commit to jhpratt/rust that referenced this pull request
Dec 17, 2024rustc_borrowck: Suggest changing `&raw const` to `&raw mut` if applicable Closes rust-lang#127562 For reference, here is the diff compared to the original error reported in that issue before rust-lang#134244 stopped suggesting the invalid syntax: ``` diff --git a/tests/ui/borrowck/no-invalid-mut-suggestion-for-raw-pointer-issue-127562.stderr b/tests/ui/borrowck/no-invalid-mut-suggestion-for-raw-pointer-issue-127562.stderr index 0da5d15..dbe834b 100644 --- a/tests/ui/borrowck/no-invalid-mut-suggestion-for-raw-pointer-issue-127562.stderr +++ b/tests/ui/borrowck/no-invalid-mut-suggestion-for-raw-pointer-issue-127562.stderr `@@` -6,8 +6,8 `@@` LL | unsafe { *ptr = 3; } | help: consider changing this to be a mutable pointer | -LL | let ptr = &mut raw const val; - | +++ +LL | let ptr = &raw mut val; + | ~~~ error: aborting due to 1 previous error ```
jhpratt added a commit to jhpratt/rust that referenced this pull request
Dec 17, 2024rustc_borrowck: Suggest changing `&raw const` to `&raw mut` if applicable Closes rust-lang#127562 For reference, here is the diff compared to the original error reported in that issue before rust-lang#134244 stopped suggesting the invalid syntax: ``` diff --git a/tests/ui/borrowck/no-invalid-mut-suggestion-for-raw-pointer-issue-127562.stderr b/tests/ui/borrowck/no-invalid-mut-suggestion-for-raw-pointer-issue-127562.stderr index 0da5d15..dbe834b 100644 --- a/tests/ui/borrowck/no-invalid-mut-suggestion-for-raw-pointer-issue-127562.stderr +++ b/tests/ui/borrowck/no-invalid-mut-suggestion-for-raw-pointer-issue-127562.stderr ``@@`` -6,8 +6,8 ``@@`` LL | unsafe { *ptr = 3; } | help: consider changing this to be a mutable pointer | -LL | let ptr = &mut raw const val; - | +++ +LL | let ptr = &raw mut val; + | ~~~ error: aborting due to 1 previous error ```
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request
Dec 17, 2024Rollup merge of rust-lang#134397 - Enselic:raw-mut, r=compiler-errors rustc_borrowck: Suggest changing `&raw const` to `&raw mut` if applicable Closes rust-lang#127562 For reference, here is the diff compared to the original error reported in that issue before rust-lang#134244 stopped suggesting the invalid syntax: ``` diff --git a/tests/ui/borrowck/no-invalid-mut-suggestion-for-raw-pointer-issue-127562.stderr b/tests/ui/borrowck/no-invalid-mut-suggestion-for-raw-pointer-issue-127562.stderr index 0da5d15..dbe834b 100644 --- a/tests/ui/borrowck/no-invalid-mut-suggestion-for-raw-pointer-issue-127562.stderr +++ b/tests/ui/borrowck/no-invalid-mut-suggestion-for-raw-pointer-issue-127562.stderr ``@@`` -6,8 +6,8 ``@@`` LL | unsafe { *ptr = 3; } | help: consider changing this to be a mutable pointer | -LL | let ptr = &mut raw const val; - | +++ +LL | let ptr = &raw mut val; + | ~~~ error: aborting due to 1 previous error ```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters