]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoAuto merge of #79073 - davidtwco:issue-78957-const-param-attrs, r=lcnr
bors [Sat, 19 Dec 2020 04:32:50 +0000 (04:32 +0000)]
Auto merge of #79073 - davidtwco:issue-78957-const-param-attrs, r=lcnr

passes: prohibit invalid attrs on generic params

Fixes #78957.

This PR modifies the `check_attr` pass so that attribute placement on generic parameters is checked for validity.

r? `@lcnr`

3 years agoAuto merge of #77035 - mibac138:fn-fat-arrow-return, r=davidtwco
bors [Sat, 19 Dec 2020 01:47:05 +0000 (01:47 +0000)]
Auto merge of #77035 - mibac138:fn-fat-arrow-return, r=davidtwco

Gracefully handle mistyping -> as => in function return type

Fixes #77019

3 years agoAuto merge of #80154 - GuillaumeGomez:str-to-symbol, r=jyn514
bors [Fri, 18 Dec 2020 22:54:47 +0000 (22:54 +0000)]
Auto merge of #80154 - GuillaumeGomez:str-to-symbol, r=jyn514

Continue String to Symbol conversion in rustdoc (2)

Follow-up of #80119.

This is the last one (and I actually expected more conversions but seems like it was the last one remaining...).

r? `@jyn514`

3 years agoAuto merge of #80081 - ehuss:update-cargo, r=Mark-Simulacrum
bors [Fri, 18 Dec 2020 19:09:17 +0000 (19:09 +0000)]
Auto merge of #80081 - ehuss:update-cargo, r=Mark-Simulacrum

Update cargo

4 commits in d274fcf862b89264fa2c6b917b15230705257317..a3c2627fbc2f5391c65ba45ab53b81bf71fa323c
2020-12-07 23:08:44 +0000 to 2020-12-14 17:21:26 +0000
- Check if rerun-if-changed points to a directory. (rust-lang/cargo#8973)
- Implement external credential process. (RFC 2730) (rust-lang/cargo#8934)
- Revert recent build-std vendoring changes (rust-lang/cargo#8968)
- Fix the unit dependency graph with dev-dependency `links` (rust-lang/cargo#8969)

3 years agoAuto merge of #80156 - RalfJung:rollup-m3poz8z, r=RalfJung
bors [Fri, 18 Dec 2020 16:17:23 +0000 (16:17 +0000)]
Auto merge of #80156 - RalfJung:rollup-m3poz8z, r=RalfJung

Rollup of 6 pull requests

Successful merges:

 - #80121 (Change the message for `if_let_guard` feature gate)
 - #80130 (docs: Edit rustc_span::symbol::Symbol method)
 - #80135 (Don't allow `const` to begin a nonterminal)
 - #80145 (Fix typo in rustc_typeck docs)
 - #80146 (Edit formatting in Rust Prelude docs)
 - #80147 (Add missing punctuation to std::alloc docs)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agoUpdate cargo
Eric Huss [Wed, 16 Dec 2020 17:03:33 +0000 (09:03 -0800)]
Update cargo

3 years agoRollup merge of #80147 - pierwill:patch-9, r=lcnr
Ralf Jung [Fri, 18 Dec 2020 15:22:14 +0000 (16:22 +0100)]
Rollup merge of #80147 - pierwill:patch-9, r=lcnr

Add missing punctuation to std::alloc docs

Add a period to first line of module docs to match other modules in std.

3 years agoRollup merge of #80146 - pierwill:pierwill-prelude-mod-docs, r=lcnr
Ralf Jung [Fri, 18 Dec 2020 15:22:13 +0000 (16:22 +0100)]
Rollup merge of #80146 - pierwill:pierwill-prelude-mod-docs, r=lcnr

Edit formatting in Rust Prelude docs

Use consistent punctuation and capitalization in the list of things re-exported in the prelude.

Also adds a (possibly missing) word.

3 years agoRollup merge of #80145 - pierwill:patch-8, r=lcnr
Ralf Jung [Fri, 18 Dec 2020 15:22:11 +0000 (16:22 +0100)]
Rollup merge of #80145 - pierwill:patch-8, r=lcnr

Fix typo in rustc_typeck docs

3 years agoRollup merge of #80135 - camelid:const-macro-nt, r=petrochenkov
Ralf Jung [Fri, 18 Dec 2020 15:22:09 +0000 (16:22 +0100)]
Rollup merge of #80135 - camelid:const-macro-nt, r=petrochenkov

Don't allow `const` to begin a nonterminal

Fixes #79908.

Thanks to Vadim Petrochenkov who [told me what the fix was][z]!

[z]: https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/finding.20which.20macro.20rule.20to.20use/near/220240422

r? ``@petrochenkov``

3 years agoRollup merge of #80130 - pierwill:patch-7, r=oli-obk
Ralf Jung [Fri, 18 Dec 2020 15:22:07 +0000 (16:22 +0100)]
Rollup merge of #80130 - pierwill:patch-7, r=oli-obk

docs: Edit rustc_span::symbol::Symbol method

Edit wording of the doc comment for [rustc_span::symbol::Symbol::can_be_raw](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_span/symbol/struct.Symbol.html#method.can_be_raw) to match related methods.

3 years agoRollup merge of #80121 - LeSeulArtichaut:if-let-experimental, r=davidtwco
Ralf Jung [Fri, 18 Dec 2020 15:22:06 +0000 (16:22 +0100)]
Rollup merge of #80121 - LeSeulArtichaut:if-let-experimental, r=davidtwco

Change the message for `if_let_guard` feature gate

`if-let` guards are now implemented by #79051 ðŸŽ‰
Thanks ``@camelid`` for pointing this out ðŸ™‚

3 years agoAuto merge of #79485 - EllenNyan:stabilize_unsafe_cell_get_mut, r=m-ou-se
bors [Fri, 18 Dec 2020 11:39:26 +0000 (11:39 +0000)]
Auto merge of #79485 - EllenNyan:stabilize_unsafe_cell_get_mut, r=m-ou-se

Stabilize `unsafe_cell_get_mut`

Tracking issue: #76943

r? `@m-ou-se`

3 years agoContinue String to Symbol conversion in rustdoc
Guillaume Gomez [Fri, 18 Dec 2020 11:05:51 +0000 (12:05 +0100)]
Continue String to Symbol conversion in rustdoc

3 years agoAuto merge of #80090 - jyn514:tcx-in-render, r=GuillaumeGomez
bors [Fri, 18 Dec 2020 08:44:50 +0000 (08:44 +0000)]
Auto merge of #80090 - jyn514:tcx-in-render, r=GuillaumeGomez

Pass a `TyCtxt` through to `FormatRender`

This is the next step after https://github.com/rust-lang/rust/pull/79957 for https://github.com/rust-lang/rust/issues/76382. Eventually I plan to use this to remove `stability`, `const_stability`, and `deprecation` from `Item`, but that needs more extensive changes (in particular, https://github.com/rust-lang/rust/pull/75355 or something like it).

This has no actual changes to behavior, it's just moving types around.

ccc https://github.com/rust-lang/rust/pull/80014#issuecomment-746810284

3 years agoAuto merge of #80119 - GuillaumeGomez:str-to-symbol, r=jyn514
bors [Fri, 18 Dec 2020 05:55:24 +0000 (05:55 +0000)]
Auto merge of #80119 - GuillaumeGomez:str-to-symbol, r=jyn514

Continue String to Symbol conversion in rustdoc

Follow-up of https://github.com/rust-lang/rust/pull/80091.

This PR is already big enough so I'll stop here before the next one.

r? `@jyn514`

3 years agoAdd missing punctuation to std::alloc docs
pierwill [Fri, 18 Dec 2020 05:49:32 +0000 (21:49 -0800)]
Add missing punctuation to std::alloc docs

Add a period to first line of module docs to match other modules in std.

3 years agoEdit formatting in Rust Prelude docs
pierwill [Fri, 18 Dec 2020 05:17:43 +0000 (21:17 -0800)]
Edit formatting in Rust Prelude docs

Use consistent punctuation and capitalization in the list
of things re-exported in the prelude.

Also adds a (possibly missing) word.

3 years agoFix typo in rustc_typeck docs
pierwill [Fri, 18 Dec 2020 04:47:05 +0000 (20:47 -0800)]
Fix typo in rustc_typeck docs

3 years agoAuto merge of #80036 - sivadeilra:syms_no_macro, r=petrochenkov
bors [Fri, 18 Dec 2020 03:01:14 +0000 (03:01 +0000)]
Auto merge of #80036 - sivadeilra:syms_no_macro, r=petrochenkov

Stop using intermediate macros in definition of symbols

Currently, the rustc_macros::symbols macro generates two
`macro_rules!` macros as its output. These two macros are
used in rustc_span/src/symbol.rs.

This means that each Symbol that we define is represented
in the AST of rustc_symbols twice: once in the definition
of the `define_symbols!` macro (similarly for the
`keywords! macro), and once in the rustc_span::symbols
definition.

That would be OK if there were only a handful of symbols,
but currently we define over 1100 symbols. The definition
of the `define_symbols!` macro contains the expanded definition
of each symbol, so that's a lot of AST storage wasted on a
macro that is used exactly once.

This commit removes the `define_symbols` macro, and simply
allows the proc macro to directly generate the
`rustc_symbols::symbol::sym` module.

The benefit is mainly in reducing memory wasted during
compilation of rustc itself. It should also reduce memory used
by Rust Analyzer.

This commit also reduces the size of the AST for symbol
definitions, by moving two `#[allow(...)]` attributes from
the symbol constants to the `sym` module. This eliminates 2200+
attribute nodes.

This commit also eliminates the need for the `digits_array`
constant. There's no need to store an array of Symbol values
for digits. We can simply define a constant of the base value,
and add to that base value.

I left the `sym::integer` function in rustc_span/src/symbol.rs
instead of moving it into rustc_macros/src/symbols.rs for two
reasons. First, because it's human-written code; it doesn't need
to be generated by the proc-macro. Second, because I didn't want
the `#[allow(...)]` attributes that I moved to the `sym` module
scope to apply to this function. The `sym` module re-exports the
`integer` function from its parent module.

3 years agoAuto merge of #80138 - Dylan-DPC:rollup-qamsfyh, r=Dylan-DPC
bors [Fri, 18 Dec 2020 00:08:30 +0000 (00:08 +0000)]
Auto merge of #80138 - Dylan-DPC:rollup-qamsfyh, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #78164 (Prefer regions with an `external_name` in `approx_universal_upper_bound`)
 - #80003 (Fix overflow when converting ZST Vec to VecDeque)
 - #80023 (Enhance error message when misspelled label to value in break expression)
 - #80046 (Add more documentation to `Diagnostic` and `DiagnosticBuilder`)
 - #80109 (Remove redundant and unreliable coverage test results)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agoRollup merge of #80109 - richkadel:llvm-coverage-counters-2.3.0, r=tmandry
Dylan DPC [Thu, 17 Dec 2020 23:30:21 +0000 (00:30 +0100)]
Rollup merge of #80109 - richkadel:llvm-coverage-counters-2.3.0, r=tmandry

Remove redundant and unreliable coverage test results

The `coverage-reports` tests still generate counters and JSON reports
for inspection, but these files are no longer used in Makefile diffs, to
reduce complexity and confusion from unreliable or unexpected test
results, especially when maintaining them (i.e., generating `--bless`ed
results).

The associated `expected_` files for counters and JSON reports have been
removed, leaving only the files actually used for testing: the `llvm-cov
show` reports.

r? `@tmandry`

Tyler - as we discussed offline...

FYI: `@wesleywiser` `@Swatinem`

Arpad, depending on the timing of this PR, it may not affect you, but I'm removing some of the files that produce slightly different results on Windows as they really aren't necessary to validate coverage results.

3 years agoRollup merge of #80046 - camelid:diag-docs, r=lcnr
Dylan DPC [Thu, 17 Dec 2020 23:30:20 +0000 (00:30 +0100)]
Rollup merge of #80046 - camelid:diag-docs, r=lcnr

Add more documentation to `Diagnostic` and `DiagnosticBuilder`

cc `@estebank`

3 years agoRollup merge of #80023 - sasurau4:feature/enhance-error-message-when-wrongly-written...
Dylan DPC [Thu, 17 Dec 2020 23:30:18 +0000 (00:30 +0100)]
Rollup merge of #80023 - sasurau4:feature/enhance-error-message-when-wrongly-written-broken-label, r=lcnr

Enhance error message when misspelled label to value in break expression

Fix #79424

3 years agoRollup merge of #80003 - Stupremee:fix-zst-vecdeque-conversion-panic, r=dtolnay
Dylan DPC [Thu, 17 Dec 2020 23:30:11 +0000 (00:30 +0100)]
Rollup merge of #80003 - Stupremee:fix-zst-vecdeque-conversion-panic, r=dtolnay

Fix overflow when converting ZST Vec to VecDeque

```rust
let v = vec![(); 100];
let queue = VecDeque::from(v);
println!("{:?}", queue);
```
This code will currently panic with a capacity overflow.
This PR resolves this issue and makes the code run fine.

Resolves #78532

3 years agoRollup merge of #78164 - Aaron1011:fix/async-region-name, r=tmandry
Dylan DPC [Thu, 17 Dec 2020 23:30:09 +0000 (00:30 +0100)]
Rollup merge of #78164 - Aaron1011:fix/async-region-name, r=tmandry

Prefer regions with an `external_name` in `approx_universal_upper_bound`

Fixes #75785

When displaying a MIR borrowcheck error, we may need to find an upper
bound for a region, which gives us a region to point to in the error
message. However, a region might outlive multiple distinct universal
regions, in which case the only upper bound is 'static

To try to display a meaningful error message, we compute an
'approximate' upper bound by picking one of the universal regions.
Currently, we pick the region with the lowest index - however, this
caused us to produce a suboptimal error message in issue #75785

This PR `approx_universal_upper_bound` to prefer regions with an
`external_name`. This causes us to prefer regions from function
arguments/upvars, which seems to lead to a nicer error message in some
cases.

3 years agoStop using intermediate macros in definition of symbols
Arlie Davis [Mon, 14 Dec 2020 19:34:55 +0000 (11:34 -0800)]
Stop using intermediate macros in definition of symbols

Currently, the rustc_macros::symbols macro generates two
`macro_rules!` macros as its output. These two macros are
used in rustc_span/src/symbol.rs.

This means that each Symbol that we define is represented
in the AST of rustc_symbols twice: once in the definition
of the `define_symbols!` macro (similarly for the
`keywords! macro), and once in the rustc_span::symbols
definition.

That would be OK if there were only a handful of symbols,
but currently we define over 1100 symbols. The definition
of the `define_symbols!` macro contains the expanded definition
of each symbol, so that's a lot of AST storage wasted on a
macro that is used exactly once.

This commit removes the `define_symbols` macro, and simply
allows the proc macro to directly generate the
`rustc_symbols::symbol::sym` module.

The benefit is mainly in reducing memory wasted during
compilation of rustc itself. It should also reduce memory used
by Rust Analyzer.

This commit also reduces the size of the AST for symbol
definitions, by moving two `#[allow(...)]` attributes from
the symbol constants to the `sym` module. This eliminates 2200+
attribute nodes.

This commit also eliminates the need for the `digits_array`
constant. There's no need to store an array of Symbol values
for digits. We can simply define a constant of the base value,
and add to that base value.

3 years agoDon't allow `const` to begin a nonterminal
Camelid [Thu, 17 Dec 2020 21:51:20 +0000 (13:51 -0800)]
Don't allow `const` to begin a nonterminal

Thanks to Vadim Petrochenkov who [told me what the fix was][z]!

[z]: https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/finding.20which.20macro.20rule.20to.20use/near/220240422

3 years agoAuto merge of #80122 - davidtwco:revert-76030, r=oli-obk
bors [Thu, 17 Dec 2020 21:13:51 +0000 (21:13 +0000)]
Auto merge of #80122 - davidtwco:revert-76030, r=oli-obk

Revert "cg_llvm: `fewer_names` in `uncached_llvm_type`"

Fixes #76213 and fixes #79564.

This PR temporarily reverts commit fa01ce802f1b403a2140fd945b43af86ec3998a1 from #76030 to until the root issue can be resolved. Requested [in t-compiler meeting](https://rust-lang.zulipchat.com/#narrow/stream/238009-t-compiler.2Fmeetings/topic/.5Bweekly.20meeting.5D.202020-12-17.20.2354818/near/220261541).

*Note*: I was seeing some failing debuginfo-gdb tests locally but I wasn't sure if they were spurious.

3 years agodocs: Edit rustc_span::symbol::Symbol method
pierwill [Thu, 17 Dec 2020 20:02:34 +0000 (12:02 -0800)]
docs: Edit rustc_span::symbol::Symbol method

Edit wording of the doc comment for rustc_span::symbol::Symbol::can_be_raw
to match related methods.

3 years agoPrefer regions with an `external_name` in `approx_universal_upper_bound`
Aaron Hill [Tue, 20 Oct 2020 20:31:54 +0000 (16:31 -0400)]
Prefer regions with an `external_name` in `approx_universal_upper_bound`

Fixes #75785

When displaying a MIR borrowcheck error, we may need to find an upper
bound for a region, which gives us a region to point to in the error
message. However, a region might outlive multiple distinct universal
regions, in which case the only upper bound is 'static

To try to display a meaningful error message, we compute an
'approximate' upper bound by picking one of the universal regions.
Currently, we pick the region with the lowest index - however, this
caused us to produce a suboptimal error message in issue #75785

This PR `approx_universal_upper_bound` to prefer regions with an
`external_name`. This causes us to prefer regions from function
arguments/upvars, which seems to lead to a nicer error message in some
cases.

3 years agoAuto merge of #79945 - jackh726:existential_trait_ref, r=nikomatsakis
bors [Thu, 17 Dec 2020 18:21:20 +0000 (18:21 +0000)]
Auto merge of #79945 - jackh726:existential_trait_ref, r=nikomatsakis

Move binder for dyn to each list item

This essentially changes `ty::Binder<&'tcx List<ExistentialTraitRef>>` to `&'tcx List<ty::Binder<ExistentialTraitRef>>`.

This is a first step in moving the `dyn Trait` representation closer to Chalk, which we've talked about in `@rust-lang/wg-traits.`

r? `@nikomatsakis`

3 years agoContinue String to Symbol conversion in rustdoc
Guillaume Gomez [Thu, 17 Dec 2020 13:02:09 +0000 (14:02 +0100)]
Continue String to Symbol conversion in rustdoc

3 years agoRevert "cg_llvm: `fewer_names` in `uncached_llvm_type`"
David Wood [Thu, 17 Dec 2020 16:06:24 +0000 (16:06 +0000)]
Revert "cg_llvm: `fewer_names` in `uncached_llvm_type`"

This reverts commit fa01ce802f1b403a2140fd945b43af86ec3998a1.

3 years agoFix rebase conflict
Joshua Nelson [Thu, 17 Dec 2020 16:40:02 +0000 (11:40 -0500)]
Fix rebase conflict

3 years agoTODO -> FIXME
Joshua Nelson [Wed, 16 Dec 2020 21:22:11 +0000 (16:22 -0500)]
TODO -> FIXME

3 years agoFix error with `--cfg parallel_compiler`
Joshua Nelson [Wed, 16 Dec 2020 21:02:15 +0000 (16:02 -0500)]
Fix error with `--cfg parallel_compiler`

Apparently expansion() really does return Rc, not Lrc

3 years agoMake it compile
Joshua Nelson [Wed, 16 Dec 2020 19:34:08 +0000 (14:34 -0500)]
Make it compile

3 years ago[tmp] Pass `TyCtxt` through to the render backend
Joshua Nelson [Wed, 16 Dec 2020 19:23:14 +0000 (14:23 -0500)]
[tmp] Pass `TyCtxt` through to the render backend

First actually useful step in https://github.com/rust-lang/rust/issues/76382

This doesn't yet compile because there's no way to get a `Lrc<Session>`
from a TyCtxt, only a `&Session`.

3 years agoMove `run_renderer` into the main `global_ctxt` closure
Joshua Nelson [Sat, 12 Dec 2020 02:57:48 +0000 (21:57 -0500)]
Move `run_renderer` into the main `global_ctxt` closure

3 years agoSeparate `create_resolver` into a new function
Joshua Nelson [Sat, 12 Dec 2020 02:46:58 +0000 (21:46 -0500)]
Separate `create_resolver` into a new function

3 years agoSplit apart create_config and run_core
Joshua Nelson [Sat, 12 Dec 2020 02:37:14 +0000 (21:37 -0500)]
Split apart create_config and run_core

3 years agoChange the message for `if_let_guard` feature gate
LeSeulArtichaut [Thu, 17 Dec 2020 15:56:59 +0000 (16:56 +0100)]
Change the message for `if_let_guard` feature gate

3 years agoAuto merge of #80113 - davidtwco:issue-80086-ci-llvm-stamp, r=Mark-Simulacrum
bors [Thu, 17 Dec 2020 14:52:50 +0000 (14:52 +0000)]
Auto merge of #80113 - davidtwco:issue-80086-ci-llvm-stamp, r=Mark-Simulacrum

bootstrap: update ci-llvm stamp after #80087

Fixes #80086.

Unfortunately, #80087 forgot to update the ci-llvm stamp, so the updated ci-llvm tarball with `llvm-dwp` wasn't downloaded by users. This PR updates the ci-llvm stamp to resolve that problem.

r? `@Mark-Simulacrum`

3 years agoAddress review comments
mibac138 [Thu, 17 Dec 2020 12:44:08 +0000 (13:44 +0100)]
Address review comments

3 years agoAuto merge of #80114 - GuillaumeGomez:rollup-gszr5kn, r=GuillaumeGomez
bors [Thu, 17 Dec 2020 12:02:29 +0000 (12:02 +0000)]
Auto merge of #80114 - GuillaumeGomez:rollup-gszr5kn, r=GuillaumeGomez

Rollup of 5 pull requests

Successful merges:

 - #80006 (BTreeMap: more expressive local variables in merge)
 - #80022 (BTreeSet: simplify implementation of pop_first/pop_last)
 - #80035 (Optimization for bool's PartialOrd impl)
 - #80040 (Always run intrinsics lowering pass)
 - #80047 (Use more symbols in rustdoc)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agoAdd test case for break expr with misspelled value
Daiki Ihara [Mon, 14 Dec 2020 12:14:17 +0000 (21:14 +0900)]
Add test case for break expr with misspelled value

Update src/test/ui/loops/loop-break-value.rs

Co-authored-by: Ivan Tham <pickfire@riseup.net>
3 years agoEnhance error message when misspelled label to value in break expression
Daiki Ihara [Mon, 14 Dec 2020 12:13:40 +0000 (21:13 +0900)]
Enhance error message when misspelled label to value in break expression

Apply suggestions from code review

Co-authored-by: lcnr <bastian_kauschke@hotmail.de>
3 years agoRollup merge of #80047 - jyn514:more-symbols, r=GuillaumeGomez
Guillaume Gomez [Thu, 17 Dec 2020 10:36:54 +0000 (11:36 +0100)]
Rollup merge of #80047 - jyn514:more-symbols, r=GuillaumeGomez

Use more symbols in rustdoc

Builds on https://github.com/rust-lang/rust/pull/80044 and should not be merged before.

I want to test if this is actually faster before merging it, there was a lot of `to_string()` calls so I'm not sure it will actually help. That means I have to wait for 80044 to get merged before running perf.

r? `@ghost`

3 years agoRollup merge of #80040 - tmiasko:always-lower-intrinsics, r=Dylan-DPC
Guillaume Gomez [Thu, 17 Dec 2020 10:36:52 +0000 (11:36 +0100)]
Rollup merge of #80040 - tmiasko:always-lower-intrinsics, r=Dylan-DPC

Always run intrinsics lowering pass

Move intrinsics lowering pass from the optimization phase (where it
would not run if -Zmir-opt-level=0), to the drop lowering phase where it
runs unconditionally.

The implementation of those intrinsics in code generation and
interpreter is unnecessary. Remove it.

3 years agoRollup merge of #80035 - ChayimFriedman2:patch-1, r=nagisa
Guillaume Gomez [Thu, 17 Dec 2020 10:36:51 +0000 (11:36 +0100)]
Rollup merge of #80035 - ChayimFriedman2:patch-1, r=nagisa

Optimization for bool's PartialOrd impl

Fix #80034.

3 years agoRollup merge of #80022 - ssomers:btree_cleanup_8, r=Mark-Simulacrum
Guillaume Gomez [Thu, 17 Dec 2020 10:36:49 +0000 (11:36 +0100)]
Rollup merge of #80022 - ssomers:btree_cleanup_8, r=Mark-Simulacrum

BTreeSet: simplify implementation of pop_first/pop_last

…and stop it interfering in #79245.
r? ```````@Mark-Simulacrum```````

3 years agoRollup merge of #80006 - ssomers:btree_cleanup_6, r=Mark-Simulacrum
Guillaume Gomez [Thu, 17 Dec 2020 10:36:47 +0000 (11:36 +0100)]
Rollup merge of #80006 - ssomers:btree_cleanup_6, r=Mark-Simulacrum

BTreeMap: more expressive local variables in merge

r? ```````@Mark-Simulacrum```````

3 years agobootstrap: update ci-llvm stamp after #80087
David Wood [Thu, 17 Dec 2020 10:29:58 +0000 (10:29 +0000)]
bootstrap: update ci-llvm stamp after #80087

Unfortunately, #80087 forgot to update the ci-llvm stamp, so the updated
ci-llvm tarball with `llvm-dwp` wasn't downloaded by users. This commit
updates the ci-llvm stamp to resolve that problem.

Signed-off-by: David Wood <david@davidtw.co>
3 years agoAuto merge of #79840 - dvtkrlbs:issue-79667, r=oli-obk
bors [Thu, 17 Dec 2020 09:11:28 +0000 (09:11 +0000)]
Auto merge of #79840 - dvtkrlbs:issue-79667, r=oli-obk

Remove memoization leftovers from constant evaluation machine

Closes #79667

3 years agoRemove redundant and unreliable coverage test results
Rich Kadel [Thu, 17 Dec 2020 06:07:40 +0000 (22:07 -0800)]
Remove redundant and unreliable coverage test results

The `coverage-reports` tests still generate counters and JSON reports
for inspection, but these files are no longer used in Makefile diffs, to
reduce complexity and confusion from unreliable or unexpected test
results, especially when maintaining them (i.e., generating `--bless`ed
results).

The associated `expected_` files for counters and JSON reports have been
removed, leaving only the files actually used for testing: the `llvm-cov
show` reports.

3 years agoAuto merge of #80091 - GuillaumeGomez:str-to-symbol, r=jyn514
bors [Thu, 17 Dec 2020 06:00:12 +0000 (06:00 +0000)]
Auto merge of #80091 - GuillaumeGomez:str-to-symbol, r=jyn514

Replace String with Symbol where possible

The same as #80047 but on different types. Might be interesting to run some perf comparison.

r? `@jyn514`

3 years agoAuto merge of #80105 - JohnTitor:rollup-8c030u5, r=JohnTitor
bors [Thu, 17 Dec 2020 03:07:09 +0000 (03:07 +0000)]
Auto merge of #80105 - JohnTitor:rollup-8c030u5, r=JohnTitor

Rollup of 11 pull requests

Successful merges:

 - #79051 (Implement if-let match guards)
 - #79877 (Allow `since="TBD"` for rustc_deprecated)
 - #79882 (Fix issue #78496)
 - #80026 (expand-yaml-anchors: Make the output directory separator-insensitive)
 - #80039 (Remove unused `TyEncoder::tcx` required method)
 - #80069 (Test that `core::assert!` is valid)
 - #80072 (Fixed conflict with drop elaboration and coverage)
 - #80073 (Add support for target aliases)
 - #80082 (Revert #78790 - rust-src vendoring)
 - #80097 (Add `popcount` and `popcnt` as doc aliases for `count_ones` methods.)
 - #80103 (Remove docs for non-existent parameters in `rustc_expand`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agoRollup merge of #80103 - camelid:remove-docs-old-params-rustc_expand, r=jyn514
Yuki Okushi [Thu, 17 Dec 2020 02:44:13 +0000 (11:44 +0900)]
Rollup merge of #80103 - camelid:remove-docs-old-params-rustc_expand, r=jyn514

Remove docs for non-existent parameters in `rustc_expand`

3 years agoRollup merge of #80097 - SimonSapin:popcount, r=m-ou-se
Yuki Okushi [Thu, 17 Dec 2020 02:44:12 +0000 (11:44 +0900)]
Rollup merge of #80097 - SimonSapin:popcount, r=m-ou-se

Add `popcount` and `popcnt` as doc aliases for `count_ones` methods.

Integer types have a `count_ones` method that end up calling `intrinsics::ctpop`. On some architectures, that intrinsic is translated as a corresponding CPU instruction know as "popcount" or "popcnt".

This PR makes it so that searching for those names in rustdoc shows those methods.

CC https://blog.rust-lang.org/2020/11/19/Rust-1.48.html#adding-search-aliases

3 years agoRollup merge of #80082 - ehuss:revert-rust-src-vendor, r=Mark-Simulacrum
Yuki Okushi [Thu, 17 Dec 2020 02:44:10 +0000 (11:44 +0900)]
Rollup merge of #80082 - ehuss:revert-rust-src-vendor, r=Mark-Simulacrum

Revert #78790 - rust-src vendoring

This reverts the rust-src vendor changes from #78790. There were a few issues (see #79218, https://github.com/rust-lang/cargo/issues/8962, https://github.com/rust-lang/cargo/issues/8963), that I don't think will get fixed in the next few days before the beta branch.

Fixes #79218

3 years agoRollup merge of #80073 - kulikjak:add-target-alias-support, r=varkor
Yuki Okushi [Thu, 17 Dec 2020 02:44:08 +0000 (11:44 +0900)]
Rollup merge of #80073 - kulikjak:add-target-alias-support, r=varkor

Add support for target aliases

Closes #68214, see that for more info.

`@varkor`

3 years agoRollup merge of #80072 - richkadel:llvm-coverage-counters-2.2.1, r=tmandry
Yuki Okushi [Thu, 17 Dec 2020 02:44:06 +0000 (11:44 +0900)]
Rollup merge of #80072 - richkadel:llvm-coverage-counters-2.2.1, r=tmandry

Fixed conflict with drop elaboration and coverage

See
https://github.com/rust-lang/rust/issues/80045#issuecomment-745733339

Coverage statements are moved to the beginning of the BCB. This does
also affect what's counted before a panic, changing some results, but I
think these results may even be preferred? In any case, there are no
guarantees about what's counted when a panic occurs (by design).

r? `@tmandry`

FYI `@wesleywiser` `@ecstatic-morse`

3 years agoRollup merge of #80069 - jyn514:core-assert, r=dtolnay
Yuki Okushi [Thu, 17 Dec 2020 02:44:05 +0000 (11:44 +0900)]
Rollup merge of #80069 - jyn514:core-assert, r=dtolnay

Test that `core::assert!` is valid

Closes https://github.com/rust-lang/rust/issues/55482.

r? `@dtolnay`

3 years agoRollup merge of #80039 - LeSeulArtichaut:rm-tyencoder-tcx, r=matthewjasper
Yuki Okushi [Thu, 17 Dec 2020 02:44:03 +0000 (11:44 +0900)]
Rollup merge of #80039 - LeSeulArtichaut:rm-tyencoder-tcx, r=matthewjasper

Remove unused `TyEncoder::tcx` required method

Unsure if this is helpful or not...

r? ``@ghost`` cc ``@matthewjasper`` ``@jackh726``

3 years agoRollup merge of #80026 - JohnTitor:separator-insensitive, r=Mark-Simulacrum
Yuki Okushi [Thu, 17 Dec 2020 02:44:01 +0000 (11:44 +0900)]
Rollup merge of #80026 - JohnTitor:separator-insensitive, r=Mark-Simulacrum

expand-yaml-anchors: Make the output directory separator-insensitive

Fixes #75709

3 years agoRollup merge of #79882 - wecing:master, r=oli-obk
Yuki Okushi [Thu, 17 Dec 2020 02:43:59 +0000 (11:43 +0900)]
Rollup merge of #79882 - wecing:master, r=oli-obk

Fix issue #78496

EarlyOtherwiseBranch finds MIR structures like:

```
bb0: {
  ...
  _2 = discriminant(X)
  ...
  switchInt(_2) -> [1_isize: bb1, otherwise: bb3]
}
bb1: {
  ...
  _3 = discriminant(Y)
  ...
  switchInt(_3) -> [1_isize: bb2, otherwise: bb3]
}
bb2: {...}
bb3: {...}
```

And transforms them into something like:

```
bb0: {
  ...
  _2 = discriminant(X)
  _3 = discriminant(Y)
  _4 = Eq(_2, _3)
  switchInt(_4) -> [true: bb4, otherwise: bb3]
}
bb2: {...} // unchanged
bb3: {...} // unchanged
bb4: {
  switchInt(_2) -> [1_isize: bb2, otherwise: bb3]
}
```

But that is not always a safe thing to do -- sometimes the early `otherwise` branch is necessary so the later block could assume the value of `discriminant(X)`.

I am not totally sure what's the best way to detect that, but fixing #78496 should be easy -- we just check if `X` is a sub-expression of `Y`. A more precise test might be to check if `Y` contains a `Downcast(1)` of `X`, but I think this might be good enough.

Fix #78496

3 years agoRollup merge of #79877 - bstrie:depinfut, r=oli-obk
Yuki Okushi [Thu, 17 Dec 2020 02:43:57 +0000 (11:43 +0900)]
Rollup merge of #79877 - bstrie:depinfut, r=oli-obk

Allow `since="TBD"` for rustc_deprecated

Closes #78381.

This PR only affects `#[rustc_deprecated]`, not `#[deprecated]`, so there is no effect on any stable language feature.

Likewise this PR only implements `since="TBD"`, it does not actually tag any library functions with it, so there is no effect on any stable API.

Overview of changes:

* `rustc_middle/stability.rs`:
    * change `deprecation_in_effect` function to return `false` when `since="TBD"`
    * tidy up the compiler output when a deprecated item has `since="TBD"`
* `rustc_passes/stability.rs`:
    * allow `since="TBD"` to pass the sanity check for stable_version < deprecated_version
    * refactor the "invalid stability version" and "invalid deprecation version" error into separate errors
* rustdoc: make `since="TBD"` message on a deprecated item's page match the command-line deprecation output
* tests:
    * test rustdoc output
    * test that the `deprecated_in_future` lint fires when `since="TBD"`
    * test the new "invalid deprecation version" error message

3 years agoRollup merge of #79051 - LeSeulArtichaut:if-let-guard, r=matthewjasper
Yuki Okushi [Thu, 17 Dec 2020 02:43:55 +0000 (11:43 +0900)]
Rollup merge of #79051 - LeSeulArtichaut:if-let-guard, r=matthewjasper

Implement if-let match guards

Implements rust-lang/rfcs#2294 (tracking issue: #51114).

I probably should do a few more things before this can be merged:
- [x] Add tests (added basic tests, more advanced tests could be done in the future?)
- [x] Add lint for exhaustive if-let guard (comparable to normal if-let statements)
- [x] Fix clippy

However since this is a nightly feature maybe it's fine to land this and do those steps in follow-up PRs.

Thanks a lot `@matthewjasper` :heart: for helping me with lowering to MIR! Would you be interested in reviewing this?
r? `@ghost` for now

3 years agoRemove docs for non-existent parameters in `rustc_expand`
Camelid [Thu, 17 Dec 2020 01:34:47 +0000 (17:34 -0800)]
Remove docs for non-existent parameters in `rustc_expand`

3 years agoBless NLL test
Jack Huey [Thu, 17 Dec 2020 01:15:57 +0000 (20:15 -0500)]
Bless NLL test

3 years agoAuto merge of #79790 - LeSeulArtichaut:issue-79683, r=lcnr
bors [Thu, 17 Dec 2020 00:15:45 +0000 (00:15 +0000)]
Auto merge of #79790 - LeSeulArtichaut:issue-79683, r=lcnr

Take into account negative impls in "trait item not found" suggestions

This removes the suggestion to implement a trait for a type when that type already has a negative implementation for the trait, and replaces it with a note to point out that the trait is explicitely unimplemented, as suggested by `@scottmcm.`

Helps with #79683.

r? `@scottmcm` do you want to review this?

3 years agoAdd `popcount` and `popcnt` as doc aliases for `count_ones` methods.
Simon Sapin [Wed, 16 Dec 2020 22:51:18 +0000 (23:51 +0100)]
Add `popcount` and `popcnt` as doc aliases for `count_ones` methods.

Integer types have a `count_ones` method that end up calling
`intrinsics::ctpop`.
On some architectures, that intrinsic is translated as a corresponding
CPU instruction know as "popcount" or "popcnt".

This PR makes it so that searching for those names in rustdoc shows those methods.

CC https://blog.rust-lang.org/2020/11/19/Rust-1.48.html#adding-search-aliases

3 years agoFix typo in method name
Camelid [Tue, 15 Dec 2020 04:05:31 +0000 (20:05 -0800)]
Fix typo in method name

unsuccessfull -> unsuccessful

3 years agoAdd more documentation to `Diagnostic` and `DiagnosticBuilder`
Camelid [Tue, 15 Dec 2020 04:03:19 +0000 (20:03 -0800)]
Add more documentation to `Diagnostic` and `DiagnosticBuilder`

3 years agoReplace String with Symbol where possible
Guillaume Gomez [Wed, 16 Dec 2020 16:21:08 +0000 (17:21 +0100)]
Replace String with Symbol where possible

3 years agoAuto merge of #80087 - davidtwco:issue-80086-llvm-dwp-in-ci-llvm, r=Mark-Simulacrum
bors [Wed, 16 Dec 2020 19:36:22 +0000 (19:36 +0000)]
Auto merge of #80087 - davidtwco:issue-80086-llvm-dwp-in-ci-llvm, r=Mark-Simulacrum

bootstrap: include llvm-dwp in CI LLVM

Fixes #80086.

This PR includes the `llvm-dwp` tool in the CI LLVM (which rustc developers can download instead of building LLVM locally) - `llvm-dwp` is required by Split DWARF which landed in PR #77117.

r? `@Mark-Simulacrum`

3 years agobootstrap: include llvm-dwp in CI LLVM
David Wood [Wed, 16 Dec 2020 19:16:36 +0000 (19:16 +0000)]
bootstrap: include llvm-dwp in CI LLVM

This commit includes the `llvm-dwp` tool in the CI LLVM (which rustc
developers can download instead of building LLVM locally) - `llvm-dwp`
is required by Split DWARF which landed in PR #77117.

Signed-off-by: David Wood <david@davidtw.co>
3 years agoAllow `since="TBD"` for rustc_deprecated
bstrie [Wed, 9 Dec 2020 23:26:42 +0000 (18:26 -0500)]
Allow `since="TBD"` for rustc_deprecated

3 years agoRevert "Auto merge of #78790 - Gankra:rust-src-vendor, r=Mark-Simulacrum"
Eric Huss [Wed, 16 Dec 2020 17:10:40 +0000 (09:10 -0800)]
Revert "Auto merge of #78790 - Gankra:rust-src-vendor, r=Mark-Simulacrum"

This reverts commit 7afc5172305cdae588a0318ce545749cf4ed947d, reversing
changes made to d4ea0b3e46a0303d5802b632e88ba1ba84d9d16f.

3 years agoTake into account negative impls in "trait item not found" suggestions
LeSeulArtichaut [Mon, 7 Dec 2020 11:34:27 +0000 (12:34 +0100)]
Take into account negative impls in "trait item not found" suggestions

3 years agoAuto merge of #77117 - davidtwco:issue-34651-split-dwarf, r=nagisa
bors [Wed, 16 Dec 2020 12:51:42 +0000 (12:51 +0000)]
Auto merge of #77117 - davidtwco:issue-34651-split-dwarf, r=nagisa

cg_llvm: split dwarf support

cc #34651

This PR adds initial support for Split DWARF to rustc, based on the implementation in Clang.

##### Current Status
This PR currently has functioning split-dwarf, running rustc with `-Zsplit-dwarf=split` when compiling a binary will produce a `dwp` alongside the binary, which contains the linked dwarf objects.

```shell-session
$ rustc -Cdebuginfo=2 -Zsplit-dwarf=split -C save-temps ./foo.rs
$ ls foo*
foo
foo.belfx9afw9cmv8.rcgu.dwo
foo.belfx9afw9cmv8.rcgu.o
foo.foo.7rcbfp3g-cgu.0.rcgu.dwo
foo.foo.7rcbfp3g-cgu.0.rcgu.o
foo.foo.7rcbfp3g-cgu.1.rcgu.dwo
foo.foo.7rcbfp3g-cgu.1.rcgu.o
foo.foo.7rcbfp3g-cgu.2.rcgu.dwo
foo.foo.7rcbfp3g-cgu.2.rcgu.o
foo.foo.7rcbfp3g-cgu.3.rcgu.dwo
foo.foo.7rcbfp3g-cgu.3.rcgu.o
foo.foo.7rcbfp3g-cgu.4.rcgu.dwo
foo.foo.7rcbfp3g-cgu.4.rcgu.o
foo.foo.7rcbfp3g-cgu.5.rcgu.dwo
foo.foo.7rcbfp3g-cgu.5.rcgu.o
foo.foo.7rcbfp3g-cgu.6.rcgu.dwo
foo.foo.7rcbfp3g-cgu.6.rcgu.o
foo.foo.7rcbfp3g-cgu.7.rcgu.dwo
foo.foo.7rcbfp3g-cgu.7.rcgu.o
foo.dwp
foo.rs
$ readelf -wi foo.foo.7rcbfp3g-cgu.0.rcgu.o
# ...
  Compilation Unit @ offset 0x90:
   Length:        0x2c (32-bit)
   Version:       4
   Abbrev Offset: 0x5b
   Pointer Size:  8
 <0><9b>: Abbrev Number: 1 (DW_TAG_compile_unit)
    <9c>   DW_AT_stmt_list   : 0xe8
    <a0>   DW_AT_comp_dir    : (indirect string, offset: 0x13b): /home/david/Projects/rust/rust0
    <a4>   DW_AT_GNU_dwo_name: (indirect string, offset: 0x15b): foo.foo.7rcbfp3g-cgu.0.rcgu.dwo
    <a8>   DW_AT_GNU_dwo_id  : 0x357472a2b032d7b9
    <b0>   DW_AT_low_pc      : 0x0
    <b8>   DW_AT_ranges      : 0x40
    <bc>   DW_AT_GNU_addr_base: 0x0
# ...
```

##### To-Do
I've opened this PR as a draft to get feedback and work out how we'd expect rustc to work when Split DWARF is requested. It might be easier to read the PR commit-by-commit.

- [ ] Add error when Split DWARF is requested on platforms where it doesn't make sense.
- [x] Determine whether or not there should be a single `dwo` output from rustc, or one per codegen-unit as exists currently.
- [x] Add tests.
- [x] Fix `single` mode - currently single mode doesn't change the invocation of `addPassesToEmitFile`, which is correct, but it also needs to change the split dwarf path provided to `createCompileUnit` and `createTargetMachine` so that it's just the final binary (currently it is still a non-existent `dwo` file).

r? `@nagisa`
cc `@michaelwoerister` `@eddyb` `@alexcrichton` `@rust-lang/wg-incr-comp`

3 years agocg_llvm: split dwarf filename and comp dir
David Wood [Sun, 8 Nov 2020 17:17:37 +0000 (17:17 +0000)]
cg_llvm: split dwarf filename and comp dir

llvm-dwp concatenates `DW_AT_comp_dir` with `DW_AT_GNU_dwo_name` (only
when `DW_AT_comp_dir` exists), which can result in it failing to find
the DWARF object files.

In earlier testing, `DW_AT_comp_dir` wasn't present in the final
object and the current directory was the output directory.

When running tests through compiletest, the working directory of the
compilation is different from output directory and that resulted in
`DW_AT_comp_dir` being in the object file (and set to the current
working directory, rather than the output directory), and
`DW_AT_GNU_dwo_name` being set to the full path (rather than just
the filename), so llvm-dwp was failing.

This commit changes the compilation directory provided to LLVM to match
the output directory, where DWARF objects are output; and ensures that
only the filename is used for `DW_AT_GNU_dwo_name`.

Signed-off-by: David Wood <david@davidtw.co>
3 years agocompiletest: add split dwarf compare mode
David Wood [Sun, 8 Nov 2020 17:27:33 +0000 (17:27 +0000)]
compiletest: add split dwarf compare mode

This commit adds a Split DWARF compare mode to compiletest so that
debuginfo tests are also tested using Split DWARF in split mode (and
manually in single mode).

Signed-off-by: David Wood <david@davidtw.co>
3 years agotests: add run-make-fulldeps split-dwarf test
David Wood [Sun, 8 Nov 2020 17:26:59 +0000 (17:26 +0000)]
tests: add run-make-fulldeps split-dwarf test

This commit adds a run-make-fulldeps test which checks that a DWARF
package file is emitted.

Signed-off-by: David Wood <david@davidtw.co>
3 years agocg_clif: fix build with split dwarf
David Wood [Sun, 8 Nov 2020 14:01:23 +0000 (14:01 +0000)]
cg_clif: fix build with split dwarf

This commit makes minor changes to the cranelift backend so that it can
build given changes in cg_ssa for Split DWARF.

Signed-off-by: David Wood <david@davidtw.co>
3 years agocg_llvm: implement split dwarf support
David Wood [Wed, 23 Sep 2020 16:33:54 +0000 (17:33 +0100)]
cg_llvm: implement split dwarf support

This commit implements Split DWARF support, wiring up the flag (added in
earlier commits) to the modified FFI wrapper (also from earlier
commits).

Signed-off-by: David Wood <david@davidtw.co>
3 years agobootstrap: copy `llvm-dwp` to sysroot
David Wood [Wed, 14 Oct 2020 17:16:05 +0000 (18:16 +0100)]
bootstrap: copy `llvm-dwp` to sysroot

`llvm-dwp` is required for linking the DWARF objects into DWARF packages
when using Split DWARF, especially given that rustc produces multiple
DWARF objects (one for each codegen unit).

Signed-off-by: David Wood <david@davidtw.co>
3 years agocg_ssa: introduce `TargetMachineFactoryFn` alias
David Wood [Wed, 23 Sep 2020 15:57:50 +0000 (16:57 +0100)]
cg_ssa: introduce `TargetMachineFactoryFn` alias

This commit removes the `TargetMachineFactory` struct and adds a
`TargetMachineFactoryFn` type alias which is used everywhere that the
previous, long type was used.

Signed-off-by: David Wood <david@davidtw.co>
3 years agocg_ssa: correct documentation comments
David Wood [Wed, 14 Oct 2020 14:52:16 +0000 (15:52 +0100)]
cg_ssa: correct documentation comments

This commit changes some comments to documentation comments so that
they can be read on the generated rustdoc.

Signed-off-by: David Wood <david@davidtw.co>
3 years agosession: add `split-dwarf` flag
David Wood [Wed, 23 Sep 2020 15:50:58 +0000 (16:50 +0100)]
session: add `split-dwarf` flag

This commit adds a flag for Split DWARF, which enables debuginfo to be
split into multiple files.

Signed-off-by: David Wood <david@davidtw.co>
3 years agollvm: update ffi bindings for split dwarf
David Wood [Wed, 23 Sep 2020 15:25:20 +0000 (16:25 +0100)]
llvm: update ffi bindings for split dwarf

This commit modifies the FFI bindings to LLVM required for Split DWARF
support in rustc. In particular:

- `addPassesToEmitFile`'s wrapper, `LLVMRustWriteOutputFile` now takes
  a `DwoPath` `const char*`. When disabled, `nullptr` should be provided
  which will preserve existing behaviour. When enabled, the path to the
  `.dwo` file should be provided.
- `createCompileUnit`'s wrapper, `LLVMRustDIBuilderCreateCompileUnit`
  now has two additional arguments, for the `DWOId` and to enable
  `SplitDebugInlining`. `DWOId` should always be zero.
- `createTargetMachine`'s wrapper, `LLVMRustCreateTargetMachine` has an
  additional argument which should be provided the path to the `.dwo`
  when enabled.

Signed-off-by: David Wood <david@davidtw.co>
3 years agoAdd support for target aliases
Jakub Kulik [Wed, 16 Dec 2020 09:41:07 +0000 (10:41 +0100)]
Add support for target aliases

3 years agoAuto merge of #79682 - jyn514:no-blanket-impls, r=Manishearth,GuillaumeGomez
bors [Wed, 16 Dec 2020 09:13:14 +0000 (09:13 +0000)]
Auto merge of #79682 - jyn514:no-blanket-impls, r=Manishearth,GuillaumeGomez

Don't look for blanket impls in intra-doc links

This never worked and has been causing severe performance problems.
Hopefully it will be re-landed at some point in the future when it
actually works, but in the meantime it makes no sense to have the code
around when it does nothing and actively makes rustdoc harder to use.

Closes https://github.com/rust-lang/rust/issues/78761. Does *not* affect https://github.com/rust-lang/rust/issues/78800.

r? `@Manishearth`
cc `@seeplusplus`

3 years agoFixed conflict with drop elaboration and coverage
Rich Kadel [Wed, 16 Dec 2020 07:33:47 +0000 (23:33 -0800)]
Fixed conflict with drop elaboration and coverage

See
https://github.com/rust-lang/rust/issues/80045#issuecomment-745733339

Coverage statements are moved to the beginning of the BCB. This does
also affect what's counted before a panic, changing some results, but I
think these results may even be preferred? In any case, there are no
guarantees about what's counted when a panic occurs (by design).

3 years agoAuto merge of #79607 - DrMeepster:maybe_uninit_write_slice, r=m-ou-se
bors [Wed, 16 Dec 2020 06:26:51 +0000 (06:26 +0000)]
Auto merge of #79607 - DrMeepster:maybe_uninit_write_slice, r=m-ou-se

MaybeUninit::copy/clone_from_slice

This PR adds 2 new methods to MaybeUninit under the feature of `maybe_uninit_write_slice`: `copy_from_slice` and `clone_from_slice`.

These are useful for initializing uninitialized buffers (such as the one returned by `Vec::spare_capacity_mut` for example) with initialized data.

The methods behave similarly to the methods on slices, but the destination is uninitialized and they return the destination slice as an initialized slice.

3 years agoAuto merge of #80041 - jyn514:shrink-item, r=GuillaumeGomez
bors [Wed, 16 Dec 2020 03:35:08 +0000 (03:35 +0000)]
Auto merge of #80041 - jyn514:shrink-item, r=GuillaumeGomez

Get rid of `clean::Deprecation`

This brings the size of `item.deprecation` from 56 to 16 bytes. Helps with #79103 and https://github.com/rust-lang/rust/issues/76382, in the same vein as https://github.com/rust-lang/rust/pull/79957.

r? `@GuillaumeGomez`

3 years agoUse `Symbol`s for crate names
Joshua Nelson [Tue, 15 Dec 2020 04:23:58 +0000 (23:23 -0500)]
Use `Symbol`s for crate names

3 years agoRemove redundant assignment
Joshua Nelson [Tue, 15 Dec 2020 03:28:24 +0000 (22:28 -0500)]
Remove redundant assignment

`crate.name` is already set by `tcx.crate_name`, there's no need to
override it.

3 years agoTest that `core::assert!` is valid
Joshua Nelson [Wed, 16 Dec 2020 01:47:06 +0000 (20:47 -0500)]
Test that `core::assert!` is valid