-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Fix a span in parse_ty_bare_fn
.
#126724
Fix a span in parse_ty_bare_fn
.
#126724
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oof, yeah. Span handling in the parser can be very manual.
r? compiler-errors @bors r+ rollup |
Actually, wait. Please add a test lmao @bors r- |
Unless there's a good reason to believe that this test is impossible to create |
e9a5dae
to
c39b86a
Compare
@compiler-errors: the rust/compiler/rustc_resolve/src/late.rs Line 813 in 7a08f84
and the So the only way to test this would be with a Please note that I have also modified a comment in the updated version. |
@bors r+ |
…pan, r=compiler-errors Fix a span in `parse_ty_bare_fn`. It currently goes one token too far. Example: line 259 of `tests/ui/abi/compatibility.rs`: ``` test_abi_compatible!(fn_fn, fn(), fn(i32) -> i32); ``` This commit changes the span for the second element from `fn(),` to `fn()`, i.e. removes the extraneous comma. This doesn't affect any tests. I found it while debugging some other code. Not a big deal but an easy fix so I figure it worth doing. r? `@spastorino`
…mpiler-errors Rollup of 9 pull requests Successful merges: - rust-lang#126326 (Un-unsafe the `StableOrd` trait) - rust-lang#126618 (Mark assoc tys live only if the corresponding trait is live) - rust-lang#126724 (Fix a span in `parse_ty_bare_fn`.) - rust-lang#126746 (Deny `use<>` for RPITITs) - rust-lang#126868 (not use offset when there is not ends with brace) - rust-lang#126884 (Do not ICE when suggesting dereferencing closure arg) - rust-lang#126915 (Don't suggest awaiting in closure patterns) - rust-lang#126916 (Specify target specific linker for `riscv64gc-gnu` job) - rust-lang#126926 (Tweak a confusing comment in `create_match_candidates`) r? `@ghost` `@rustbot` modify labels: rollup
needs blessing: #126949 (comment) @bors r- |
It currently goes one token too far. Example: line 259 of `tests/ui/abi/compatibility.rs`: ``` test_abi_compatible!(fn_fn, fn(), fn(i32) -> i32); ``` This commit changes the span for the second element from `fn(),` to `fn()`, i.e. removes the extraneous comma.
c39b86a
to
cf0251d
Compare
Talk about serendipity: this incorrect span had no meaningful uses until @spastorino added one in #126758, a PR that came after this one! But now we can see the effect in the changed test output, so that's nice. @bors r=compiler-errors |
…pan, r=compiler-errors Fix a span in `parse_ty_bare_fn`. It currently goes one token too far. Example: line 259 of `tests/ui/abi/compatibility.rs`: ``` test_abi_compatible!(fn_fn, fn(), fn(i32) -> i32); ``` This commit changes the span for the second element from `fn(),` to `fn()`, i.e. removes the extraneous comma. This doesn't affect any tests. I found it while debugging some other code. Not a big deal but an easy fix so I figure it worth doing. r? `@spastorino`
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#126158 (Disallow setting some built-in cfg via set the command-line) - rust-lang#126724 (Fix a span in `parse_ty_bare_fn`.) - rust-lang#126812 (Rename `tcx` to `cx` in new solver generic code) - rust-lang#126879 (fix Drop items getting leaked in Filter::next_chunk) - rust-lang#126941 (Migrate `run-make/llvm-ident` to `rmake.rs`) - rust-lang#126954 (resolve: Tweak some naming around import ambiguities) - rust-lang#126968 (Don't ICE during RPITIT refinement checking for resolution errors after normalization) - rust-lang#126973 (Fix bad replacement for unsafe extern block suggestion) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#126724 (Fix a span in `parse_ty_bare_fn`.) - rust-lang#126812 (Rename `tcx` to `cx` in new solver generic code) - rust-lang#126879 (fix Drop items getting leaked in Filter::next_chunk) - rust-lang#126925 (Change E0369 to give note informations for foreign items.) - rust-lang#126938 (miri: make sure we can find link_section statics even for the local crate) - rust-lang#126954 (resolve: Tweak some naming around import ambiguities) - rust-lang#126964 (Migrate `lto-empty`, `invalid-so` and `issue-20626` `run-make` tests to rmake.rs) - rust-lang#126968 (Don't ICE during RPITIT refinement checking for resolution errors after normalization) - rust-lang#126971 (Bump black, ruff and platformdirs) - rust-lang#126973 (Fix bad replacement for unsafe extern block suggestion) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#126724 - nnethercote:fix-parse_ty_bare_fn-span, r=compiler-errors Fix a span in `parse_ty_bare_fn`. It currently goes one token too far. Example: line 259 of `tests/ui/abi/compatibility.rs`: ``` test_abi_compatible!(fn_fn, fn(), fn(i32) -> i32); ``` This commit changes the span for the second element from `fn(),` to `fn()`, i.e. removes the extraneous comma. This doesn't affect any tests. I found it while debugging some other code. Not a big deal but an easy fix so I figure it worth doing. r? ``@spastorino``
It currently goes one token too far.
Example: line 259 of
tests/ui/abi/compatibility.rs
:This commit changes the span for the second element from
fn(),
tofn()
, i.e. removes the extraneous comma.This doesn't affect any tests. I found it while debugging some other code. Not a big deal but an easy fix so I figure it worth doing.
r? @spastorino