Commit graph

156468 commits

Author SHA1 Message Date
Matthias Krüger
0d990a3dbd
Rollup merge of #89867 - Urgau:fix-double-definition, r=GuillaumeGomez
Fix macro_rules! duplication when reexported in the same module

This can append if within the same module a `#[macro_export] macro_rules!`
is declared but also a reexport of itself producing two export of the same
macro in the same module. In that case we only want to document it once.

Before:
```
Module {
    is_crate: true,
    items: [
        Id("0:4"),   // pub use crate::repro as repro2;
        Id("0:3"),   // macro_rules! repro
        Id("0:3"),   // duplicate, same as above
    ],
}
```

After:
```
Module {
    is_crate: true,
    items: [
        Id("0:4"),   // pub use crate::repro as repro2;
        Id("0:3"),   // macro_rules! repro
    ],
}
```

Fixes https://github.com/rust-lang/rust/issues/89852
2021-10-19 05:40:51 +02:00
Matthias Krüger
54aa5477ac
Rollup merge of #89766 - krasimirgg:llvm-14-targetregistrty, r=nagisa
RustWrapper: adapt for an LLVM API change

No functional changes intended.

The LLVM commit
89b57061f7
moved TargetRegistry.(h|cpp) from Support to MC.
This adapts RustWrapper accordingly.
2021-10-19 05:40:50 +02:00
Jacob Hoffman-Andrews
9aec3a0e5a Remove border-bottom from most docblocks.
Headings in the top-doc docblock still get a border-bottom due to a rule
that covers all h2, h3, and h4. Method docblocks are generally h5, and
so don't get a border-bottom anymore.

This fixes a problem where a sub-sub-heading within a method would have
a line that went all the way across the page, creating a division that
made that sub-sub-heading look much more important than it really is.
2021-10-18 20:24:41 -07:00
bors
cd8b56f528 Auto merge of #89905 - matthiaskrgr:rev_89709_entirely, r=michaelwoerister
Revert "Auto merge of #89709 - clemenswasser:apply_clippy_suggestions…

…_2, r=petrochenkov"

The PR had some unforseen perf regressions that are not as easy to find.
Revert the PR for now.

This reverts commit 6ae8912a3e, reversing
changes made to 86d6d2b738.
2021-10-19 02:03:21 +00:00
moxian
1519ca99d8 Tiny tweak to Iterator::unzip() doc comment example.
It's easier to figure out what it's doing and which output
elements map to which input ones if the matrix we are dealing
with is rectangular 2x3 rather than square 2x2.
2021-10-19 00:03:51 +00:00
bors
ec724ac075 Auto merge of #89229 - oli-obk:i_love_inferctxt, r=jackh726
Remove redundant member-constraint check

impl trait will, for each lifetime in the hidden type, register a "member constraint" that says the lifetime must be equal or outlive one of the lifetimes of the impl trait. These member constraints will be solved by borrowck

But, as you can see in the big red block of removed code, there was an ad-hoc check for member constraints happening at the site where they get registered. This check had some minor effects on diagnostics, but will fall down on its feet with my big type alias impl trait refactor. So we removed it and I pulled the removal out into a (hopefully) reviewable PR that works on master directly.
2021-10-18 23:02:53 +00:00
Tomasz Miąsko
915a581bcb Do not promote values with const drop that need to be dropped
Changes from #88558 allowed using `~const Drop` in constants by
introducing a new `NeedsNonConstDrop` qualif.

The new qualif was also used for promotion purposes, and allowed
promotion to happen for values that needs to be dropped but which
do have a const drop impl.

Since for promoted the drop implementation is never executed,
this lead to observable change in behaviour. For example:

```rust

struct Panic();

impl const Drop for Panic {
    fn drop(&mut self) {
        panic!();
    }
}

fn main() {
    let _ = &Panic();
}
```

Restore the use of `NeedsDrop` qualif during promotion to avoid the issue.
2021-10-18 21:56:57 +02:00
bors
bd41e09da3 Auto merge of #89124 - cjgillot:owner-info, r=michaelwoerister
Index and hash HIR as part of lowering

Part of https://github.com/rust-lang/rust/pull/88186
~Based on https://github.com/rust-lang/rust/pull/88880 (see merge commit).~

Once HIR is lowered, it is later indexed by the `index_hir` query and hashed for `crate_hash`. This PR moves those post-processing steps to lowering itself. As a side objective, the HIR crate data structure is refactored as an `IndexVec<LocalDefId, Option<OwnerInfo<'hir>>>` where `OwnerInfo` stores all the relevant information for an HIR owner.

r? `@michaelwoerister`
cc `@petrochenkov`
2021-10-18 19:53:05 +00:00
Tomasz Miąsko
171cbc01ef Rename needs_drop to needs_non_const_drop 2021-10-18 20:51:22 +02:00
Yuki Okushi
101a81b807
Add a regression test for #89935 2021-10-19 02:43:54 +09:00
Yuki Okushi
e2453dc2ff
Revert "Rollup merge of #86011 - tlyu:correct-sized-bound-spans, r=estebank"
This reverts commit 36a1076d24, reversing
changes made to e1e9319d93.
2021-10-19 02:33:38 +09:00
Noah Lev
90986897c5 rustdoc: Box ty field of GenericParamDefKind::Const
This cuts the size of `GenericParamDef` in half, from 104 bytes to 56
bytes. I think the extra indirection should be worth the size savings.
2021-10-18 10:16:01 -07:00
Noah Lev
9b52a633e4 rustdoc: Box default fields of GenericParamDefKind
This reduces the size of `GenericParamDef` a bit, but some of the size
savings are hidden because of the `ty` field of the `Const` variant.
I will box that in the next commit.
2021-10-18 10:14:59 -07:00
Oli Scherer
4413f8c709 Member constraints already covered all of E0482 already, so that error never occurred anymore 2021-10-18 15:50:56 +00:00
Oli Scherer
2220fafa8c Guarding a loop with a check that it never runs is useless 2021-10-18 15:50:56 +00:00
Oli Scherer
2431540b62 Remove unused enum variant 2021-10-18 15:50:56 +00:00
Oli Scherer
b02f2982e7 Remove regionck member constraint handling and leave it to mir borrowck 2021-10-18 15:50:56 +00:00
Guillaume Gomez
77c29294be Add test to ensure that the docblock elements left margin is as expected 2021-10-18 16:50:31 +02:00
Guillaume Gomez
20c286e268 Add GUI overflow tests for constant and typedef 2021-10-18 16:15:09 +02:00
Guillaume Gomez
809330bda6 Prevent documentation page title to grow too big 2021-10-18 15:30:03 +02:00
Guillaume Gomez
8b7a2dd462 * Remove left margin on items declaration at the top of their documentation page
* Rename "type-decl" into "item-decl" to reflect the change of usage
2021-10-18 15:06:38 +02:00
woppopo
7936ecff48 Make more From impls const 2021-10-18 19:19:28 +09:00
Krasimir Georgiev
e3c3f4a09c RustWrapper: adapt for an LLVM API change
No functional changes intended.

The LLVM commit
89b57061f7
moved TargetRegistry.(h|cpp) from Support to MC.
This adapts RustWrapper accordingly.
2021-10-18 09:48:47 +02:00
Vadim Petrochenkov
c1e8fc8c97 resolve: Use NameBinding for local variables and generic parameters 2021-10-18 10:42:39 +03:00
cameron
f8b2f91c48 add test for issue 84957 2021-10-18 08:41:18 +01:00
Laurențiu Nicola
72ca6cd990 ⬆️ rust-analyzer 2021-10-18 10:23:58 +03:00
bors
5dab47dcd8 Auto merge of #90000 - matthiaskrgr:rollup-vj7wwur, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #89950 (bootstrap: tweak verbosity settings)
 - #89965 (Fix ICE with `let...else` and `ref mut`)
 - #89974 (Nicer error message if the user attempts to do let...else if)
 - #89987 (Check implementing type for `#[doc(hidden)]`)
 - #89989 (rustdoc: Add static size assertion for `clean::Type`)
 - #89990 (rustc_span: `Ident::invalid` -> `Ident::empty`)
 - #89993 (Remove dead code from `compiletest::json`)
 - #89996 (Bump backtrace)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-10-18 06:46:03 +00:00
Matthias Krüger
2724b00065
Rollup merge of #89996 - winterqt:bump-backtrace, r=Mark-Simulacrum
Bump backtrace

https://github.com/rust-lang/backtrace-rs/pull/446 allows binaries built with Nix on macOS to be symbolized.
2021-10-18 08:13:32 +02:00
Matthias Krüger
adde016d38
Rollup merge of #89993 - pierwill:patch-1, r=Mark-Simulacrum
Remove dead code from `compiletest::json`

Currently getting a dead code warning on master. Might make sense to remove.
2021-10-18 08:13:31 +02:00
Matthias Krüger
2fd765c1d9
Rollup merge of #89990 - petrochenkov:idempty, r=wesleywiser
rustc_span: `Ident::invalid` -> `Ident::empty`

The equivalent for `Symbol`s was renamed some time ago (`kw::Invalid` -> `kw::Empty`), and it makes sense to do the same thing for `Ident`s as well.
2021-10-18 08:13:30 +02:00
Matthias Krüger
874f19f462
Rollup merge of #89989 - camelid:type-size, r=jyn514
rustdoc: Add static size assertion for `clean::Type`

r? `@jyn514`
2021-10-18 08:13:29 +02:00
Matthias Krüger
cd72393566
Rollup merge of #89987 - pierwill:fix-85526-docs-hidden-assoc, r=GuillaumeGomez
Check implementing type for `#[doc(hidden)]`

Closes #85526.
2021-10-18 08:13:28 +02:00
Matthias Krüger
5898c5d88e
Rollup merge of #89974 - est31:let_else_if_error, r=nagisa
Nicer error message if the user attempts to do let...else if

