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 7 pull requests #82688

Merged
merged 23 commits into from
Mar 2, 2021
Merged

Conversation

GuillaumeGomez
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

GuillaumeGomez and others added 23 commits February 28, 2021 00:48
…c` is set

Previously, logging at DEBUG or below would always be silenced, because
rustc compiles tracing with the `static_max_level_info` feature. That
makes sense for release artifacts, but not for developing rustdoc.

Instead, this compiles two different versions of tracing: one in the
release artifacts, distributed in the sysroot, and a new version
compiled by rustdoc. Since `rustc_driver` is always linked to the
version of sysroot, this copy/pastes `init_env_logging` into rustdoc.

The builds the second version of tracing unconditionally; see the code
for details on why.
`src/test/rustdoc-ui/deprecated-attrs.rs`
tells rustdoc to run the `collapse-docs` pass, which no longer exists
(it was removed in rust-lang#80261).
Rustdoc doesn't actually give a proper diagnostic here; instead it
prints an `error!` log. Now that tracing is compiled unconditionally,
the log is now being emitted by default, because it's at the error
level.

rustdoc shouldn't be using `error!` logging for diagnostics in the first
place, but in the meantime this change gets the testsuite to pass.
The same information is available everywhere; the only reason the dummy
cache was needed is because it waas previously stored in three different
places. This consolidates the info a bit so the cache in `DocContext` is
used throughout. As a bonus, it means `renderinfo` is used much much
less.

- Return a `Cache` from `run_global_ctxt`, not `RenderInfo`
- Remove the unused `render_info` from `run_renderer`
- Remove RefCell around `inlined`
- Add intra-doc links
Previously, `JsonRenderer::after_krate` called `krate.version.clone()`.
The problem was it did that after the version was already moved into the
cache, so it would always be None. The fix was to get the version from
the cache instead.
This table is used twice in core::num::dec2flt::algorithm::power_of_ten.
According to the semantics of const, a separate huge definition of the
table is inlined at both places.

    fn power_of_ten(e: i16) -> Fp {
        assert!(e >= table::MIN_E);
        let i = e - table::MIN_E;
        let sig = table::POWERS.0[i as usize];
        let exp = table::POWERS.1[i as usize];
        Fp { f: sig, e: exp }
    }

Theoretically this gets cleaned up by optimization passes, but in
practice I am experiencing a miscompile from LTO on this code. Making
the table a static, which would only be defined a single time and not
require attention from LTO, eliminates the miscompile and seems
semantically more appropriate anyway. A separate bug report on the LTO
bug is forthcoming.
check that first arg to `panic!()` in const is `&str`

closes rust-lang#66693

~~TODO: regression test~~

cc `@RalfJung` for error message wording
…lacrum

Always compile rustdoc with debug logging enabled when `download-rustc` is set

Previously, logging at DEBUG or below would always be silenced, because
rustc compiles tracing with the `static_max_level_info` feature. That
makes sense for release artifacts, but not for developing rustdoc.

Instead, this compiles two different versions of tracing: one in the
release artifacts, distributed in the sysroot, and a new version
compiled by rustdoc. Since `rustc_driver` is always linked to the
version of sysroot, this copy/pastes `init_env_logging` into rustdoc.

To avoid compiling an unnecessary version of tracing when
`download-rustc` isn't set, this adds a new `using-ci-artifacts`
feature for rustdoc and passes that feature in bootstrap.

Addresses rust-lang#81930. This builds on rust-lang#79540.

r? `@Mark-Simulacrum`
…illaumeGomez

Remove the dummy cache in `DocContext`; delete RenderInfo

The same information is available everywhere; the only reason the dummy
cache was needed is because it was previously stored in three different
places. This consolidates the info a bit so the cache in `DocContext` is
used throughout. As a bonus, it also completely removes `RenderInfo`.

- Return a `Cache` from `run_global_ctxt`, not `RenderInfo`
- Remove the unused `render_info` from `run_renderer`
- Remove RenderInfo altogether

Helps with rust-lang#82014. The next step is to move the `populate()` call before the `collect_intra_doc_links` pass, which currently breaks because a) lots of the cache is populated in early passes, and b) intra_doc_links itself sets some info with `register_res`. I'm working on separate PR for that to avoid making too many big changes at once.

r? `@GuillaumeGomez`
…r=jyn514

Check stability and feature attributes in rustdoc

Fixes rust-lang#82588.

cc `@Nemo157` `@camelid`
r? `@jyn514`
Highlight identifier span instead of whole pattern span in `unused` lint

Fixes rust-lang#81314

This pretty much just changes the span highlighted in the lint from `pat_sp` to `ident.span`. There's however an exception, which is in patterns with shorthands like `Point { y, ref mut x }`, where a suggestion to change just `x` would be invalid; in those cases I had to keep the pattern span. Another option would be suggesting something like `Point { y, x: ref mut _x }`.

I also added a new test since there weren't any test that checked the `unused` lint with optional patterns.
…n514

Warn about unknown doc attributes

Fixes rust-lang#82652.

For the text error, I decided to go for "invalid" instead of "unknown". What do you think?

r? `@jyn514`
Change twice used large const table to static

This table is used twice in core::num::dec2flt::algorithm::power_of_ten. According to the semantics of const, a separate huge definition of the table is inlined at both places.

https://github.com/rust-lang/rust/blob/5233edcf1c7ee70ac25e4ec1115c3546f53d8a2d/library/core/src/num/dec2flt/algorithm.rs#L16-L22

Theoretically this gets cleaned up by optimization passes, but in practice I am experiencing a miscompile from LTO on this code. Making the table a static, which would only be defined a single time and not require attention from LTO, eliminates the miscompile and seems semantically more appropriate anyway. A separate bug report on the LTO bug is forthcoming.

Original addition of `const` is from rust-lang#27307.
@rustbot rustbot added the rollup A PR which is a rollup label Mar 1, 2021
@GuillaumeGomez
Copy link
Member Author

@bors: r+ p=7

@bors
Copy link
Contributor

bors commented Mar 1, 2021

📌 Commit 9a0ac7c has been approved by GuillaumeGomez

@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 Mar 1, 2021
@jyn514
Copy link
Member

jyn514 commented Mar 2, 2021

@bors rollup=never

@bors
Copy link
Contributor

bors commented Mar 2, 2021

⌛ Testing commit 9a0ac7c with merge ef0d592...

@bors
Copy link
Contributor

bors commented Mar 2, 2021

☀️ Test successful - checks-actions
Approved by: GuillaumeGomez
Pushing ef0d592 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 2, 2021
@bors bors merged commit ef0d592 into rust-lang:master Mar 2, 2021
@rustbot rustbot added this to the 1.52.0 milestone Mar 2, 2021
@GuillaumeGomez GuillaumeGomez deleted the rollup-b754t11 branch March 2, 2021 08:53
@a1ph
Copy link

a1ph commented Mar 4, 2021

This likely caused our builds fail with error below. Is that expected?

        Compiling tinytemplate v1.2.0
     error: unknown `doc` attribute `Hidden`
       --> /root/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/tinytemplate-1.2.0/src/error.rs:44:11
        |
     44 |     #[doc(Hidden)]
        |           ^^^^^^

@jyn514
Copy link
Member

jyn514 commented Mar 4, 2021

@a1ph see #82702, it should be fixed on the latest nightly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants