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 10 pull requests #103417

Closed
wants to merge 24 commits into from
Closed

Conversation

notriddle
Copy link
Contributor

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

compiler-errors and others added 24 commits October 7, 2022 02:06
These targets have system limits on the thread names, 16 and 64 bytes
respectively, and `pthread_setname_np` returns an error if the name is
longer. However, we're not in a context that can propagate errors when
we call this, and we used to implicitly truncate on Linux with `prctl`,
so now we manually truncate these names ahead of time.
It was added to the CSS in d8de2b4, but
was never actually used in that PR.
Some diagnostic-related nits

1. Use `&mut Diagnostic` instead of `&mut DiagnosticBuilder<'_, T>`
2. Make `diag.span_suggestions` take an `IntoIterator` instead of `Iterator`, just to remove some `.into_iter` calls on the caller.

idk if I should add a lint to make sure people use `&mut Diagnostic` instead of `&mut DiagnosticBuilder<'_, T>` in cases where we're just, e.g., adding subdiagnostics to the diagnostic... maybe a followup.
… r=cjgillot

Introduce `subst_iter` and `subst_iter_copied` on `EarlyBinder`

Makes working with bounds lists a bit easier, which I seem to do a lot.

Specifically, means that we don't need to do `.transpose_iter().map(|(pred, _)| *pred)` every time we want to iterate through an `EarlyBinder<&'tcx [(Predicate, Span)]>` (and even then, still have to call `subst` later), which was a very awkward idiom imo.
…r=compiler-errors

Escape string literals when fixing overlong char literal

Fixes rust-lang#103323

`@rustbot` label +A-diagnostics +A-suggestion-diagnostics
…ck, r=oli-obk

Handle return-position `impl Trait` in traits properly in `register_hidden_type`

The bounds that we get by calling `bound_explicit_item_bounds` from an RPITIT have projections, not opaques, but when we're *registering* an opaque, we want to treat it like an opaque.

Coincidentally fixes rust-lang#102688 as well, which makes sense, since that was failing because we were inferring an opaque type to be equal to itself (opaque cycle error => "cannot resolve opaque type").

Fixes rust-lang#103352

r? `@oli-obk`
…guity-bug, r=oli-obk

Delay ambiguity span bug in normalize query iff not rustdoc

Oli and I decided that the compiler debt of adding another usage of `tcx.sess.opts.actually_rustdoc` is fine, because we don't really want to add more complexity to the normalize query, and moving rustdoc to use fulfill normalization (`fully_normalize`, i.e. not use the normalize query) is unnecessary overhead given that it's skipping binders and stuff.

r? oli-obk

Fixes rust-lang#102827
Fixes rust-lang#103181
…omcc

Truncate thread names on Linux and Apple targets

These targets have system limits on the thread names, 16 and 64 bytes
respectively, and `pthread_setname_np` returns an error if the name is
longer. However, we're not in a context that can propagate errors when
we call this, and we used to implicitly truncate on Linux with `prctl`,
so now we manually truncate these names ahead of time.

r? `@thomcc`
…tion, r=GuillaumeGomez

rustdoc: remove unused CSS class `.result-description`

It was added to the CSS in d8de2b4, but was never actually used in that PR.
…ect, r=fee1-dead

Change `unknown_lint` applicability to `MaybeIncorrect`

This small PR changes the applicability of `unknown_lint` to `MaybeIncorrect`, because the suggested lint might not be the correct one.

Here is one example where the current applicability causes a problem. Clippy has a set of internal lints guarded by a feature called `internal`. If the feature is not enabled, then the internal lints are "unknown." In that case, running `cargo clippy --fix ...` on `clippy_utils` causes lines such as the followig
https://github.com/rust-lang/rust/blob/26c96e341639102afacbbcad0dc18ad0ac71ab18/src/tools/clippy/clippy_utils/src/paths.rs#L51-L52
to be changed to
```rust
 #[expect(clippy::invalid_regex)] // internal lints do not know about all external crates
 pub const FUTURES_IO_ASYNCREADEXT: [&str; 3] = ["futures_util", "io", "AsyncReadExt"];
```
which is not correct.
…leanup, r=notriddle

Use functions for headings rustdoc GUI test

r? `@notriddle`
…, r=thomcc

Fix typo in docs of `String::leak`.

I introduced a typo in rust-lang#103280, this PR fixes it.

See rust-lang#103280 (comment)
@rustbot rustbot added 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 Oct 22, 2022
@rust-log-analyzer
Copy link
Collaborator

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
    Checking rustc_hir v0.0.0 (/checkout/compiler/rustc_hir)
    Checking rustc_lint_defs v0.0.0 (/checkout/compiler/rustc_lint_defs)
    Checking rustc_hir_pretty v0.0.0 (/checkout/compiler/rustc_hir_pretty)
    Checking rustc_errors v0.0.0 (/checkout/compiler/rustc_errors)
error[E0599]: `impl IntoIterator<Item = Vec<(Span, String)>>` is not an iterator
    |
    |
720 |         suggestions: impl IntoIterator<Item = Vec<(Span, String)>>,
    |                      --------------------------------------------- method `collect` not found for this type parameter
...
723 |         let suggestions: Vec<_> = suggestions.collect();
    |                                               ^^^^^^^ `impl IntoIterator<Item = Vec<(Span, String)>>` is not an iterator
    = note: the following trait bounds were not satisfied:
    = note: the following trait bounds were not satisfied:
            `impl IntoIterator<Item = Vec<(Span, String)>>: Iterator`
            which is required by `&mut impl IntoIterator<Item = Vec<(Span, String)>>: Iterator`
    = help: items from traits can only be used if the type parameter is bounded by the trait
help: the following trait defines an item `collect`, perhaps you need to restrict type parameter `impl IntoIterator<Item = Vec<(Span, String)>>` with it:
    |
720 |         suggestions: impl IntoIterator<Item = Vec<(Span, String)>> + Iterator,

For more information about this error, try `rustc --explain E0599`.
error: could not compile `rustc_errors` due to previous error
warning: build failed, waiting for other jobs to finish...

@notriddle
Copy link
Contributor Author

@bors r-

@bors bors added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Oct 22, 2022
@notriddle notriddle closed this Oct 22, 2022
@notriddle notriddle deleted the rollup-stpcg6d branch October 23, 2022 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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