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

Rollup of 8 pull requests #119864

Merged
merged 34 commits into from
Jan 11, 2024
Merged

Rollup of 8 pull requests #119864

merged 34 commits into from
Jan 11, 2024

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

klensy and others added 30 commits January 7, 2024 16:53
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
This is less elegant in some ways, since we no longer visit a BCB's spans as a
batch, but will make it much easier to add support for other kinds of coverage
mapping regions (e.g. branch regions or gap regions).
They have one and two call sites respectively, and they just make the
code harder to read.
Errors in `DiagCtxtInner::emit_diagnostic` are never set to
`Level::Bug`, because the condition never succeeds, because
`self.treat_err_as_bug()` is called *before* the error counts are
incremented.

This commit switches to `self.treat_next_err_as_bug()`, fixing the
problem. This changes the error message output to actually say "internal
compiler error".
No point computing `warnings` and `errors` if we're going to return
early before they're used.
… consideration.

It seems very wrong to have a `-Ztreat-err-as-bug` check here before the
error is even emitted.

Once that's done:
- `into_diagnostic` is infallible, so its return type doesn't need the
  `Option`;
- the `&'a DiagCtxt` also isn't needed, because only one callsite uses
  it, and it already have access to it via `self.dcx`;
- the comments about dcx disabling buffering are no longer true, this is
  unconditional now;
- and the `debug!` seems unnecessary... the comment greatly overstates
  its importance because few diagnostics come through `into_diagnostic`,
  and `-Ztrack-diagnostics` exists anyway.
Each of these has a single call site: `source_file_to_parser`,
`try_file_to_source_file`, `file_to_source_file`. Having them separate
just makes the code longer and harder to read.

