Skip to content

Rollup of 12 pull requests #103500

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wants to merge 25 commits into from
Closed

Conversation

JohnTitor
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

chenyukang and others added 25 commits October 20, 2022 20:16
In 4b402db, when this rule was added, it
was overriding a rule that made all links in docblock get an underline when
hovered. This became redundant when, after reordering the rules,
7585632 changed the pro-underline rule to
exclude the test-arrow link anyway.
…dler`

Start using `unix_sigpipe` instead of
`rustc_driver::set_sigpipe_handler`.

After this has been merged, we can completely remove
`rustc_driver::set_sigpipe_handler`.

Verification of this change
---------------------------

1. Remove `#[unix_sigpipe = "sig_dfl"]`
1. Run `./x.py build`
1. Run `./build/aarch64-apple-darwin/stage1/bin/rustdoc --help | false`
1. Observe ICE
1. Add back `#[unix_sigpipe = "sig_dfl"]`
1. Run `./x.py build`
1. Run `./build/aarch64-apple-darwin/stage1/bin/rustdoc --help | false`
1. Observe ICE fixed
…sleywiser

Fix assertion failed for break_last_token and trailing token

Fixes rust-lang#103143
…=wesleywiser

Change terminology for assoc method suggestions when they are not called

Fixes rust-lang#103325

``@rustbot`` label +A-diagnostics
…n-ice, r=cjgillot

Don't ICE when reporting borrowck errors involving regions from `anonymous_lifetime_in_impl_trait`

The issue here is that when we have:

```
trait Trait<'a> { .. }

fn foo(arg: impl Trait) { .. }
```

The anonymous lifetime `'_` that we generate for `arg: impl Trait` doesn't end up in the argument type (which is a param) but in a where-clause of the function, in a predicate whose self type is that param ty.

Fixes rust-lang#101660

r? `@cjgillot`
…ismatch, r=lcnr

Delay span bug when we can't map lifetimes back in `collect_trait_impl_trait_tys`

When a lifetime is late-bound in a trait signature, but early-bound in an impl signature, we already emit an error -- however, we also ICE in `collect_trait_impl_trait_tys`, so just delay a bug here.

Fixes rust-lang#103407
…ohnTitor

-Z docs: Add link to unstable book
…llot

Name the `impl Trait` in region bound suggestions

Slightly more descriptive message
…t-white-space, r=Dylan-DPC

rustdoc: remove no-op CSS `.source pre.rust { white-space: pre }`

This rule, added in 49e6db7, overrode a rule in normalize.css.

https://github.com/rust-lang/rust/blob/49e6db7f3510a99ab3d3723b2430add985629c39/src/librustdoc/html/static/normalize.css#L169-L175

When normalize.css was updated, this rule went away.

necolas/normalize.css@a8edd0c
E0210 explanation: remove redundant sentence
…-highlight-colors, r=notriddle

Use functions in highlight-colors rustdoc GUI test

r? `@notriddle`
…-logo, r=GuillaumeGomez

rustdoc: remove unused `.sidebar-logo` DOM on source pages
…er, r=GuillaumeGomez

rustdoc: remove redundant CSS `a.test-arrow:hover`

In 4b402db, when this rule was added, it was overriding a rule that made all links in docblock get an underline when hovered. This became redundant when, after reordering the rules, 7585632 changed the pro-underline rule to exclude the test-arrow link anyway.
…triddle

rustdoc: Use `unix_sigpipe` instead of `rustc_driver::set_sigpipe_handler`

Do what was already done for `rustc` in rust-lang#102587, namely start using `unix_sigpipe` instead of `rustc_driver::set_sigpipe_handler`.

After this has been merged, we can completely remove `rustc_driver::set_sigpipe_handler`.

PR that added `set_sigpipe_handler`: rust-lang#49606

Tracking issue for `unix_sigpipe`: rust-lang#97889

Verification of this change
---------------------------

1. Remove `#[unix_sigpipe = "sig_dfl"]`
1. Run `./x.py build`
1. Run `./build/aarch64-apple-darwin/stage1/bin/rustdoc --help | false`
1. Observe ICE
1. Add back `#[unix_sigpipe = "sig_dfl"]`
1. Run `./x.py build`
1. Run `./build/aarch64-apple-darwin/stage1/bin/rustdoc --help | false`
1. Observe ICE fixed

`@rustbot` labels +T-rustdoc
@rustbot rustbot added T-compiler Relevant to the compiler 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 24, 2022
@JohnTitor
Copy link
Member Author

@bors r+ p=12 rollup=never

@bors
Copy link
Collaborator

bors commented Oct 24, 2022

📌 Commit f5f62d8 has been approved by JohnTitor

It is now in the queue for this repository.

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Oct 24, 2022
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-13 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

6 LL |     x
7    |     ^
8    |
- help: to declare that `impl Swap` captures `'b`, you can add an explicit `'b` lifetime bound
+ help: to declare that `impl Swap + 'a` captures `'b`, you can add an explicit `'b` lifetime bound
10    |
11 LL | fn hide_ref<'a, 'b, T: 'static>(x: &'a mut &'b T) -> impl Swap + 'a + 'b {

