Uh oh!
There was an error while loading. Please reload this page.
Distinguish delim kind to decide whether to emit unexpected closing delimiter - #138554
Conversation
rustbot
commented
Mar 16, 2025
rustbot has assigned @compiler-errors. Use |
compiler-errors
commented
Mar 21, 2025
r? compiler |
chenyukang
commented
Apr 7, 2025
I changed this part last year, will review this PR later. r? @chenyukang |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
chenyukang
commented
Apr 11, 2025
I think this solution introduces some kind of regression on other scenarios(such as the cases I commented). Maybe we should consider this as a special corner case and provide a special diagnostic for it, it is the pattern that one delimiter is missing the openning delimiter(it's in the inner part), except for this everything is ok, so we should suggest something like "missing openning delimiter ....". such as:
|
chenyukang
commented
Apr 11, 2025
@rustbot author |
rustbot
commented
Apr 11, 2025
Reminder, once the PR becomes ready for a review, use |
xizheyin
commented
Apr 11, 2025
Thanks, I will revise it soon! |
xizheyin
commented
Apr 12, 2025
This seems like quite a lot of changes, I'll comment in the code to make it easier to REVIEW. In the first commit, I added the test. In the second commit I did some clean. I changed a variable name, the original name was inaccurate, I used In the third commit, I make a distinction between the different delimiters before triggering a |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
xizheyin
commented
Apr 15, 2025
I've combined them into one line so it's more aesthetically pleasing. Since the |
This comment has been minimized.
This comment has been minimized.
xizheyin
commented
Jul 18, 2025
This commit 0682e9e is for #138554 (comment). I use The last commit a1d2557 is for comment #138554 (comment). In all the cases, we should emit
Now, all the changes is
That's all we need. But the code needs some clean. If everything is Ok, I will clean the code and squash commits. 😃 |
xizheyin
commented
Jul 18, 2025
The last commit is necessary if one is in a conservative consideration, as #138401 seems to be just to address cases like, |
chenyukang
commented
Jul 18, 2025
I think we can remove those hint, since we reported mismatch above. |
xizheyin
commented
Jul 18, 2025
Ok, I'll revise it later. |
xizheyin
commented
Jul 18, 2025
But I have a concern that we only reported what went wrong in the mismatched error, but we didn't mention how to correct it. I think this hint complements this. If you think it should be removed, I will remove the last commit later. |
chenyukang
commented
Jul 18, 2025
for a mismatched scenario, the hint is not complementing it:
perfer to remove it. |
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
Make sense! I removed it. And I cleaned the code, and squashed them to 2 commits. Now, it should be what we want! |
chenyukang
commented
Jul 18, 2025
Thanks! @bors r=chenyukang |
bors
commented
Jul 18, 2025
xizheyin
commented
Jul 18, 2025
Thank you for your patient guidance! :) |
Distinguish delim kind to decide whether to emit unexpected closing delimiter Fixesrust-lang#138401
Rollup of 9 pull requests Successful merges: - #138554 (Distinguish delim kind to decide whether to emit unexpected closing delimiter) - #142673 (Show the offset, length and memory of uninit read errors) - #142693 (More robustly deal with relaxed bounds and improve their diagnostics) - #143382 (stabilize `const_slice_reverse`) - #143928 (opt-dist: make llvm builds optional) - #143961 (Correct which exploit mitigations are enabled by default) - #144050 (Fix encoding of link_section and no_mangle cross crate) - #144059 (Refactor `CrateLoader` into the `CStore`) - #144123 (Generalize `unsize` and `unsize_into` destinations) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 9 pull requests Successful merges: - #138554 (Distinguish delim kind to decide whether to emit unexpected closing delimiter) - #142673 (Show the offset, length and memory of uninit read errors) - #142693 (More robustly deal with relaxed bounds and improve their diagnostics) - #143382 (stabilize `const_slice_reverse`) - #143928 (opt-dist: make llvm builds optional) - #143961 (Correct which exploit mitigations are enabled by default) - #144050 (Fix encoding of link_section and no_mangle cross crate) - #144059 (Refactor `CrateLoader` into the `CStore`) - #144123 (Generalize `unsize` and `unsize_into` destinations) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 9 pull requests Successful merges: - #138554 (Distinguish delim kind to decide whether to emit unexpected closing delimiter) - #142673 (Show the offset, length and memory of uninit read errors) - #142693 (More robustly deal with relaxed bounds and improve their diagnostics) - #143382 (stabilize `const_slice_reverse`) - #143928 (opt-dist: make llvm builds optional) - #143961 (Correct which exploit mitigations are enabled by default) - #144050 (Fix encoding of link_section and no_mangle cross crate) - #144059 (Refactor `CrateLoader` into the `CStore`) - #144123 (Generalize `unsize` and `unsize_into` destinations) r? `@ghost` `@rustbot` modify labels: rollup
Uh oh!
There was an error while loading. Please reload this page.
Rollup of 9 pull requests Successful merges: - rust-lang/rust#138554 (Distinguish delim kind to decide whether to emit unexpected closing delimiter) - rust-lang/rust#142673 (Show the offset, length and memory of uninit read errors) - rust-lang/rust#142693 (More robustly deal with relaxed bounds and improve their diagnostics) - rust-lang/rust#143382 (stabilize `const_slice_reverse`) - rust-lang/rust#143928 (opt-dist: make llvm builds optional) - rust-lang/rust#143961 (Correct which exploit mitigations are enabled by default) - rust-lang/rust#144050 (Fix encoding of link_section and no_mangle cross crate) - rust-lang/rust#144059 (Refactor `CrateLoader` into the `CStore`) - rust-lang/rust#144123 (Generalize `unsize` and `unsize_into` destinations) r? `@ghost` `@rustbot` modify labels: rollup
Distinguish delim kind to decide whether to emit unexpected closing delimiter Fixesrust-lang#138401
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#138554 (Distinguish delim kind to decide whether to emit unexpected closing delimiter) - rust-lang#142673 (Show the offset, length and memory of uninit read errors) - rust-lang#142693 (More robustly deal with relaxed bounds and improve their diagnostics) - rust-lang#143382 (stabilize `const_slice_reverse`) - rust-lang#143928 (opt-dist: make llvm builds optional) - rust-lang#143961 (Correct which exploit mitigations are enabled by default) - rust-lang#144050 (Fix encoding of link_section and no_mangle cross crate) - rust-lang#144059 (Refactor `CrateLoader` into the `CStore`) - rust-lang#144123 (Generalize `unsize` and `unsize_into` destinations) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 9 pull requests Successful merges: - rust-lang/rust#138554 (Distinguish delim kind to decide whether to emit unexpected closing delimiter) - rust-lang/rust#142673 (Show the offset, length and memory of uninit read errors) - rust-lang/rust#142693 (More robustly deal with relaxed bounds and improve their diagnostics) - rust-lang/rust#143382 (stabilize `const_slice_reverse`) - rust-lang/rust#143928 (opt-dist: make llvm builds optional) - rust-lang/rust#143961 (Correct which exploit mitigations are enabled by default) - rust-lang/rust#144050 (Fix encoding of link_section and no_mangle cross crate) - rust-lang/rust#144059 (Refactor `CrateLoader` into the `CStore`) - rust-lang/rust#144123 (Generalize `unsize` and `unsize_into` destinations) r? `@ghost` `@rustbot` modify labels: rollup
Fixes#138401