Commit graph

142778 commits

Author SHA1 Message Date
bors
ca075d268d Auto merge of #83386 - mark-i-m:stabilize-pat2015, r=nikomatsakis
Stabilize `:pat_param` and remove `:pat2021`

Blocked on #83384

cc `@rust-lang/lang` #79278

If I understand `@nikomatsakis` in  https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/or.20patterns/near/231133873, another FCP is not needed.

r? `@nikomatsakis`
2021-04-28 20:35:17 +00:00
Eric Huss
8dc09e1d04 Update books 2021-04-28 11:28:57 -07:00
bors
da43ee8d82 Auto merge of #84650 - a1phyr:simplify_mutex_into_inner, r=m-ou-se
Simplify `Mutex::into_inner`

Thanks to #77147, `Mutex` do not implement `Drop` directly, so the old unsafe implementation of `into_inner` is not relevant anymore.
2021-04-28 18:08:01 +00:00
bjorn3
beb4e312c8 Rustup to rustc 1.53.0-nightly (727d10156 2021-04-27) 2021-04-28 19:41:10 +02:00
Amanieu d'Antras
e6a731eb90 Be stricter about rejecting LLVM reserved registers in asm! 2021-04-28 18:30:36 +01:00
Michael Howell
b57049acdb rustdoc: update auto_aliases test case with data-aliases attribute 2021-04-28 10:29:08 -07:00
Michael Howell
153eb72d65 rustdoc: change aliases attribute to data-aliases
The "aliases" attribute is not listed [on MDN], so it sounds like
it's rustdoc-specific. We don't want to conflict with any attributes
that are added to the spec in the future.

[on MDN]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements
2021-04-28 10:29:08 -07:00
Christiaan Dirkx
1ac632627b Remove DropGuard in sys::windows::process and use StaticMutex instead 2021-04-28 19:11:57 +02:00
pierwill
8b806bcd41
Remove extra word in rustc_mir docs
Changes "is includes" to "includes" in `rustc_mir::borrow_check::type_check::type_check`.
2021-04-28 09:53:32 -07:00
bors
c488f15700 Auto merge of #84645 - lnicola:rust-analyzer-2021-04-26, r=jonas-schievink
⬆️ rust-analyzer
2021-04-28 15:46:26 +00:00
Jack Huey
31ae3b2bdb Add HAS_RE_LATE_BOUND if there are bound vars 2021-04-28 10:18:52 -04:00
bors
20040fa332 Auto merge of #84562 - richkadel:issue-83601, r=tmandry
Adds feature-gated `#[no_coverage]` function attribute, to fix derived Eq `0` coverage issue #83601

Derived Eq no longer shows uncovered

The Eq trait has a special hidden function. MIR `InstrumentCoverage`
would add this function to the coverage map, but it is never called, so
the `Eq` trait would always appear uncovered.

Fixes: #83601

The fix required creating a new function attribute `no_coverage` to mark
functions that should be ignored by `InstrumentCoverage` and the
coverage `mapgen` (during codegen).

Adding a `no_coverage` feature gate with tracking issue #84605.

r? `@tmandry`
cc: `@wesleywiser`
2021-04-28 13:05:16 +00:00
Christiaan Dirkx
26fb1e373b Reuse unix::cmath 2021-04-28 14:25:04 +02:00
Benoît du Garreau
0b7b121c29 Simplify Mutex::into_inner 2021-04-28 13:56:23 +02:00
bors
237eab1156 Auto merge of #83401 - fee1-dead:master, r=davidtwco
Fix ICE of for-loop mut borrowck where no suggestions are available

Fixes #83309.
2021-04-28 10:46:02 +00:00
Timothée Delabrouille
7d09dba728 added methods src_root and location to External crate, remove extern_location function 2021-04-28 12:06:20 +02:00
Yuki Okushi
de92dfb3b6 Add a regression test for #80779 2021-04-28 18:23:49 +09:00
Yuki Okushi
eb753e8ea6 Add a regression test for #75883 2021-04-28 18:23:44 +09:00
Laurențiu Nicola
2860e41eda ⬆️ rust-analyzer 2021-04-28 12:09:34 +03:00
bors
76a04dd3f8 Auto merge of #84644 - JohnTitor:rollup-nzq9rjz, r=JohnTitor
Rollup of 5 pull requests

Successful merges:

 - #84529 (Improve coverage spans for chained function calls)
 - #84616 (Fix empty dom toggle)
 - #84622 (Make traits with GATs not object safe)
 - #84624 (Make sentence in env::args_os' docs plain and simple)
 - #84642 (Stabilize vec_extend_from_within)

Failed merges:

 - #84636 (rustdoc: change aliases attribute to data-aliases)

r? `@ghost`
`@rustbot` modify labels: rollup
2021-04-28 08:20:19 +00:00
Yuki Okushi
7ebe5b9e4d
Rollup merge of #84642 - Amanieu:vec_extend_from_within, r=dtolnay
Stabilize vec_extend_from_within

Closes #81656
2021-04-28 16:59:11 +09:00
Yuki Okushi
0e72e0fb7f
Rollup merge of #84624 - r00ster91:patch-5, r=JohnTitor
Make sentence in env::args_os' docs plain and simple

Follow-up to #84551. See https://github.com/rust-lang/rust/pull/84551#discussion_r620728070 on why this makes more sense.
2021-04-28 16:59:09 +09:00
Yuki Okushi
35eac429f6
Rollup merge of #84622 - jackh726:gats-trait-object, r=nikomatsakis
Make traits with GATs not object safe

Closes #81823

r? `@nikomatsakis`
2021-04-28 16:59:08 +09:00
Yuki Okushi
54ad5cb8f4
Rollup merge of #84616 - GuillaumeGomez:fix-empty-dom-toggle, r=jsha
Fix empty dom toggle

Currently, the empty impl blocks have toggles:

![Screenshot from 2021-04-27 15-15-03](https://user-images.githubusercontent.com/3050060/116249703-5ee0d980-a76d-11eb-9e15-738c06e4fb1b.png)

So when you expand it, nothing happens:

![Screenshot from 2021-04-27 15-15-07](https://user-images.githubusercontent.com/3050060/116249746-686a4180-a76d-11eb-8dc1-221ca0ac57c5.png)

So now, in case the impl block is empty, we simply don't generate the details/summary wrapping (which also makes DOM lighter, yeay!):

![Screenshot from 2021-04-27 15-14-15](https://user-images.githubusercontent.com/3050060/116249825-7a4be480-a76d-11eb-9637-b26151311ebd.png)

r? `@jsha`
2021-04-28 16:59:07 +09:00
Yuki Okushi
3f89ca1a32
Rollup merge of #84529 - richkadel:issue-84180, r=tmandry
Improve coverage spans for chained function calls

Fixes: #84180

For chained function calls separated by the `?` try operator, the
function call following the try operator produced a MIR `Call` span that
matched the span of the first call. The `?` try operator started a new
span, so the second call got no span.

It turns out the MIR `Call` terminator has a `func` `Operand`
for the `Constant` representing the function name, and the function
name's Span can be used to reset the starting position of the span.

r? `@tmandry`
cc: `@wesleywiser`
2021-04-28 16:59:06 +09:00
Amanieu d'Antras
22951b7f56 Stabilize vec_extend_from_within 2021-04-28 07:27:06 +01:00
bors
855c2d130f Auto merge of #83713 - spastorino:revert-pub-macro-rules, r=nikomatsakis
Revert "Rollup merge of #82296 - spastorino:pubrules, r=nikomatsakis"

This reverts commit e2561c58a4, reversing
changes made to 2982ba50fc.

As discussed in #83641 this feature is not complete and in particular doesn't work cross macros and given that this is not going to be included in edition 2021 nobody seems to be trying to fix the underlying problem. When can add this again I guess, whenever somebody has the time to make it work cross crates.

r? `@nikomatsakis`
2021-04-28 05:52:47 +00:00
bors
537544b106 Auto merge of #84498 - workingjubilee:update-grab-bag, r=Mark-Simulacrum
Update grab bag

This PR slides a bunch of crate versions forward until suddenly a bunch of deps fall out of the tree!
In doing so this mostly picks up a version bump in the `redox_users` crate which makes most of the features default to optional.

crossbeam-utils 0.7 => 0.8.3 (where applicable)
https://github.com/crossbeam-rs/crossbeam/blob/master/crossbeam-utils/CHANGELOG.md
directories 3.0.1 => 3.0.2
ignore 0.4.16 => 0.4.17
tempfile 3.0.5 => tempfile 3.2

Removes constant_time_eq from deps exceptions
Removes arrayref from deps exceptions
And also removes:
- blake2b_simd
- const_fn (the package, not the feature)
- constant_time_eq
- redox_users 0.3.4
- rust-argon2
2021-04-28 02:45:03 +00:00
mark
2a9db919ff remove pat2021 2021-04-27 21:15:59 -05:00
Rich Kadel
3a5df48021 adds feature gating of no_coverage at either crate- or function-level 2021-04-27 17:12:51 -07:00
est31
12642d99a6 Add a paragraph with possible alternatives on older editions 2021-04-28 01:42:14 +02:00
bors
27bd3f51a9 Auto merge of #84635 - ehuss:update-cargo, r=ehuss
Update cargo

5 commits in 0ed318d182e465cd66071b91ac3d265af63ef8a1..4369396ce7d270972955d876eaa4954bea56bcd9
2021-04-23 20:54:54 +0000 to 2021-04-27 14:35:53 +0000
- Fix rebuild issues with rustdoc. (rust-lang/cargo#9419)
- Always use full metadata hash for -C metadata. (rust-lang/cargo#9418)
- Expose build.target .cargo/config setting as packages.target in Cargo.toml (rust-lang/cargo#9030)
- Some changes to rustdoc fingerprint checking. (rust-lang/cargo#9404)
- Document that CARGO_PKG_ are availble to build.rs (rust-lang/cargo#9405)
2021-04-27 22:46:14 +00:00
Eric Huss
8f1c8097a1 Update cargo 2021-04-27 14:35:07 -07:00
bors
727d101561 Auto merge of #84494 - tdelabro:84304-bis, r=jyn514
84304 - rustdoc: shrink Item::Attributes

Helps with https://github.com/rust-lang/rust/issues/84304
2021-04-27 20:19:57 +00:00
r00ster
1778f30cd8
Make sentence in env::args_os' docs plain and simple 2021-04-27 21:31:04 +02:00
Jack Huey
857cb4de20 Make traits with GATs not object safe 2021-04-27 14:34:23 -04:00
Rich Kadel
888d0b4c96 Derived Eq no longer shows uncovered
The Eq trait has a special hidden function. MIR `InstrumentCoverage`
would add this function to the coverage map, but it is never called, so
the `Eq` trait would always appear uncovered.

Fixes: #83601

The fix required creating a new function attribute `no_coverage` to mark
functions that should be ignored by `InstrumentCoverage` and the
coverage `mapgen` (during codegen).

While testing, I also noticed two other issues:

* spanview debug file output ICEd on a function with no body. The
workaround for this is included in this PR.
* `assert_*!()` macro coverage can appear covered if followed by another
`assert_*!()` macro. Normally they appear uncovered. I submitted a new
Issue #84561, and added a coverage test to demonstrate this issue.
2021-04-27 11:11:56 -07:00
bors
83ebb00645 Auto merge of #84620 - Dylan-DPC:rollup-wkv97im, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #84132 (Ignore nonstandard lldb version strings in compiletest)
 - #84521 (Reuse modules on `hermit`)
 - #84563 (Update backtrace to 0.3.57)
 - #84610 (Update Clippy)
 - #84613 (move representability checks to rustc_ty_utils)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-04-27 17:58:59 +00:00
Dylan DPC
24782c7f82
Rollup merge of #84613 - lcnr:recursive-types, r=jackh726
move representability checks to rustc_ty_utils
2021-04-27 19:08:50 +02:00
Dylan DPC
38e0dbd8eb
Rollup merge of #84610 - flip1995:clippyup, r=Manishearth,flip1995
Update Clippy

Out of cycle sync: I want to get https://github.com/rust-lang/rust-clippy/pull/7129 into beta that is branched next week.

This sync only adds one new feature in efc4c6c, which looks fine to me. Otherwise it only contains bug fixes and/or restricts lints further.

r? `@Manishearth`
2021-04-27 19:08:49 +02:00
Dylan DPC
7969de2d9c
Rollup merge of #84563 - jclulow:backtrace-upgrade, r=Mark-Simulacrum
Update backtrace to 0.3.57

Adds support for symbol resolution on illumos systems.
2021-04-27 19:08:48 +02:00
Dylan DPC
e7be5ddc4a
Rollup merge of #84521 - CDirkx:hermit-dedup, r=Mark-Simulacrum
Reuse modules on `hermit`

Reuse the following modules on `hermit`:
- `unix::path` (contents identical)
- `unsupported::io` (contents identical)
- `unsupported::thread_local_key` (contents functionally identical, only changes are the panic error messages)

`@rustbot` label: +T-libs-impl
2021-04-27 19:08:46 +02:00
Dylan DPC
78e0f2f52d
Rollup merge of #84132 - Manishearth:lldb-nonstandard, r=Mark-Simulacrum
Ignore nonstandard lldb version strings in compiletest

Fixes https://github.com/rust-lang/rust/issues/84131

Unsure if I should do the same for the Apple LLDB branch above.
2021-04-27 19:08:45 +02:00
Joshua Nelson
1c8e122177 Switch rustc::internal from deny to warn
These should still obey deny-warnings.
2021-04-27 13:00:36 -04:00
Joshua Nelson
8c25e27f16 Implement x.py test src/tools/clippy --bless
- Add clippy_dev to the rust workspace

  Before, it would give an error that it wasn't either included or
  excluded from the workspace:

  ```
  error: current package believes it's in a workspace when it's not:
  current:   /home/joshua/rustc/src/tools/clippy/clippy_dev/Cargo.toml
  workspace: /home/joshua/rustc/Cargo.toml

  this may be fixable by adding `src/tools/clippy/clippy_dev` to the `workspace.members` array of the manifest located at: /home/joshua/rustc/Cargo.toml
  Alternatively, to keep it out of the workspace, add the package to the `workspace.exclude` array, or add an empty `[workspace]` table to the package's manifest.
  ```

- Change clippy's copy of compiletest not to special-case
  rust-lang/rust. Using OUT_DIR confused `clippy_dev` and it couldn't find
  the test outputs. This is one of the reasons why `cargo dev bless` used
  to silently do nothing (the others were that `CARGO_TARGET_DIR` and
  `PROFILE` weren't set appropriately).

- Run clippy_dev on test failure

I tested this by removing a couple lines from a stderr file, and they
were correctly replaced.

- Fix clippy_dev warnings
2021-04-27 16:57:29 +00:00
Joshua Nelson
39648ea467 Make real_rust_path_dir a TRACKED_NO_CRATE_HASH option
This also adds support for doc-comments to Options.
2021-04-27 16:48:25 +00:00
Joshua Nelson
272015190d Add [TRACKED_NO_CRATE_HASH] and [SUBSTRUCT] directives
This is necessary for options that should invalidate the incremental
hash but *not* affect the crate hash (e.g. --remap-path-prefix).

This doesn't add `for_crate_hash` to the trait directly because it's not
relevant for *types*, only for *options*, which are fields on a larger
struct. Instead, it adds a new `SUBSTRUCT` directive for options, which
does take a `for_crate_hash` parameter.

- Use TRACKED_NO_CRATE_HASH for --remap-path-prefix
- Add test that `remap_path_prefix` is tracked
- Reduce duplication in the test suite to avoid future churn
2021-04-27 16:46:33 +00:00
Joshua Nelson
fb7018b41e Test that non_default_option is not the default option
Otherwise the test is useless and does nothing. This caught 2 bugs in
the test suite.
2021-04-27 16:30:39 +00:00
lrh2000
e8e5a884ad Fix failed tests related to pointer printing when using GDB 10
As mentioned in #79009, there are four failed debuginfo test cases
when using GDB 10. This commit fixes two of them, which fail because
GDB 10 won't print pointers as string anymore. We can use `printf`
as a workaround. It should work regardless of the version of GDB.

Refer this [comment] for more details.

[comment]: https://github.com/rust-lang/rust/issues/79009#issuecomment-826952708
2021-04-27 23:07:36 +08:00
flip1995
d4af90e0f9
Merge commit '7c7683c8efe447b251d6c5ca6cce51233060f6e8' into clippyup 2021-04-27 16:55:11 +02:00