19 LL |     x
20    |     ^
21    |
21    |
- help: to declare that `impl Swap` captures `'b`, you can add an explicit `'b` lifetime bound
+ help: to declare that `impl Swap + 'a` captures `'b`, you can add an explicit `'b` lifetime bound
23    |
24 LL | fn hide_rc_refcell<'a, 'b: 'a, T: 'static>(x: Rc<RefCell<&'b T>>) -> impl Swap + 'a + 'b {


The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/impl-trait/hidden-lifetimes/hidden-lifetimes.stderr
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/impl-trait/hidden-lifetimes/hidden-lifetimes.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args impl-trait/hidden-lifetimes.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/impl-trait/hidden-lifetimes.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/impl-trait/hidden-lifetimes" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/impl-trait/hidden-lifetimes/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0700]: hidden type for `impl Swap + 'a` captures lifetime that does not appear in bounds
   |
   |
LL | fn hide_ref<'a, 'b, T: 'static>(x: &'a mut &'b T) -> impl Swap + 'a {
   |                 -- hidden type `&'a mut &'b T` captures the lifetime `'b` as defined here
   |     ^
   |
   |
help: to declare that `impl Swap + 'a` captures `'b`, you can add an explicit `'b` lifetime bound
   |
LL | fn hide_ref<'a, 'b, T: 'static>(x: &'a mut &'b T) -> impl Swap + 'a + 'b {


error[E0700]: hidden type for `impl Swap + 'a` captures lifetime that does not appear in bounds
   |
   |
LL | fn hide_rc_refcell<'a, 'b: 'a, T: 'static>(x: Rc<RefCell<&'b T>>) -> impl Swap + 'a {
Some tests failed in compiletest suite=ui mode=ui host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
   |                        -- hidden type `Rc<RefCell<&'b T>>` captures the lifetime `'b` as defined here
   |     ^
   |
   |
help: to declare that `impl Swap + 'a` captures `'b`, you can add an explicit `'b` lifetime bound
   |
LL | fn hide_rc_refcell<'a, 'b: 'a, T: 'static>(x: Rc<RefCell<&'b T>>) -> impl Swap + 'a + 'b {

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0700`.
For more information about this error, try `rustc --explain E0700`.
------------------------------------------


---- [ui] src/test/ui/impl-trait/must_outlive_least_region_or_bound.rs stdout ----
diff of stderr:

32    |               |
33    |               let's call the lifetime of this reference `'1`
34    |
- help: consider changing `impl Copy`'s explicit `'static` bound to the lifetime of argument `x`
+ help: consider changing `impl Copy + 'static`'s explicit `'static` bound to the lifetime of argument `x`
36    |
37 LL | fn elided2(x: &i32) -> impl Copy + '_ { x }


47 LL | fn explicit2<'a>(x: &'a i32) -> impl Copy + 'static { x }
48    |              -- lifetime `'a` defined here            ^ returning this value requires that `'a` must outlive `'static`
49    |
- help: consider changing `impl Copy`'s explicit `'static` bound to the lifetime of argument `x`
+ help: consider changing `impl Copy + 'static`'s explicit `'static` bound to the lifetime of argument `x`
51    |
52 LL | fn explicit2<'a>(x: &'a i32) -> impl Copy + 'a { x }


87 LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static { x }
88    |               -- lifetime `'a` defined here                         ^ returning this value requires that `'a` must outlive `'static`
89    |
- help: consider changing `impl LifetimeTrait<'a>`'s explicit `'static` bound to the lifetime of argument `x`
+ help: consider changing `impl LifetimeTrait<'a> + 'static`'s explicit `'static` bound to the lifetime of argument `x`
91    |
92 LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'a { x }


The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/impl-trait/must_outlive_least_region_or_bound/must_outlive_least_region_or_bound.stderr
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/impl-trait/must_outlive_least_region_or_bound/must_outlive_least_region_or_bound.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args impl-trait/must_outlive_least_region_or_bound.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/impl-trait/must_outlive_least_region_or_bound.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/impl-trait/must_outlive_least_region_or_bound" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/impl-trait/must_outlive_least_region_or_bound/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0700]: hidden type for `impl Copy` captures lifetime that does not appear in bounds
   |
   |
LL | fn elided(x: &i32) -> impl Copy { x }
   |              |
   |              |
   |              hidden type `&i32` captures the anonymous lifetime defined here
   |
help: to declare that `impl Copy` captures `'_`, you can add an explicit `'_` lifetime bound
   |
LL | fn elided(x: &i32) -> impl Copy + '_ { x }


error[E0700]: hidden type for `impl Copy` captures lifetime that does not appear in bounds
   |
   |
LL | fn explicit<'a>(x: &'a i32) -> impl Copy { x }
   |             |
   |             |
   |             hidden type `&'a i32` captures the lifetime `'a` as defined here
   |
help: to declare that `impl Copy` captures `'a`, you can add an explicit `'a` lifetime bound
   |
LL | fn explicit<'a>(x: &'a i32) -> impl Copy + 'a { x }

error: lifetime may not live long enough
  --> /checkout/src/test/ui/impl-trait/must_outlive_least_region_or_bound.rs:9:46
   |
   |
LL | fn elided2(x: &i32) -> impl Copy + 'static { x }
   |               -                              ^ returning this value requires that `'1` must outlive `'static`
   |               |
   |               let's call the lifetime of this reference `'1`
   |
help: consider changing `impl Copy + 'static`'s explicit `'static` bound to the lifetime of argument `x`
   |
LL | fn elided2(x: &i32) -> impl Copy + '_ { x }
   |                                    ~~
help: alternatively, add an explicit `'static` bound to this reference
   |
LL | fn elided2(x: &'static i32) -> impl Copy + 'static { x }

error: lifetime may not live long enough
  --> /checkout/src/test/ui/impl-trait/must_outlive_least_region_or_bound.rs:12:55
   |
   |
LL | fn explicit2<'a>(x: &'a i32) -> impl Copy + 'static { x }
   |              -- lifetime `'a` defined here            ^ returning this value requires that `'a` must outlive `'static`
   |
help: consider changing `impl Copy + 'static`'s explicit `'static` bound to the lifetime of argument `x`
   |
LL | fn explicit2<'a>(x: &'a i32) -> impl Copy + 'a { x }
   |                                             ~~
help: alternatively, add an explicit `'static` bound to this reference
   |
LL | fn explicit2<'a>(x: &'static i32) -> impl Copy + 'static { x }

error[E0621]: explicit lifetime required in the type of `x`
  --> /checkout/src/test/ui/impl-trait/must_outlive_least_region_or_bound.rs:15:41
   |
   |
LL | fn foo<'a>(x: &i32) -> impl Copy + 'a { x }
   |               ----                      ^ lifetime `'a` required
   |               |
   |               help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
error: lifetime may not live long enough
  --> /checkout/src/test/ui/impl-trait/must_outlive_least_region_or_bound.rs:26:55
   |
   |
LL | fn elided5(x: &i32) -> (Box<dyn Debug>, impl Debug) { (Box::new(x), x) }
   |               -                                       ^^^^^^^^^^^^^^^^ returning this value requires that `'1` must outlive `'static`
   |               |
   |               let's call the lifetime of this reference `'1`
   |
help: to declare that the trait object captures data from argument `x`, you can add an explicit `'_` lifetime bound
   |
LL | fn elided5(x: &i32) -> (Box<dyn Debug + '_>, impl Debug) { (Box::new(x), x) }
   |                                       ++++
help: to declare that `impl Debug` captures data from argument `x`, you can add an explicit `'_` lifetime bound
   |
LL | fn elided5(x: &i32) -> (Box<dyn Debug>, impl Debug + '_) { (Box::new(x), x) }

error: lifetime may not live long enough
  --> /checkout/src/test/ui/impl-trait/must_outlive_least_region_or_bound.rs:32:69
   |
   |
LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static { x }
   |               -- lifetime `'a` defined here                         ^ returning this value requires that `'a` must outlive `'static`
   |
help: consider changing `impl LifetimeTrait<'a> + 'static`'s explicit `'static` bound to the lifetime of argument `x`
   |
LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'a { x }
   |                                                           ~~
help: alternatively, add an explicit `'static` bound to this reference
   |
LL | fn with_bound<'a>(x: &'static i32) -> impl LifetimeTrait<'a> + 'static { x }


error[E0700]: hidden type for `impl Fn(&'a u32)` captures lifetime that does not appear in bounds
   |
   |
LL | fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32) {
   |                              -- hidden type `[closure@/checkout/src/test/ui/impl-trait/must_outlive_least_region_or_bound.rs:38:5: 38:13]` captures the lifetime `'b` as defined here
LL |     move |_| println!("{}", y)
   |
   |
help: to declare that `impl Fn(&'a u32)` captures `'b`, you can add an explicit `'b` lifetime bound
   |
LL | fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32) + 'b {

error[E0310]: the parameter type `T` may not live long enough
  --> /checkout/src/test/ui/impl-trait/must_outlive_least_region_or_bound.rs:43:5
   |
   |
LL |     x
   |     ^ ...so that the type `T` will meet its required lifetime bounds
help: consider adding an explicit lifetime bound...
   |
   |
LL | fn ty_param_wont_outlive_static<T:Debug + 'static>(x: T) -> impl Debug + 'static {

error: aborting due to 9 previous errors

Some errors have detailed explanations: E0310, E0621, E0700.

@JohnTitor JohnTitor closed this Oct 24, 2022
@JohnTitor JohnTitor deleted the rollup-base8km branch October 24, 2022 23:01
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
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-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.