Gives a nice "conditional `else if` is not supported for `let...else`" error when encountering a `let...else if` pattern, as suggested in the [let...else tracking issue](https://github.com/rust-lang/rust/issues/87335#issuecomment-944846205).
2021-10-18 08:13:27 +02:00
Matthias Krüger
b356a04c9a
Rollup merge of #89965 - JohnTitor:fix-let-else-ice-with-ref-mut, r=petrochenkov
Fix ICE with `let...else` and `ref mut`

Fixes #89960, opened for review.
I'm not satisfied with the current diagnostics, any ideas?
2021-10-18 08:13:26 +02:00
Matthias Krüger
b902aa98e5
Rollup merge of #89950 - infinity0:master, r=Mark-Simulacrum
bootstrap: tweak verbosity settings

Currently the verbosity settings are:
- 2: RUSTC-SHIM envvars get spammed on every invocation, O(30) lines
     cargo is passed -v which outputs CLI invocations, O(5) lines
- 3: cargo is passed -vv which outputs build script output, O(0-10) lines

This commit changes it to:

- 1: cargo is passed -v, O(5) lines
- 2: cargo is passed -vv, O(10) lines
- 3: RUSTC-SHIM envvars get spammed, O(30) lines
2021-10-18 08:13:25 +02:00
Noah Lev
9e60288640 Add static size assertion for clean::GenericParamDef 2021-10-17 19:40:23 -07:00
Winter
3f87b7cc0b bump backtrace
https://github.com/rust-lang/backtrace-rs/pull/446 allows binaries built
with Nix on macOS to be symbolized.
2021-10-17 21:20:18 -04:00
pierwill
b87a0b06c7
Remove dead code from compiletest::json 2021-10-17 17:50:35 -05:00
bors
5e02151318 Auto merge of #89499 - Mark-Simulacrum:with-llvm-13, r=nikic
Split out LLVM PGO step and use clang 13 to compile LLVM

We're seeing a PGO version mismatch error in CI logs:

    LLVM Profile Error: Runtime and instrumentation version mismatch : expected 5, but get 7

which is likely due to the version bumped here differing from that used by
rustc.

This PR fixes this by splitting out the PGO step for LLVM into a separate phase of the pgo.sh script, which nets no change to performance (see [these results](https://perf.rust-lang.org/compare.html?start=c34ac8747ca96d09cb08b8f5adddead826e77c06&end=e272c2af45f40c74dab83948235903ffbe3ad57f)). Then, it follows that up with an upgrade to LLVM/clang version 13 as our bootstrap compiler, which yields the performance improvements for this PR -- around 5%. This depends on the first step here, because otherwise we end up somehow clobbering or otherwise hurting our ability to effectively collect performance data, yielding reductions in performance for a subset of benchmarks -- it is not clear what the cause here was precisely, but the split only costs ~10 minutes and seems worthwhile.
2021-10-17 22:29:31 +00:00
pierwill
d39a1bec81 Check implementing type for #[doc(hidden)]
Closes #85526.
2021-10-17 16:37:44 -05:00
Noah Lev
10b9b3d383 Add static size assertion for clean::Type 2021-10-17 14:30:53 -07:00
est31
856541963c Nicer error message if the user attempts to do let...else if 2021-10-17 22:56:29 +02:00
Vadim Petrochenkov
a6808335d4 rustc_span: Ident::invalid -> Ident::empty
The equivalent for `Symbol`s was renamed some time ago (`kw::Invalid` -> `kw::Empty`), and it makes sense to do the same thing for `Ident`s.
2021-10-17 23:20:30 +03:00
bors
1f12ac8729 Auto merge of #89984 - matthiaskrgr:rollup-ikmyhmx, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #89738 (ty::pretty: prevent infinite recursion for `extern crate` paths.)
 - #89888 (Make `llvm.download-ci-llvm="if-available"` work for tier 2 targets with host tools)
 - #89945 (Remove a mention to `copy_from_slice` from `clone_from_slice` doc)
 - #89946 (Fix an ICE with TAITs and Future)
 - #89963 (Some "parenthesis" and "parentheses" fixes)
 - #89975 (Add a regression test for #85921)
 - #89977 (Make Result::as_mut const)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-10-17 19:18:18 +00:00
Matthias Krüger
f044a84f5d
Rollup merge of #89977 - woppopo:result_const_as_mut, r=oli-obk
Make Result::as_mut const

Adding `const` for `Result::as_mut`.

Tracking issue: #82814
2021-10-17 18:19:00 +02:00
Matthias Krüger
1ee7c2940e
Rollup merge of #89975 - JohnTitor:gats-tests-85921, r=jackh726
Add a regression test for #85921

Closes #85921
r? `@jackh726`
2021-10-17 18:18:59 +02:00
Matthias Krüger
e0e2b3cc43
Rollup merge of #89963 - r00ster91:parenthesisparentheses, r=nagisa
Some "parenthesis" and "parentheses" fixes

"Parenthesis" is the singular (e.g. one `(` or one `)`) and "parentheses" is the plural (multiple `(` or `)`s) and this is not hard to mix up so here are some fixes for that.

Inspired by #89958
2021-10-17 18:18:59 +02:00
Matthias Krüger
0f1ba8d8c7
Rollup merge of #89946 - JohnTitor:fix-89686, r=petrochenkov
Fix an ICE with TAITs and Future

Fixes #89686
2021-10-17 18:18:58 +02:00
Matthias Krüger
1520fffecc
Rollup merge of #89945 - JohnTitor:we-now-specialize-clone-from-slice, r=the8472
Remove a mention to `copy_from_slice` from `clone_from_slice` doc

Fixes #84736
I think removing it would be the best but I'm happy to clarify it instead if someone would like.
2021-10-17 18:18:57 +02:00
Matthias Krüger
eb69090e7b
Rollup merge of #89888 - rusticstuff:download-ci-llvm-apple-arm64, r=Mark-Simulacrum
Make `llvm.download-ci-llvm="if-available"` work for tier 2 targets with host tools

`llvm.download-ci-llvm="if-available"` is used for most profiles configured via `x.py setup`. It allows downloading prebuilt LLVM tarballs from the CI artifacts for a configured list of platforms. Currently this list is restricted to tier 1 targets but it makes sense for all tier 2 targets with host tools.
2021-10-17 18:18:56 +02:00