Also, `maybe_file_to_stream` doesn't need to be `pub`.
It's a little more concise, and the standard way to do it.
This requires cancelling the "secondary" errors when they're not
emitted, to prevent panics due to unconsumed `DiagnosticBuilder`s.
But we can't easily switch from `Vec<Diagnostic>` to
`Vec<DiagnosticBuilder<G>>` because there's a mix of errors and warnings
which result in different `G` types. So we must make
`DiagnosticBuilder::into_diagnostic` public, but that's ok, and it will
get more use in subsequent commits.
Two different lifetimes are conflated. This doesn't matter right now,
but needs to be fixed for the next commit to work. And the more
descriptive lifetime names make the code easier to read.
One consequence is that errors returned by
`maybe_new_parser_from_source_str` now must be consumed, so a bunch of
places that previously ignored those errors now cancel them. (Most of
them explicitly dropped the errors before. I guess that was to indicate
"we are explicitly ignoring these", though I'm not 100% sure.)
All its uses have been removed.
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
…avidtwco

annotate-snippets: update to 0.10

Ports `annotate-snippets` to 0.10, temporary dupes versions; other crates left that depends on 0.9 is `ui_test` and `rustfmt`.
…2, r=estebank

Silence some follow-up errors [2/x]

this is one piece of the requested cleanups from rust-lang#117449

the `type_of` query frequently uses astconv to convert a `hir::Ty` to a `ty::Ty`. This process is infallible, but may produce errors as it goes. All the error reporting sites that had access to the `ItemCtxt` are now tainting it, causing `type_of` to return a `ty::Error` instead of anything else.
…line, r=ChrisDenton

chore: remove unnecessary blank line

It seems no need to add an unnecessary line here.
…uffer, r=oli-obk

Remove `DiagnosticBuilder::buffer`

`DiagnosticBuilder::buffer` doesn't do much, and part of what it does (for `-Ztreat-err-as-bug`) it shouldn't.

This PR strips it back, replaces its uses, and finally removes it, making a few cleanups in the vicinity along the way.

r? ``@oli-obk``
coverage: Add enums to accommodate other kinds of coverage mappings

Extracted from  rust-lang#118305.

LLVM supports several different kinds of coverage mapping regions, but currently we only ever emit ordinary “code” regions.  This PR performs the plumbing required to add other kinds of regions as enum variants, but does not add any specific variants other than `Code`.

The main motivation for this change is branch coverage, but it will also allow separate experimentation with gap regions and skipped regions, which might help in producing more accurate and useful coverage reports.

---

``@rustbot`` label +A-code-coverage
rint: further doc tweaks

r? ``@nagisa``
…rors

give const-err4 a more descriptive name

Also, doesn't look like this still needs to be per-bitwidth

r? ``@oli-obk``
rustfmt.toml: don't ignore just any tests path, only root one

Previously ignored any `tests` path, now only /tests at repo root.

For reference, https://git-scm.com/docs/gitignore#_pattern_format
@rustbot rustbot added A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Jan 11, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=8

@bors
Copy link
Contributor

bors commented Jan 11, 2024

📌 Commit b3d15eb has been approved by matthiaskrgr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 11, 2024
@bors
Copy link
Contributor

bors commented Jan 11, 2024

⌛ Testing commit b3d15eb with merge 62d7ed4...

@bors
Copy link
Contributor

bors commented Jan 11, 2024

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 62d7ed4 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 11, 2024
@bors bors merged commit 62d7ed4 into rust-lang:master Jan 11, 2024
12 checks passed
@rustbot rustbot added this to the 1.77.0 milestone Jan 11, 2024
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#119448 annotate-snippets: update to 0.10 62aaf1d61f0a98db7ee8759c14ee6840e69ad86a (link)
#119813 Silence some follow-up errors [2/x] ec4b0e542825ce85c4f77970ae8183ade86d8669 (link)
#119836 chore: remove unnecessary blank line eabee9692142d8e834506ef70e4226f973ad5c39 (link)
#119841 Remove DiagnosticBuilder::buffer f7652db781d9bf2d6d0df25ba2447faedd37a8bb (link)
#119842 coverage: Add enums to accommodate other kinds of coverage … 4a6ea2935fef4b42c8c3ff8a3e5363b0cb2d193a (link)
#119845 rint: further doc tweaks 366defe53e10b7b2cb0b96bf4d7c426092153356 (link)
#119852 give const-err4 a more descriptive name 482aed7453b6792d2f7dd824c58b016b924777d3 (link)
#119853 rustfmt.toml: don't ignore just any tests path, only root o… 452275e2f1c09e9b0d17f274c0656724d724d593 (link)

previous master: 4d31ed4cdb

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (62d7ed4): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.1% [3.1%, 3.1%] 1
Improvements ✅
(primary)
-1.1% [-2.3%, -0.5%] 3
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -1.1% [-2.3%, -0.5%] 3

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
3.1% [2.2%, 3.6%] 5
Regressions ❌
(secondary)
3.5% [2.2%, 4.1%] 4
Improvements ✅
(primary)
-0.6% [-0.6%, -0.6%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.4% [-0.6%, 3.6%] 6

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 664.291s -> 666.002s (0.26%)
Artifact size: 308.42 MiB -> 308.40 MiB (-0.01%)

flip1995 pushed a commit to flip1995/rust that referenced this pull request Jan 25, 2024
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#119448 (annotate-snippets: update to 0.10)
 - rust-lang#119813 (Silence some follow-up errors [2/x])
 - rust-lang#119836 (chore: remove unnecessary blank line)
 - rust-lang#119841 (Remove `DiagnosticBuilder::buffer`)
 - rust-lang#119842 (coverage: Add enums to accommodate other kinds of coverage mappings)
 - rust-lang#119845 (rint: further doc tweaks)
 - rust-lang#119852 (give const-err4 a more descriptive name)
 - rust-lang#119853 (rustfmt.toml: don't ignore just any tests path, only root one)

r? `@ghost`
`@rustbot` modify labels: rollup
@matthiaskrgr matthiaskrgr deleted the rollup-mc2qz13 branch March 16, 2024 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants