Commit graph

142573 commits

Author SHA1 Message Date
Guillaume Gomez a20831e7a6 Remove unneeded bottom margin on search results 2021-04-29 11:26:35 +02: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
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
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
flip1995 d4af90e0f9
Merge commit '7c7683c8efe447b251d6c5ca6cce51233060f6e8' into clippyup 2021-04-27 16:55:11 +02:00
bors 7c7683c8ef 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`
2021-04-27 14:21:11 +00:00
bors 9af07e65aa 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](a362a4d1d0/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.
2021-04-27 13:44:51 +00:00
Guillaume Gomez 9051d4073b Update impl DOM test 2021-04-27 15:27:08 +02:00
Guillaume Gomez 982ef39d47 Add test for new DOM for empty impls 2021-04-27 15:26:43 +02:00
Guillaume Gomez 0db26d612d Don't put empty implementations into details/summary blocks 2021-04-27 15:26:14 +02:00
lcnr b3629d21ba move representability out of rustc_middle 2021-04-27 15:01:37 +02:00
bors 1919b3f227 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
2021-04-27 12:21:53 +00:00
Dan Zwell 6c22b39187 Reorder the parameter descriptions of map_or and map_or_else
They were described backwards. #84608
2021-04-27 18:00:30 +08:00
bors dc8cb63078 Auto merge of #84606 - JohnTitor:test-84408, r=lcnr
Add a regression test for issue-84408

Closes #84408
r? `@lcnr`
2021-04-27 09:56:33 +00:00
Timothée Delabrouille 727f9040aa 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
2021-04-27 10:29:58 +02:00
Timothée Delabrouille b4f1dfd2c5 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.
2021-04-27 10:17:59 +02:00
bors e1886935b7 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`
2021-04-27 07:29:26 +00:00
bors 22b686ad99 Auto merge of #77246 - yaahc:typeof-errors, r=oli-obk
try enabling typeof for fun error messages
2021-04-27 04:46:45 +00:00
Yuki Okushi f1239e15c8 Rename a test for consistency 2021-04-27 13:16:56 +09:00
Yuki Okushi c660a51cc4 Add a regression test for issue-84408 2021-04-27 13:16:39 +09:00
bors 6eb956fcbb 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`
2021-04-27 01:58:29 +00:00
Jane Lusby ed903f9b91 add ui test for new typeof error messages 2021-04-26 16:36:48 -07:00
bors 61e171566a 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.)
2021-04-26 23:17:31 +00:00
bors 0a330e6824 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
2021-04-26 21:39:40 +00:00
bors f33d86df4e 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.
2021-04-26 21:25:19 +00:00
Cameron Steffen 3a8e759d8a Update MSRV contribution docs 2021-04-26 16:07:48 -05:00
Cameron Steffen 340b570ea0 Refactor MSRV aliases 2021-04-26 16:07:48 -05:00
Cameron Steffen 33ed8b5b24 Remove needless_question_mark MSRV 2021-04-26 16:02:11 -05:00
Mateusz Gacek d7627dcfc8 Fix FN in iter_cloned_collect with a large array 2021-04-26 13:03:51 -07:00
bors 9684258936 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
2021-04-26 19:58:11 +00:00
Mateusz Gacek 84003aa7a1 fix invalid code suggestion in manual_unwrap_or, due to macro expansion 2021-04-26 12:19:23 -07:00
Mara Bos 8b33dfa8ad
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`
2021-04-26 21:06:49 +02:00
Mara Bos 6d277c7694
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.
2021-04-26 21:06:48 +02:00