]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoRollup merge of #84540 - 12101111:enable-sanitizers, r=Mark-Simulacrum
Jack Huey [Thu, 29 Apr 2021 02:59:25 +0000 (22:59 -0400)]
Rollup merge of #84540 - 12101111:enable-sanitizers, r=Mark-Simulacrum

Build sanitizers for x86_64-unknown-linux-musl

The support of sanitizers on target `x86_64-unknown-linux-musl` is landed in https://github.com/rust-lang/rust/pull/84126

3 years agoRollup merge of #84531 - Smittyvb:foo-not-feature, r=Mark-Simulacrum
Jack Huey [Thu, 29 Apr 2021 02:59:24 +0000 (22:59 -0400)]
Rollup merge of #84531 - Smittyvb:foo-not-feature, r=Mark-Simulacrum

Ignore commented out lines when finding features

This fixes #76246, where commented out lines were being detected as features by `tidy`, by ignoring those lines when looking for features. It's still not perfect, since it can be fooled by things like:
```rust
/*
#[unstable(feature = "foo", issue = "1234")]
*/
```
But luckily that never happens in `rustc`, so `foo` now ceases to appear in the unstable book.

3 years agoRollup merge of #84530 - richkadel:test-tidy-build-dirs, r=Mark-Simulacrum
Jack Huey [Thu, 29 Apr 2021 02:59:23 +0000 (22:59 -0400)]
Rollup merge of #84530 - richkadel:test-tidy-build-dirs, r=Mark-Simulacrum

`test tidy` should ignore alternative `build` dir patterns

I need to have multiple `build` directories, such as `build`,
`build-fuchsia`, and `build-test`. But when I'm uploading a change, I
run `./x.py test tidy`, and if I have a `build-something` directory with
Rust sources, I git a bunch of formatting errors.

`rustfmt.toml` only ignores the directory named `build`.

This change extends the patterns to also ignore `build-*` and `*-build`.

As a rustc contributor, I not only build the rust compiler to develop
new features, but I also build alternative "distributions" (using
secondary `*-config.toml` files with different configurations),
including:

* To occasionally rebuild a version of the compiler that `rust-analyzer`
can use to `check` source (which fixes issues in the VS Code UI, so
changing and rebuilding the compiler does not break VS Code editing Rust
code).
* To build custom distributions for Fuchsia
* To build test distributions when working on changes to `bootstrap`
(e.g., when I recently added `rust-demangler` to distributions)

3 years agoRollup merge of #84484 - jyn514:check-tools, r=Mark-Simulacrum
Jack Huey [Thu, 29 Apr 2021 02:59:22 +0000 (22:59 -0400)]
Rollup merge of #84484 - jyn514:check-tools, r=Mark-Simulacrum

Don't rebuild rustdoc and clippy after checking bootstrap

This works by unconditionally passing -Z unstable-options to the
compiler. This has no affect in practice since bootstrap doesn't use
`deny(rustc::internal)`.

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

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

3 years agoAuto merge of #84615 - a1phyr:clone_from_pathbuf_osstring, r=Mark-Simulacrum
bors [Wed, 28 Apr 2021 23:25:23 +0000 (23:25 +0000)]
Auto merge of #84615 - a1phyr:clone_from_pathbuf_osstring, r=Mark-Simulacrum

Override `clone_from` method for PathBuf and OsString

This was not the case before because `#[derive(Clone)]` do not do it.

3 years agoAuto merge of #83386 - mark-i-m:stabilize-pat2015, r=nikomatsakis
bors [Wed, 28 Apr 2021 20:35:17 +0000 (20:35 +0000)]
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`

3 years agoAuto merge of #84650 - a1phyr:simplify_mutex_into_inner, r=m-ou-se
bors [Wed, 28 Apr 2021 18:08:01 +0000 (18:08 +0000)]
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.

3 years agoAuto merge of #84645 - lnicola:rust-analyzer-2021-04-26, r=jonas-schievink
bors [Wed, 28 Apr 2021 15:46:26 +0000 (15:46 +0000)]
Auto merge of #84645 - lnicola:rust-analyzer-2021-04-26, r=jonas-schievink

:arrow_up: rust-analyzer

3 years agoAuto merge of #84562 - richkadel:issue-83601, r=tmandry
bors [Wed, 28 Apr 2021 13:05:16 +0000 (13:05 +0000)]
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`

3 years agoSimplify `Mutex::into_inner`
Benoît du Garreau [Wed, 28 Apr 2021 11:56:23 +0000 (13:56 +0200)]
Simplify `Mutex::into_inner`

3 years agoAuto merge of #83401 - fee1-dead:master, r=davidtwco
bors [Wed, 28 Apr 2021 10:46:02 +0000 (10:46 +0000)]
Auto merge of #83401 - fee1-dead:master, r=davidtwco

Fix ICE of for-loop mut borrowck where no suggestions are available

Fixes #83309.

3 years ago:arrow_up: rust-analyzer
Laurențiu Nicola [Wed, 28 Apr 2021 09:09:34 +0000 (12:09 +0300)]
:arrow_up: rust-analyzer

3 years agoAuto merge of #84644 - JohnTitor:rollup-nzq9rjz, r=JohnTitor
bors [Wed, 28 Apr 2021 08:20:19 +0000 (08:20 +0000)]
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

3 years agoRollup merge of #84642 - Amanieu:vec_extend_from_within, r=dtolnay
Yuki Okushi [Wed, 28 Apr 2021 07:59:11 +0000 (16:59 +0900)]
Rollup merge of #84642 - Amanieu:vec_extend_from_within, r=dtolnay

Stabilize vec_extend_from_within

Closes #81656

3 years agoRollup merge of #84624 - r00ster91:patch-5, r=JohnTitor
Yuki Okushi [Wed, 28 Apr 2021 07:59:09 +0000 (16:59 +0900)]
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.

3 years agoRollup merge of #84622 - jackh726:gats-trait-object, r=nikomatsakis
Yuki Okushi [Wed, 28 Apr 2021 07:59:08 +0000 (16:59 +0900)]
Rollup merge of #84622 - jackh726:gats-trait-object, r=nikomatsakis

Make traits with GATs not object safe

Closes #81823

r? `@nikomatsakis`

3 years agoRollup merge of #84616 - GuillaumeGomez:fix-empty-dom-toggle, r=jsha
Yuki Okushi [Wed, 28 Apr 2021 07:59:07 +0000 (16:59 +0900)]
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`

3 years agoRollup merge of #84529 - richkadel:issue-84180, r=tmandry
Yuki Okushi [Wed, 28 Apr 2021 07:59:06 +0000 (16:59 +0900)]
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`

3 years agoStabilize vec_extend_from_within
Amanieu d'Antras [Wed, 28 Apr 2021 06:12:49 +0000 (07:12 +0100)]
Stabilize vec_extend_from_within

3 years agoAuto merge of #83713 - spastorino:revert-pub-macro-rules, r=nikomatsakis
bors [Wed, 28 Apr 2021 05:52:47 +0000 (05:52 +0000)]
Auto merge of #83713 - spastorino:revert-pub-macro-rules, r=nikomatsakis

Revert "Rollup merge of #82296 - spastorino:pubrules, r=nikomatsakis"

This reverts commit e2561c58a41023a14e0e583113dcf55e1ecb236a, reversing
changes made to 2982ba50fc4bb629b8fe4108a81cb2f9b053510b.

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`

3 years agoAuto merge of #84498 - workingjubilee:update-grab-bag, r=Mark-Simulacrum
bors [Wed, 28 Apr 2021 02:45:03 +0000 (02:45 +0000)]
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

3 years agoremove pat2021
mark [Wed, 28 Apr 2021 02:15:59 +0000 (21:15 -0500)]
remove pat2021

3 years agoadds feature gating of `no_coverage` at either crate- or function-level
Rich Kadel [Tue, 27 Apr 2021 04:25:30 +0000 (21:25 -0700)]
adds feature gating of `no_coverage` at either crate-  or function-level

3 years agoAuto merge of #84635 - ehuss:update-cargo, r=ehuss
bors [Tue, 27 Apr 2021 22:46:14 +0000 (22:46 +0000)]
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)

3 years agoUpdate cargo
Eric Huss [Tue, 27 Apr 2021 21:35:07 +0000 (14:35 -0700)]
Update cargo

3 years agoAuto merge of #84494 - tdelabro:84304-bis, r=jyn514
bors [Tue, 27 Apr 2021 20:19:57 +0000 (20:19 +0000)]
Auto merge of #84494 - tdelabro:84304-bis, r=jyn514

84304 - rustdoc: shrink Item::Attributes

Helps with https://github.com/rust-lang/rust/issues/84304

3 years agoMake sentence in env::args_os' docs plain and simple
r00ster [Tue, 27 Apr 2021 19:31:04 +0000 (21:31 +0200)]
Make sentence in env::args_os' docs plain and simple

3 years agoMake traits with GATs not object safe
Jack Huey [Tue, 27 Apr 2021 18:34:23 +0000 (14:34 -0400)]
Make traits with GATs not object safe

3 years agoDerived Eq no longer shows uncovered
Rich Kadel [Sun, 25 Apr 2021 20:34:03 +0000 (13:34 -0700)]
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.

3 years agoAuto merge of #84620 - Dylan-DPC:rollup-wkv97im, r=Dylan-DPC
bors [Tue, 27 Apr 2021 17:58:59 +0000 (17:58 +0000)]
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

3 years agoRollup merge of #84613 - lcnr:recursive-types, r=jackh726
Dylan DPC [Tue, 27 Apr 2021 17:08:50 +0000 (19:08 +0200)]
Rollup merge of #84613 - lcnr:recursive-types, r=jackh726

move representability checks to rustc_ty_utils

3 years agoRollup merge of #84610 - flip1995:clippyup, r=Manishearth,flip1995
Dylan DPC [Tue, 27 Apr 2021 17:08:49 +0000 (19:08 +0200)]
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`

3 years agoRollup merge of #84563 - jclulow:backtrace-upgrade, r=Mark-Simulacrum
Dylan DPC [Tue, 27 Apr 2021 17:08:48 +0000 (19:08 +0200)]
Rollup merge of #84563 - jclulow:backtrace-upgrade, r=Mark-Simulacrum

Update backtrace to 0.3.57

Adds support for symbol resolution on illumos systems.

3 years agoRollup merge of #84521 - CDirkx:hermit-dedup, r=Mark-Simulacrum
Dylan DPC [Tue, 27 Apr 2021 17:08:46 +0000 (19:08 +0200)]
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

3 years agoRollup merge of #84132 - Manishearth:lldb-nonstandard, r=Mark-Simulacrum
Dylan DPC [Tue, 27 Apr 2021 17:08:45 +0000 (19:08 +0200)]
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.

3 years agoSwitch `rustc::internal` from deny to warn
Joshua Nelson [Tue, 27 Apr 2021 17:00:36 +0000 (13:00 -0400)]
Switch `rustc::internal` from deny to warn

These should still obey deny-warnings.

3 years agoMerge commit '7c7683c8efe447b251d6c5ca6cce51233060f6e8' into clippyup
flip1995 [Tue, 27 Apr 2021 14:55:11 +0000 (16:55 +0200)]
Merge commit '7c7683c8efe447b251d6c5ca6cce51233060f6e8' into clippyup

3 years agoAuto merge of #7128 - Jarcho:const_fn_ice, r=flip1995
bors [Tue, 27 Apr 2021 14:21:11 +0000 (14:21 +0000)]
Auto merge of #7128 - Jarcho:const_fn_ice, r=flip1995

Fix ICE checking for feature gated const fn

fixes: #7126
changelog: Fix ICE in `missing_const_for_fn` when using a feature-gated `const fn`

3 years agoAuto merge of #7138 - mgacek8:issue6808_iter_cloned_collect_FN_with_large_array,...
bors [Tue, 27 Apr 2021 13:44:51 +0000 (13:44 +0000)]
Auto merge of #7138 - mgacek8:issue6808_iter_cloned_collect_FN_with_large_array, r=Manishearth

Fix FN in `iter_cloned_collect` with a large array

fixes #6808
changelog: Fix FN in `iter_cloned_collect` with a large array

I spotted that [is_iterable_array](https://github.com/rust-lang/rust-clippy/blob/a362a4d1d0edb66aef186c1d27b28c60573078f4/clippy_lints/src/loops/explicit_iter_loop.rs#L67-L75) function that `explicit_iter_loop` lint is using only works for array sizes <= 32.
There is this comment:
> IntoIterator is currently only implemented for array sizes <= 32 in rustc

I'm a bit confused, because I read that [IntoIterator for arrays](https://doc.rust-lang.org/src/core/array/mod.rs.html#194-201) with const generic `N` is stable since = "1.0.0". Although Const Generics MVP were stabilized in Rust 1.51.

Should I set MSRV for the current change? I will try to test with older compilers soon.

3 years agoUpdate impl DOM test
Guillaume Gomez [Tue, 27 Apr 2021 13:27:08 +0000 (15:27 +0200)]
Update impl DOM test

3 years agoAdd test for new DOM for empty impls
Guillaume Gomez [Tue, 27 Apr 2021 13:26:43 +0000 (15:26 +0200)]
Add test for new DOM for empty impls

3 years agoDon't put empty implementations into details/summary blocks
Guillaume Gomez [Tue, 27 Apr 2021 13:26:14 +0000 (15:26 +0200)]
Don't put empty implementations into details/summary blocks

3 years agoOverride `clone_from` method for PathBuf and OsString
Benoît du Garreau [Tue, 27 Apr 2021 13:05:26 +0000 (15:05 +0200)]
Override `clone_from` method for PathBuf and OsString

3 years agomove `representability` out of `rustc_middle`
lcnr [Tue, 27 Apr 2021 13:01:37 +0000 (15:01 +0200)]
move `representability` out of `rustc_middle`

3 years agoAuto merge of #84609 - lefth:master, r=Dylan-DPC
bors [Tue, 27 Apr 2021 12:21:53 +0000 (12:21 +0000)]
Auto merge of #84609 - lefth:master, r=Dylan-DPC

Reorder the parameter descriptions of map_or and map_or_else

They were described backwards, probably leading users to write arguments in the wrong order. Bug: #84608

3 years agoReorder the parameter descriptions of map_or and map_or_else
Dan Zwell [Tue, 27 Apr 2021 09:58:54 +0000 (17:58 +0800)]
Reorder the parameter descriptions of map_or and map_or_else

They were described backwards. #84608

3 years agoAuto merge of #84606 - JohnTitor:test-84408, r=lcnr
bors [Tue, 27 Apr 2021 09:56:33 +0000 (09:56 +0000)]
Auto merge of #84606 - JohnTitor:test-84408, r=lcnr

Add a regression test for issue-84408

Closes #84408
r? `@lcnr`

3 years agocfg taken out of Attributes, put in Item
Timothée Delabrouille [Sun, 25 Apr 2021 16:17:11 +0000 (18:17 +0200)]
cfg taken out of Attributes, put in Item

check item.is_fake() instead of self_id.is_some()

Remove empty branching in Attributes::from_ast

diverse small refacto after Josha review

cfg computation moved in merge_attrs

refacto use from_ast twice for coherence

take cfg out of Attributes and move it to Item

3 years agoRemoved usage of Attributes in FnDecl and ExternalCrate. Relocate part of the fields...
Timothée Delabrouille [Fri, 23 Apr 2021 20:15:13 +0000 (22:15 +0200)]
Removed usage of Attributes in FnDecl and ExternalCrate. Relocate part of the fields in Attributes, as functions in AttributesExt.

refacto use from_def_id_and_attrs_and_parts instead of an old trick

most of josha suggestions + check if def_id is not fake before using it in a query

Removed usage of Attributes in FnDecl and ExternalCrate. Relocate part of the Attributes fields as functions in AttributesExt.

3 years agoAuto merge of #84532 - richkadel:issue-83792, r=tmandry
bors [Tue, 27 Apr 2021 07:29:26 +0000 (07:29 +0000)]
Auto merge of #84532 - richkadel:issue-83792, r=tmandry

Fix coverage ICE because fn_sig can have a span that crosses file bou…

Fixes: #83792
MIR `InstrumentCoverage` assumed the `FnSig` span was contained within a
single file, but this is not always the case. Some macro constructions
can result in a span that starts in one `SourceFile` and ends in a
different one.

The `FnSig` span is included in coverage results as long as that span is
in the same `SourceFile` and the same macro context, but by assuming the
`FnSig` span's `hi()` and `lo()` were in the same file, I took this for
granted, and checked only that the `FnSig` `hi()` was in the same
`SourceFile` as the `body_span`.

I actually drop the `hi()` though, and extend the `FnSig` span to the
`body_span.lo()`, so I really should have simply checked that the
`FnSig` span's `lo()` was in the `SourceFile` of the `body_span`.

r? `@tmandry`
cc: `@wesleywiser`

3 years agoAuto merge of #77246 - yaahc:typeof-errors, r=oli-obk
bors [Tue, 27 Apr 2021 04:46:45 +0000 (04:46 +0000)]
Auto merge of #77246 - yaahc:typeof-errors, r=oli-obk

try enabling typeof for fun error messages

3 years agoRename a test for consistency
Yuki Okushi [Tue, 27 Apr 2021 04:16:56 +0000 (13:16 +0900)]
Rename a test for consistency

3 years agoAdd a regression test for issue-84408
Yuki Okushi [Tue, 27 Apr 2021 04:16:39 +0000 (13:16 +0900)]
Add a regression test for issue-84408

3 years agoAuto merge of #84552 - GuillaumeGomez:open-impl-blocks-by-default, r=jsha
bors [Tue, 27 Apr 2021 01:58:29 +0000 (01:58 +0000)]
Auto merge of #84552 - GuillaumeGomez:open-impl-blocks-by-default, r=jsha

Open impl blocks by default

Fixes #84558.
Part of #84422.

As you can see on https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/context/struct.TyCtxt.html, impl blocks are currently not open by default whereas they should.

I also realized that a test was outdated so I removed it and opened #84550 because it seems like the rustdoc-gui test suite isn't run on CI...

cc `@jyn514`
r? `@jsha`

3 years agoadd ui test for new typeof error messages
Jane Lusby [Mon, 26 Apr 2021 23:36:48 +0000 (16:36 -0700)]
add ui test for new typeof error messages

3 years agoAuto merge of #84092 - scottmcm:try_trait_initial, r=yaahc,m-ou-se
bors [Mon, 26 Apr 2021 23:17:31 +0000 (23:17 +0000)]
Auto merge of #84092 - scottmcm:try_trait_initial, r=yaahc,m-ou-se

Add the `try_trait_v2` library basics

No compiler changes as part of this -- just new unstable traits and impls thereof.

The goal here is to add the things that aren't going to break anything, to keep the feature implementation simpler in the next PR.

(Draft since the FCP won't end until Saturday, but I was feeling optimistic today -- and had forgotten that FCP was 10 days, not 7 days.)

3 years agoAuto merge of #7136 - mgacek8:issue6965_manual_unwrap_or_invalid_sugg_macro_expansion...
bors [Mon, 26 Apr 2021 21:39:40 +0000 (21:39 +0000)]
Auto merge of #7136 - mgacek8:issue6965_manual_unwrap_or_invalid_sugg_macro_expansion, r=llogiq

manual_unwrap_or: fix invalid code suggestion, due to macro expansion

fixes #6965

changelog: fix invalid code suggestion in `manual_unwrap_or` lint, due to macro expansion

3 years agoAuto merge of #7137 - camsteffen:msrv-mod, r=llogiq
bors [Mon, 26 Apr 2021 21:25:19 +0000 (21:25 +0000)]
Auto merge of #7137 - camsteffen:msrv-mod, r=llogiq

Refactor MSRV aliases

changelog: Remove MSRV from `needless_question_mark` and change MSRV for `missing_const_for_fn` from 1.37.0 to 1.46.0.

First [mentioned on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/Better.20MSRV.20testing.20idea/near/236215074).

* Moves MSRV constants into `clippy_utils::msrvs`. Now they are named to represent a stabilized feature flag or library item that is required for a lint's suggestion.
* `needless_question_mark` no longer has MSRV. Not needed since it does not suggest adding `?`.
* `missing_const_for_fn` MSRV was changed from 1.37.0 to 1.46.0. This seems to be a past mistake.

3 years agoUpdate MSRV contribution docs
Cameron Steffen [Mon, 26 Apr 2021 20:47:39 +0000 (15:47 -0500)]
Update MSRV contribution docs

3 years agoRefactor MSRV aliases
Cameron Steffen [Mon, 26 Apr 2021 19:10:32 +0000 (14:10 -0500)]
Refactor MSRV aliases

3 years agoRemove needless_question_mark MSRV
Cameron Steffen [Mon, 26 Apr 2021 20:49:25 +0000 (15:49 -0500)]
Remove needless_question_mark MSRV

3 years agoFix FN in `iter_cloned_collect` with a large array
Mateusz Gacek [Mon, 26 Apr 2021 20:03:51 +0000 (13:03 -0700)]
Fix FN in `iter_cloned_collect` with a large array

3 years agoAuto merge of #84600 - m-ou-se:rollup-mf5m2z8, r=m-ou-se
bors [Mon, 26 Apr 2021 19:58:11 +0000 (19:58 +0000)]
Auto merge of #84600 - m-ou-se:rollup-mf5m2z8, r=m-ou-se

Rollup of 4 pull requests

Successful merges:

 - #84120 (Stabilize Duration::MAX)
 - #84523 (Stabilize ordering_helpers.)
 - #84551 (Unify the docs of std::env::{args_os, args} more)
 - #84574 (rustdoc: Fix typos in maybe_inline_local fn)

Failed merges:

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

3 years agofix invalid code suggestion in `manual_unwrap_or`, due to macro expansion
Mateusz Gacek [Mon, 26 Apr 2021 19:08:24 +0000 (12:08 -0700)]
fix invalid code suggestion in `manual_unwrap_or`, due to macro expansion

3 years agoRollup merge of #84574 - hi-rustin:rustin-patch-typo, r=jyn514
Mara Bos [Mon, 26 Apr 2021 19:06:49 +0000 (21:06 +0200)]
Rollup merge of #84574 - hi-rustin:rustin-patch-typo, r=jyn514

rustdoc: Fix typos in maybe_inline_local fn

Introduced by https://github.com/rust-lang/rust/pull/79061.

r? `@jyn514`

3 years agoRollup merge of #84551 - r00ster91:patch-4, r=yaahc
Mara Bos [Mon, 26 Apr 2021 19:06:48 +0000 (21:06 +0200)]
Rollup merge of #84551 - r00ster91:patch-4, r=yaahc

Unify the docs of std::env::{args_os, args} more

I noticed that `args_os` was missing some information and I thought it should mention `args` for when you want more safety just like how `args` mentions `args_os` if you don't want it to panic on invalid Unicode.

3 years agoRollup merge of #84523 - m-ou-se:stabilize-ordering-helpers, r=m-ou-se
Mara Bos [Mon, 26 Apr 2021 19:06:47 +0000 (21:06 +0200)]
Rollup merge of #84523 - m-ou-se:stabilize-ordering-helpers, r=m-ou-se

Stabilize ordering_helpers.

Tracking issue: https://github.com/rust-lang/rust/issues/79885

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

3 years agoRollup merge of #84120 - workingjubilee:stabilize-duration-max, r=m-ou-se
Mara Bos [Mon, 26 Apr 2021 19:06:46 +0000 (21:06 +0200)]
Rollup merge of #84120 - workingjubilee:stabilize-duration-max, r=m-ou-se

Stabilize Duration::MAX

Following the suggested direction from https://github.com/rust-lang/rust/issues/76416#issuecomment-817278338, this PR proposes that `Duration::MAX` should have been part of the `duration_saturating_ops` feature flag all along, having been

0. heavily referenced by that feature flag
1. an odd duck next to most of `duration_constants`, as I expressed in https://github.com/rust-lang/rust/issues/57391#issuecomment-717681193
2. introduced in #76114 which added `duration_saturating_ops`

and accordingly should be folded into `duration_saturating_ops` and therefore stabilized.

r? `@m-ou-se`

3 years agoAuto merge of #84174 - camsteffen:slice-diag, r=Mark-Simulacrum
bors [Mon, 26 Apr 2021 17:16:03 +0000 (17:16 +0000)]
Auto merge of #84174 - camsteffen:slice-diag, r=Mark-Simulacrum

Remove slice diagnostic item

...because it is unusally placed on an impl and is redundant with a lang item.

Depends on rust-lang/rust-clippy#7074 (next clippy sync). ~I expect clippy tests to fail in the meantime.~ Nope tests passed...

CC `@flip1995`

3 years agoAuto merge of #7134 - camsteffen:copied-msrv, r=Manishearth
bors [Mon, 26 Apr 2021 16:12:04 +0000 (16:12 +0000)]
Auto merge of #7134 - camsteffen:copied-msrv, r=Manishearth

Finish MSRV for cloned_instead_of_copied

changelog: none

r? `@Manishearth`

3 years agoFinish MSRV for cloned_instead_of_copied
Cameron Steffen [Mon, 26 Apr 2021 16:09:24 +0000 (11:09 -0500)]
Finish MSRV for cloned_instead_of_copied

3 years agoAuto merge of #84583 - joshtriplett:target-tier-policy, r=pietroalbini
bors [Mon, 26 Apr 2021 14:35:13 +0000 (14:35 +0000)]
Auto merge of #84583 - joshtriplett:target-tier-policy, r=pietroalbini

Add the target tier policy from accepted RFC 2803

3 years agoAuto merge of #7132 - rust-lang:single_element_loop_iter, r=Manishearth
bors [Mon, 26 Apr 2021 14:28:31 +0000 (14:28 +0000)]
Auto merge of #7132 - rust-lang:single_element_loop_iter, r=Manishearth

extend `single_element_loop` to match `.iter()`

This extends `single_element_loop` to also match `[..].iter()` in the loop argument. Related to #7125, but not completely fixing it due to the lint only firing if the array expression contains a local variable.

---

changelog: none

3 years agoextend `single_element_loop` to match `.iter()`
Andre Bogus [Sun, 25 Apr 2021 16:10:38 +0000 (18:10 +0200)]
extend `single_element_loop` to match `.iter()`

3 years agoAuto merge of #84546 - CohenArthur:fix-liveness-typo, r=jyn514
bors [Mon, 26 Apr 2021 11:18:25 +0000 (11:18 +0000)]
Auto merge of #84546 - CohenArthur:fix-liveness-typo, r=jyn514

Fix typo  in report_unsed_assign

The function was called `report_unsed_assign`, which I assume is a typo, considering the rest of the file.
This replaces `report_unsed_assign` with `report_unused_assign`.

3 years agoCross-reference target tier policy from platform-support
Josh Triplett [Mon, 26 Apr 2021 10:33:28 +0000 (03:33 -0700)]
Cross-reference target tier policy from platform-support

3 years agoAdd the target tier policy from accepted RFC 2803
Josh Triplett [Mon, 26 Apr 2021 10:29:37 +0000 (03:29 -0700)]
Add the target tier policy from accepted RFC 2803

3 years agoAdd open attribute on details which are supposed to be open by default instead of...
Guillaume Gomez [Mon, 26 Apr 2021 08:43:49 +0000 (10:43 +0200)]
Add open attribute on details which are supposed to be open by default instead of opening them with JS

3 years agoAuto merge of #83390 - clarfonthey:hasher_docs, r=Amanieu
bors [Mon, 26 Apr 2021 08:21:55 +0000 (08:21 +0000)]
Auto merge of #83390 - clarfonthey:hasher_docs, r=Amanieu

Document Hasher spec decision from #42951

Since that ticket was closed without the decision actually being documented.

Fixes #42951.

3 years agorustdoc: Fix typo for maybe_inline_local fn
hi-rustin [Mon, 26 Apr 2021 05:43:30 +0000 (13:43 +0800)]
rustdoc: Fix typo for maybe_inline_local fn

3 years agoAuto merge of #84543 - paolobarbolini:reverse_bits-const-since, r=m-ou-se
bors [Mon, 26 Apr 2021 05:41:04 +0000 (05:41 +0000)]
Auto merge of #84543 - paolobarbolini:reverse_bits-const-since, r=m-ou-se

Fix 'const-stable since' of reverse_bits

This fixes the const_stable `since` of `reverse_bits` for the signed and unsigned integer types. The previous value was incorrect, as it pointed to an older version where `reverse_bits` hadn't been stabilized yet.

`reverse_bits` was const-stable from the start, as can be seen from:

https://doc.rust-lang.org/1.37.0/std/primitive.u32.html#method.reverse_bits
https://doc.rust-lang.org/1.37.0/std/primitive.i32.html#method.reverse_bits

3 years agoDocument Hasher spec decision from #42951
ltdk [Mon, 22 Mar 2021 19:39:22 +0000 (15:39 -0400)]
Document Hasher spec decision from #42951

3 years agoAuto merge of #84544 - RalfJung:const_fn_in_trait, r=oli-obk
bors [Mon, 26 Apr 2021 02:56:25 +0000 (02:56 +0000)]
Auto merge of #84544 - RalfJung:const_fn_in_trait, r=oli-obk

Always reject `const fn` in `trait` during parsing.

'const fn' in trait are rejected in the AST:
https://github.com/rust-lang/rust/blob/b78c0d8a4d5af91a4a55d029293e3ecb879ec142/compiler/rustc_ast_passes/src/ast_validation.rs#L1411
So this feature gate check is a NOP and we can just remove it.

The src/test/ui/feature-gates/feature-gate-min_const_fn.rs and src/test/ui/feature-gates/feature-gate-const_fn.rs tests ensure that we still reject `const fn` in `trait`

Cc https://github.com/rust-lang/rust/issues/84510
r? `@oli-obk`

3 years agoAuto merge of #84564 - Dylan-DPC:rollup-wxa2yr0, r=Dylan-DPC
bors [Sun, 25 Apr 2021 23:24:14 +0000 (23:24 +0000)]
Auto merge of #84564 - Dylan-DPC:rollup-wxa2yr0, r=Dylan-DPC

Rollup of 8 pull requests

Successful merges:

 - #84235 (refactor StyledBuffer)
 - #84450 (Give a better error when `std` or `core` are missing)
 - #84486 (Handle pretty printing of `else if let` clauses without ICEing)
 - #84499 (Tweak trait not `use`d suggestion)
 - #84516 (Add suggestion to "use break" when attempting to implicit-break a loop)
 - #84520 (Improve diagnostics for function passed when a type was expected.)
 - #84541 (Inline most raw socket, fd and handle conversions)
 - #84547 (Get rid of is_min_const_fn)

Failed merges:

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

3 years agoRollup merge of #84547 - RalfJung:max_const_fn, r=oli-obk
Dylan DPC [Sun, 25 Apr 2021 21:15:18 +0000 (23:15 +0200)]
Rollup merge of #84547 - RalfJung:max_const_fn, r=oli-obk

Get rid of is_min_const_fn

This removes the last trace of the min_const_fn mechanism by making the unsafety checker agnostic about whether something is a min or "non-min" const fn. It seems this distinction was used to disallow some features inside `const fn`, but that is the responsibility of the const checker, not of the unsafety checker. No test seems to even notice this change in the unsafety checker so I guess we are good...

r? `@oli-obk`
Cc https://github.com/rust-lang/rust/issues/84510

3 years agoRollup merge of #84541 - KaiJewson:inline-raw, r=m-ou-se
Dylan DPC [Sun, 25 Apr 2021 21:15:17 +0000 (23:15 +0200)]
Rollup merge of #84541 - KaiJewson:inline-raw, r=m-ou-se

Inline most raw socket, fd and handle conversions

Now that file descriptor types on Unix have niches, it is advantageous for user libraries which provide file descriptor wrappers (e.g. `Socket` from socket2) to store a `File` internally instead of a `RawFd`, so that the niche can be taken advantage of. However, doing so will currently result in worse performance as `IntoRawFd`, `FromRawFd` and `AsRawFd` are not inlined. This change adds `#[inline]` to those methods on std types that wrap file descriptors, handles or sockets.

3 years agoRollup merge of #84520 - hameerabbasi:fn-as-ty, r=lcnr
Dylan DPC [Sun, 25 Apr 2021 21:15:16 +0000 (23:15 +0200)]
Rollup merge of #84520 - hameerabbasi:fn-as-ty, r=lcnr

Improve diagnostics for function passed when a type was expected.

This PR improves diagnostics, it provides more information when a function is passed where a type is expected.

r? `@lcnr`

3 years agoRollup merge of #84516 - torhovland:issue-84114, r=estebank
Dylan DPC [Sun, 25 Apr 2021 21:15:14 +0000 (23:15 +0200)]
Rollup merge of #84516 - torhovland:issue-84114, r=estebank

Add suggestion to "use break" when attempting to implicit-break a loop

Fixes #84114

3 years agoRollup merge of #84499 - estebank:issue-84272, r=jackh726
Dylan DPC [Sun, 25 Apr 2021 21:15:13 +0000 (23:15 +0200)]
Rollup merge of #84499 - estebank:issue-84272, r=jackh726

Tweak trait not `use`d suggestion

Fix #84272. Follow up to #83667.

3 years agoRollup merge of #84486 - Smittyvb:else-if-let-hir-pretty-print, r=petrochenkov
Dylan DPC [Sun, 25 Apr 2021 21:15:12 +0000 (23:15 +0200)]
Rollup merge of #84486 - Smittyvb:else-if-let-hir-pretty-print, r=petrochenkov

Handle pretty printing of `else if let` clauses without ICEing

When pretty printing the HIR of `if ... {} else if let ... {}` clauses, this displays it the `else if let` part as `match` it gets desugared to, the same way normal `if let` statements are currently displayed, instead of ICEing.

```rust
pub fn main() {
    if true {
        // 1
    } else if let a = 1 {
        // 2
    } else {
        // 3
    }
}
```

now gets desugared (via `rustc -Zunpretty=hir,typed src/x.rs`) to:

```rust
#[prelude_import]
use ::std::prelude::rust_2015::*;
#[macro_use]
extern crate std;
pub fn main() ({
                   (if (true as bool)
                       ({
                            // 1
                        } as
                           ()) else {match (1 as i32) {
                                         a => {
                                             // 2
                                         }
                                         _ => {
                                             // 3
                                         }
                                     }} as ())
                    } as ())
```

For comparison, this code gets HIR prettyprinted the same way before and after this change:

```rust
pub fn main() {
    if let a = 1 {
        // 2
    } else {
        // 3
    }
}
```
turns into
```rust
#[prelude_import]
use ::std::prelude::rust_2015::*;
#[macro_use]
extern crate std;
pub fn main() ({
                   (match (1 as i32) {
                        a => {
                            // 2
                        }
                        _ => {
                            // 3
                        }
                    } as ())
               } as ())
```

This closes #82329. It closes #84434 as well, due to having the same root cause.

3 years agoRollup merge of #84450 - jyn514:missing-std, r=petrochenkov
Dylan DPC [Sun, 25 Apr 2021 21:15:11 +0000 (23:15 +0200)]
Rollup merge of #84450 - jyn514:missing-std, r=petrochenkov

Give a better error when `std` or `core` are missing

- Suggest using `rustup target add` if `RUSTUP_HOME` is set. I don't know if there's any precedent for doing this, but it seems harmless enough and it will be a big help.
- On nightly, suggest using `cargo build -Z build-std` if `CARGO` is set
- Add a note about `#![no_std]` if `std` is missing but not core
- Add a note that std may be unsupported if `std` is missing but not core

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

r? `@petrochenkov`

3 years agoRollup merge of #84235 - klensy:styled-buffer, r=lcnr
Dylan DPC [Sun, 25 Apr 2021 21:15:10 +0000 (23:15 +0200)]
Rollup merge of #84235 - klensy:styled-buffer, r=lcnr

refactor StyledBuffer

Refactors StyledBuffer `text` and `styles` fields content into StyledChar and touches some other stuff.

3 years agoUpdate backtrace to 0.3.57
Joshua M. Clulow [Fri, 23 Apr 2021 00:41:00 +0000 (17:41 -0700)]
Update backtrace to 0.3.57

Adds support for symbol resolution on illumos systems.

3 years agoAuto merge of #84325 - jsha:ephemeral-collapse, r=GuillaumeGomez
bors [Sun, 25 Apr 2021 20:42:11 +0000 (20:42 +0000)]
Auto merge of #84325 - jsha:ephemeral-collapse, r=GuillaumeGomez

rustdoc: make expand/collapse all ephemeral

The `[+]` in the upper right of a rustdoc page expands or collapses all toggles on the page. That state is stored across page loads, but is used inconsistently. This change explicitly stops storing or using the state.

This also moves the code for toggling display of trait implementations so that it's near the other toggling code.

Fixes #84318

3 years agoAdd starting anchor
Smittyvb [Sun, 25 Apr 2021 19:37:08 +0000 (15:37 -0400)]
Add starting anchor

Co-authored-by: Joshua Nelson <joshua@yottadb.com>
3 years agoAuto merge of #84481 - RalfJung:miri, r=RalfJung
bors [Sun, 25 Apr 2021 18:17:45 +0000 (18:17 +0000)]
Auto merge of #84481 - RalfJung:miri, r=RalfJung

update Miri

Fixes https://github.com/rust-lang/rust/issues/84553
Cc `@rust-lang/miri` r? `@ghost`

3 years agoUpdate to reflect feedback on the constraints
Jubilee Young [Sun, 25 Apr 2021 17:28:23 +0000 (10:28 -0700)]
Update to reflect feedback on the constraints

3 years agoDocumentation improvements (hopefully)
Scott McMurray [Sun, 25 Apr 2021 17:04:23 +0000 (10:04 -0700)]
Documentation improvements (hopefully)

3 years agoupdate Miri
Ralf Jung [Sun, 25 Apr 2021 16:47:26 +0000 (18:47 +0200)]
update Miri

3 years agoGive a better error when std or core are missing
Joshua Nelson [Thu, 22 Apr 2021 19:23:30 +0000 (15:23 -0400)]
Give a better error when std or core are missing

- Suggest using `rustup target add` if `RUSTUP_HOME` is set. I don't know if there's any precedent for doing this, but it seems harmless enough and it will be a big help.
- Add a note about `#![no_std]` if `std` is missing but not core
- On nightly, suggest using `cargo build -Z build-std` if `CARGO` is set
- Add a note that std may be unsupported if `std` is missing but not core
- Don't suggest `#![no_std]` when the load isn't injected by the
  compiler