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 11 pull requests #119837

Merged
merged 39 commits into from
Jan 11, 2024
Merged

Rollup of 11 pull requests #119837

merged 39 commits into from
Jan 11, 2024

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

joshtriplett and others added 30 commits August 21, 2023 01:05
Add a description of a version-sorting algorithm. (This algorithm does
not precisely match `strverscmp`; it's intentionally simpler in its
handling of leading zeroes, and produces a result easier for humans to
easily understand and do by hand.)

Change all references to sorting to use version-sorting.

Change all references to "ASCIIbetically" to instead say "sort
non-lowercase before lowercase".
Treat numeric chunks with equal value but differing numbers of leading
zeroes as equal, unless we get to the end of the entire string in which
case we use "more leading zeroes in the earliest differing chunk" as a
tiebreaker.

Treat `_` as a word separator, sorting it before anything other than
space.

Give more examples.
Co-authored-by: Michael Goulet <michael@errs.io>
Also provide a mechanism to retrieve traits and implementations for a
given crate.
Because the values put into it are functions named `track_diagnostic`
and `default_track_diagnostic`.
`is_force_warn` is only possible for diagnostics with `Level::Warning`,
but it is currently stored in `Diagnostic::code`, which every diagnostic
has.

This commit:
- removes the boolean `DiagnosticId::Lint::is_force_warn` field;
- adds a `ForceWarning` variant to `Level`.

Benefits:
- The common `Level::Warning` case now has no arguments, replacing
  lots of `Warning(None)` occurrences.
- `rustc_session::lint::Level` and `rustc_errors::Level` are more
  similar, both having `ForceWarning` and `Warning`.
It's missing but should obviously be included.
To put it next to a similar field.
There are four functions that adjust error and warning counts:
- `stash_diagnostic` (increment)
- `steal_diagnostic` (decrement)
- `emit_stashed_diagnostics) (decrement)
- `emit_diagnostic` (increment)

The first three all behave similarly, and only update `warn_count` for
forced warnings. But the last one updates `warn_count` for both forced
and non-forced warnings.

Seems like a bug. How should it be fixed? Well, `warn_count` is only
used in one place: `DiagCtxtInner::drop`, where it's part of the
condition relating to the printing of `good_path_delayed_bugs`. The
intention of that condition seems to be "have any errors been printed?"
so this commit replaces `warn_count` with `has_printed`, which is set
when printing occurs. This is simpler than all the ahead-of-time
incrementing and decrementing.
Of the error levels satisfying `is_error`, `Level::Error` is the only
one that can be a lint, so there's no need to check for it.

(And even if it wasn't, it would make more sense to include
non-`Error`-but-`is_error` lints under `lint_err_count` than under
`err_count`.)
IANA explicitly documents 192.0.0.9/32, 192.0.0.9/32 and 2001:30::/28 as
globally reachable[1][2] and the is_global implementations declare
following IANA so let's make this happen.

In case of 2002::/16 IANA says N/A so I think it's safe to say we
shouldn't return true there either.

[1] https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml
[2] https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml
…rors

Use version-sorting for all sorting

Add a description of a version-sorting algorithm. (This algorithm does
not precisely match `strverscmp`; it's intentionally simpler in its
handling of leading zeroes, and produces a result easier for humans to
easily understand and do by hand.)

Change all references to sorting to use version-sorting.

Change all references to "ASCIIbetically" to instead say "sort
non-lowercase before lowercase".
Add some comments, add `can_define_opaque_ty` check to `try_normalize_ty_recur`

Follow-up from rust-lang#117278, since I was recently re-reviewing this code.
…oli-obk

Cleanup things in and around `Diagnostic`

These changes all arose when I was looking closely at how to simplify `DiagCtxtInner::emit_diagnostic`.

r? `@compiler-errors`
change function name in comments

fixes rust-lang#119787 where I believe an incorrect function name is used in the comments
Fix all_trait* methods to return all traits available in StableMIR

Also provide a mechanism to retrieve traits and implementations for a given crate.

This fixes rust-lang/project-stable-mir#37
…, r=compiler-errors

Silence some follow-up errors [1/x]

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

When we use `-> impl SomeTrait<_>` as a return type, we are both using the "infer return type suggestion" code path, and the infer opaque type code path within the same function. That can lead to confusing diagnostics, so silence all opaque type diagnostics in that case.
…iper

Stabilize mutex_unpoison feature

Closes rust-lang#96469

`@rustbot` +T-libs-api
…bot, r=compiler-errors

Meta: Add project const traits to triagebot config

r? compiler-errors or project-const-traits
@rustbot rustbot added A-meta Area: Issues & PRs about the rust-lang/rust repository itself S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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-style Relevant to the style team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) rollup A PR which is a rollup labels Jan 11, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=11

@bors
Copy link
Contributor

bors commented Jan 11, 2024

📌 Commit 1189d23 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 1189d23 with merge 65b323b...

@bors
Copy link
Contributor

bors commented Jan 11, 2024

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 65b323b to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 11, 2024
@bors bors merged commit 65b323b 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
#115046 Use version-sorting for all sorting a33adf5d1999cea0b32493c2d644e32390dbbc9d (link)
#118915 Add some comments, add can_define_opaque_ty check to `try… 7204713acfc79cb4ce6aca2f7a0cbe2d99adb1c7 (link)
#119006 Fix is_global special address handling 076f7102f8b3d70943819784992835b316c53d0f (link)
#119637 Pass LLVM error message back to pass wrapper. 5ebb114a63ab31a5430c57b8f33b0f4415e81548 (link)
#119715 Exhaustiveness: abort on type error 503bd5795ca67bffcff68bc454ce4d1395254889 (link)
#119763 Cleanup things in and around Diagnostic ca828a1ae3614d8b5adf72ae4d40d3db83c2055f (link)
#119788 change function name in comments 545eb62e03b50b8c02cda09554cf263774713a3b (link)
#119790 Fix all_trait* methods to return all traits available in St… 713d5320e1c65cd6c9d7b8829675a3d303b41665 (link)
#119803 Silence some follow-up errors [1/x] d7df29416e1fb9552dedb5fe9af807653508acef (link)
#119804 Stabilize mutex_unpoison feature 2992a50b54b7bf5ccf822e9b62f4f0d76a438a35 (link)
#119832 Meta: Add project const traits to triagebot config 6b41c2df0159fcec54ab8bf7f825b7fad40c677c (link)

previous master: 0a8923361e

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 (65b323b): 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.8% [0.8%, 0.8%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.8% [0.8%, 0.8%] 1

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)
0.6% [0.6%, 0.6%] 1
Regressions ❌
(secondary)
2.1% [2.1%, 2.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.6% [0.6%, 0.6%] 1

Binary size

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

Bootstrap: 667.616s -> 668.141s (0.08%)
Artifact size: 308.45 MiB -> 308.47 MiB (0.01%)

@matthiaskrgr matthiaskrgr deleted the rollup-l2olpad 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 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-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-style Relevant to the style team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.