Skip to content
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

internal: Sync from downstream #16412

Merged
merged 9 commits into from
Jan 21, 2024
Merged

internal: Sync from downstream #16412

merged 9 commits into from
Jan 21, 2024

Conversation

lnicola
Copy link
Member

@lnicola lnicola commented Jan 21, 2024

No description provided.

nnethercote and others added 7 commits January 12, 2024 16:19
By making it an `EscapeError` instead of a `LitError`. This makes it
like the other errors produced when checking string literals contents,
e.g. for invalid escape sequences or bare CR chars.

NOTE: this means these errors are issued earlier, before expansion,
which changes behaviour. It will be possible to move the check back to
the later point if desired. If that happens, it's likely that all the
string literal contents checks will be delayed together.

One nice thing about this: the old approach had some code in
`report_lit_error` to calculate the span of the nul char from a range.
This code used a hardwired `+2` to account for the `c"` at the start of
a C string literal, but this should have changed to a `+3` for raw C
string literals to account for the `cr"`, which meant that the caret in
`cr"` nul error messages was one short of where it should have been. The
new approach doesn't need any of this and avoids the off-by-one error.
Starting from cargo#13311, Cargo's compiler artifact message
uses Package ID specification as package's identifier format.
Detect `NulInCStr` error earlier.

By making it an `EscapeError` instead of a `LitError`. This makes it like the other errors produced when checking string literals contents, e.g. for invalid escape sequences or bare CR chars.

NOTE: this means these errors are issued earlier, before expansion, which changes behaviour. It will be possible to move the check back to the later point if desired. If that happens, it's likely that all the string literal contents checks will be delayed together.

One nice thing about this: the old approach had some code in `report_lit_error` to calculate the span of the nul char from a range. This code used a hardwired `+2` to account for the `c"` at the start of a C string literal, but this should have changed to a `+3` for raw C string literals to account for the `cr"`, which meant that the caret in `cr"` nul error messages was one short of where it should have been. The new approach doesn't need any of this and avoids the off-by-one error.

r? ```@fee1-dead```
fix(rust-analyzer): use new pkgid spec to compare

Starting from rust-lang/cargo#13311, Cargo's compiler artifact message
uses Package ID specification as package's identifier format.

Zulip topic: https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/proc-macro-test.20bootstrap.20and.20pkgid.20JSON

cc `@ehuss`
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 21, 2024
@lnicola
Copy link
Member Author

lnicola commented Jan 21, 2024

@bors r+

@bors
Copy link
Collaborator

bors commented Jan 21, 2024

📌 Commit ef6e6df has been approved by lnicola

It is now in the queue for this repository.

@lnicola
Copy link
Member Author

lnicola commented Jan 21, 2024

@bors r-

bors added a commit that referenced this pull request Jan 21, 2024
internal: Sync from downstream
@bors
Copy link
Collaborator

bors commented Jan 21, 2024

⌛ Testing commit ef6e6df with merge 1590cdb...

@lnicola
Copy link
Member Author

lnicola commented Jan 21, 2024

@bors r+

I've temporarily reverted 6001c50, will upgrade the auto-published crates and revert the revert next week.

@bors
Copy link
Collaborator

bors commented Jan 21, 2024

📌 Commit 0ea0565 has been approved by lnicola

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Jan 21, 2024

⌛ Testing commit 0ea0565 with merge 196facb...

bors added a commit that referenced this pull request Jan 21, 2024
@lnicola
Copy link
Member Author

lnicola commented Jan 21, 2024

@bors r-

@bors
Copy link
Collaborator

bors commented Jan 21, 2024

💔 Test failed - checks-actions

@lnicola
Copy link
Member Author

lnicola commented Jan 21, 2024

@bors r+

@bors
Copy link
Collaborator

bors commented Jan 21, 2024

📌 Commit 5607714 has been approved by lnicola

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Jan 21, 2024

⌛ Testing commit 5607714 with merge d410d4a...

@bors
Copy link
Collaborator

bors commented Jan 21, 2024

☀️ Test successful - checks-actions
Approved by: lnicola
Pushing d410d4a to master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants