Add a detailed note for missing comma typo w/ FRU syntax#104504
Add a detailed note for missing comma typo w/ FRU syntax#104504bors merged 1 commit intorust-lang:masterfrom
Conversation
|
r? @lcnr (rustbot has picked a reviewer for you, use r? to override) |
|
cc @davidtwco, @compiler-errors, @JohnTitor, @estebank, @TaKO8Ki |
There was a problem hiding this comment.
"functional record update syntax" is pretty heavy on jargon (and this is an error beginners will regularly see). Google search for it turns up nothing unless you add Rust, in which case you get this RFC: https://rust-lang.github.io/rfcs/2528-type-changing-struct-update-syntax.html
There was a problem hiding this comment.
| hir_typeck_fru_expr2 = ... so this is interpreted as a `..` range expression, instead of functional record update syntax | |
| hir_typeck_fru_expr2 = ... so this is interpreted as a `..` range expression, instead of functional record update syntax, used to set the remaining fields of a struct |
There was a problem hiding this comment.
This part of the error message is already pretty long, and it doesn't wrap well -- if you're against the jargon, I would rather remove everything after instead of.
There was a problem hiding this comment.
I'm also not too keen on the duplication of "used to set the remaining fields of a struct" between the note and the suggestion's "to set the remaining fields"
There was a problem hiding this comment.
Hmm, I see your point! I think it's better left as is then.
There was a problem hiding this comment.
Maybe "struct update syntax"? I've heard that quite often when talking about FRU.
There was a problem hiding this comment.
As someone new to this part of the codebase, this line is unclear to me. What's s, and why do we filter it like this? Why 25?
There was a problem hiding this comment.
This is to avoid rendering very long expressions in "to set the remaining fields in $EXPR"
There was a problem hiding this comment.
25 is an arbitrary number.
There was a problem hiding this comment.
And is_control is to avoid rendering something like:
to set the remaining fields in `a
.b`
There was a problem hiding this comment.
Makes sense :) Perhaps leave a comment to this effect?
There was a problem hiding this comment.
Sure thing.
|
📌 Commit b85b47cfd6c17acf21c8e3d6de3f543f3dbef942 has been approved by It is now in the queue for this repository. |
|
@bors r- i still got some changes to make |
b85b47c to
bb0cb9a
Compare
|
@bors r=estebank |
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#101310 (Clarify and restrict when `{Arc,Rc}::get_unchecked_mut` is allowed.) - rust-lang#104461 (Fix building of `aarch64-pc-windows-gnullvm`) - rust-lang#104487 (update ntapi dep to remove future-incompat warning) - rust-lang#104504 (Add a detailed note for missing comma typo w/ FRU syntax) - rust-lang#104581 (rustdoc: remove unused JS IIFE from main.js) - rust-lang#104632 (avoid non-strict-provenance casts in libcore tests) - rust-lang#104634 (move core::arch into separate file) - rust-lang#104641 (replace unusual grammar) - rust-lang#104643 (add examples to chunks remainder methods. ) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Thanks to @pierwill for working on this with me!
Fixes #104373, perhaps @alice-i-cecile can comment on the new error for the example provided on that issue -- feedback is welcome.