Commit Graph

164823 Commits

Author SHA1 Message Date
Devin Ragotzy
04210aec5f Update output for doc hidden usefulness ui test output 2022-03-12 15:15:43 -05:00
Devin Ragotzy
ef0d99d8d4 Add struct to doc hidden usefulness ui tests 2022-03-12 15:15:22 -05:00
Devin Ragotzy
f481dba3d4 Add struct to stability ui tests in usefulness 2022-03-12 15:02:42 -05:00
Devin Ragotzy
4bf281a20c Update non-exhaustive omitted_patterns ui output 2022-03-12 15:02:42 -05:00
Devin Ragotzy
3344833a61 Add unstable struct fields to ui tests 2022-03-12 15:02:42 -05:00
Devin Ragotzy
8663ee19e4 Fix omitted_patterns lint showing unstable/doc hidden fields 2022-03-12 15:02:42 -05:00
bors
f103b2969b Auto merge of #94865 - notriddle:notriddle/single-colon-path-not-const-generics, r=cjgillot
diagnostics: single colon within `<>` probably, not type ascription

Fixes #94812
2022-03-12 19:10:33 +00:00
bors
22a20e3f0f Auto merge of #94711 - ouz-a:master3, r=oli-obk
Return early to fix ICE

This fixes #94627, ICE happens because compiler tries to suggest constraining type parameter but the only constraint is implicit `std::Sized` one, so it gets removed and there is nothing to suggest resulting in ICE.
2022-03-12 16:37:07 +00:00
ouz-a
1853ffccbc don't call multipart_suggestion 2022-03-12 18:51:28 +03:00
Michael Howell
26e299a4a7 Use consistent prose for ::
Co-authored-by: Camille Gillot <gillot.camille@gmail.com>
2022-03-12 08:20:36 -07:00
Guillaume Gomez
ad2ae5dbb2 Update browser-ui-test version used in CI 2022-03-12 16:07:42 +01:00
bors
ed2a69c4a9 Auto merge of #94873 - DrMeepster:box_alloc_ice3, r=oli-obk
Fix ICE when using Box<T, A>, again

Sequel to #94043, fixes #94835.
2022-03-12 14:18:34 +00:00
Camille GILLOT
d3b7ea6c9e Identify anonymous lifetimes by their DefId in HIR. 2022-03-12 14:18:56 +01:00
Nikolai Vazquez
6b5acf0d40 Use Self::BITS in log2 implementation 2022-03-12 08:01:35 -05:00
Nikolai Vazquez
1d13de6867 Implement BITS constant for non-zero integers 2022-03-12 08:00:45 -05:00
bors
258256697b Auto merge of #94870 - notriddle:notriddle/filter-regression, r=oli-obk
diagnostics: do not spurriously claim something is "not an iterator"

Fixes a minor regression caused by #94746, where `iter::Filter` is spurriously declared "not an iterator."
2022-03-12 11:58:07 +00:00
bors
f8a29bd95e Auto merge of #94875 - matthiaskrgr:rollup-tq1li2d, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - #94150 (rustdoc-json: Include GenericParamDefKind::Type::synthetic in JSON)
 - #94833 ([2/2] Implement macro meta-variable expression)
 - #94863 (Remove redundant slicing of whole ranges in `bootstrap`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-03-12 09:30:06 +00:00
Matthias Krüger
49e0137a15
Rollup merge of #94863 - pierwill:bootstrap-slicing, r=Mark-Simulacrum
Remove redundant slicing of whole ranges in `bootstrap`

Found with `clippy::redundant_slicing`.
2022-03-12 09:35:47 +01:00
Matthias Krüger
8c87132103
Rollup merge of #94833 - c410-f3r:meta-take-2, r=petrochenkov
[2/2] Implement macro meta-variable expression

Final part of https://github.com/rust-lang/rust/pull/93545#issuecomment-1050963295

r? `@petrochenkov`
2022-03-12 09:35:45 +01:00
Matthias Krüger
27e674d9e9
Rollup merge of #94150 - Enselic:synthetic-generic-parameters-in-json, r=CraftSpider
rustdoc-json: Include GenericParamDefKind::Type::synthetic in JSON

The rustdoc JSON for

```
pub fn f(_: impl Clone) {}
```

will effectively be

```
pub fn f<impl Clone: Clone>(_: impl Clone) {}
```

where a synthetic generic parameter called `impl Clone` with generic trait bound
`Clone` is added to the function declaration.

The generated HTML filters out these generic parameters by doing
`self.params.iter().filter(|p| !p.is_synthetic_type_param())`, because the
synthetic generic paramter is not of interest to regular users.

For the same reason, we should expose whether or not a generic parameter is
synthetic or not also in the rustdoc JSON, so that rustdoc JSON clients can also
have the option to hide syntehtic generic parameters.

`@rustbot` modify labels: +A-rustdoc-json
2022-03-12 09:35:44 +01:00
bors
012720ffb0 Auto merge of #94733 - nnethercote:fix-AdtDef-interning, r=fee1-dead
Improve `AdtDef` interning.

This commit makes `AdtDef` use `Interned`. Much of the commit is tedious
changes to introduce getter functions. The interesting changes are in
`compiler/rustc_middle/src/ty/adt.rs`.

r? `@fee1-dead`
2022-03-12 07:02:05 +00:00
Ralf Jung
b6ee5293f4
rust-lang/portable-simd#259: remove Miri from CI 2022-03-11 18:14:52 -08:00
DrMeepster
9d72dd54d0 fix another assumption about box 2022-03-11 17:00:56 -08:00
Jacob Lifshay
b6e03f5886 Change beginner's guide to explain Reducing rather than Horizontal. 2022-03-11 16:27:00 -08:00
Michael Howell
317f684160 diagnostics: do not spurriously claim something is "not an iterator"
Fixes a minor regression caused by #94746, where iter::Filter is
spurriously declared "not an iterator."
2022-03-11 16:59:32 -07:00
David Tolnay
af53809c87
Format core and std macro rules, removing needless surrounding blocks 2022-03-11 15:26:51 -08:00
Michael Howell
ce6f987bdb Add regression test for <i32 as Iterator>::count
Fixes #84495
2022-03-11 16:21:31 -07:00
Jacob Lifshay
c196b8abaa replace horizontal_* with reduce_* 2022-03-11 14:49:06 -08:00
Michael Howell
7e323370b3 diagnostics: single colon within <> probably, not type ascription
Fixes #94812
2022-03-11 15:35:18 -07:00
Felix S. Klock II
8f4c6b039d run rust-fix in amputate-span.rs. (Thanks to ekuber for pushing me to do this.) 2022-03-11 16:57:34 -05:00
bors
2c6a29af35 Auto merge of #94860 - Dylan-DPC:rollup-n06j8h6, r=Dylan-DPC
Rollup of 7 pull requests

Successful merges:

 - #87618 (Add missing documentation for std::char types)
 - #94769 (Collapse blanket and auto-trait impls by default)
 - #94798 (`parse_tt` refactorings)
 - #94818 (Rename `IntoFuture::Future` to `IntoFuture::IntoFuture`)
 - #94827 (CTFE/Miri: detect out-of-bounds pointers in offset_from)
 - #94838 (Make float parsing docs more comprehensive)
 - #94839 (Suggest using double colon when a struct field type include single colon)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-03-11 21:44:06 +00:00
Caio
d0eca08bc4 Implement macro meta-variable expression 2022-03-11 17:48:51 -03:00
pierwill
df9797b791 Remove redundant slicing of whole ranges in bootstrap 2022-03-11 13:52:14 -06:00
pierwill
415d37677e Remove unneeded conversions in bootstrapping code
Fixes warnings from `clippy::useless_conversion` in `src/bootstrap`.
2022-03-11 13:38:31 -06:00
Dylan DPC
298c9a0e14
Rollup merge of #94839 - TaKO8Ki:suggest-using-double-colon-for-struct-field-type, r=cjgillot
Suggest using double colon when a struct field type include single colon

#92685
2022-03-11 20:29:47 +01:00
Dylan DPC
ad513548ce
Rollup merge of #94838 - antonok-edm:float-parse-docs, r=Dylan-DPC
Make float parsing docs more comprehensive

I was working on some code with some specialized restrictions on float parsing. I noticed the doc comments for `f32::from_str` and `f64::from_str` were missing several cases of valid inputs that are otherwise difficult to discover without looking at source code.

I'm not sure if the doc comments were initially intended to contain a comprehensive description of valid inputs, but I figured it's useful to include these extra cases for reference.
2022-03-11 20:29:46 +01:00
Dylan DPC
9e70b1a033
Rollup merge of #94827 - RalfJung:offset-from-ub, r=oli-obk
CTFE/Miri: detect out-of-bounds pointers in offset_from

Also I became uneasy with aggressively doing `try_to_int` here -- this will always succeed on Miri, leading to the wrong codepath being taken. We should rather try to convert them both to pointers, and use the integer path as a fallback, so that's what I implemented now.

Hiding whitespaces helps with the diff.

Fixes https://github.com/rust-lang/miri/issues/1950

r? ``@oli-obk``
2022-03-11 20:29:45 +01:00
Dylan DPC
fedf70acb1
Rollup merge of #94818 - yoshuawuyts:into-future-associated-type, r=joshtriplett
Rename `IntoFuture::Future` to `IntoFuture::IntoFuture`

Ref: https://github.com/rust-lang/rust/issues/67644#issuecomment-1051401459

This renames `IntoFuture::Future` to `IntoFuture::IntoFuture`. This adds the `Into*` prefix to the associated type, similar to the [`IntoIterator::IntoIter`](https://doc.rust-lang.org/std/iter/trait.IntoIterator.html#associatedtype.IntoIter) associated type. It's my mistake we didn't do so in the first place. This fixes that and brings the two closer together. Thanks!

### References
__`IntoIterator` trait def__
```rust
pub trait IntoIterator {
    type Item;
    type IntoIter: Iterator<Item = Self::Item>;
    fn into_iter(self) -> Self::IntoIter;
}
```
__`IntoFuture` trait def__
```rust
pub trait IntoFuture {
    type Output;
    type IntoFuture: Future<Output = Self::Output>; // Prior to this PR: `type Future:`
    fn into_future(self) -> Self::IntoFuture;
}
```

cc/ `@eholk` `@rust-lang/wg-async`
2022-03-11 20:29:45 +01:00
Dylan DPC
86376e3aea
Rollup merge of #94798 - nnethercote:parse_tt-refactor, r=petrochenkov
`parse_tt` refactorings

Some readability improvements.

r? ``@petrochenkov``
2022-03-11 20:29:44 +01:00
Dylan DPC
0e3ae8d2bf
Rollup merge of #94769 - GuillaumeGomez:collapsed-by-default, r=notriddle
Collapse blanket and auto-trait impls by default

Blocked on #94740 (the two first commits come from it).

This behaviour was changed in https://github.com/rust-lang/rust/pull/88490 and apparently wasn't caught since then.

You can test it [here](https://rustdoc.crud.net/imperio/collapsed-by-default/test_docs/struct.Foo.html#blanket-implementations).

r? ``@notriddle``
2022-03-11 20:29:43 +01:00
Dylan DPC
85056107fa
Rollup merge of #87618 - GuillaumeGomez:std-char-types-doc, r=jyn514,camelid
Add missing documentation for std::char types
2022-03-11 20:29:42 +01:00
bors
335ffbfa54 Auto merge of #94472 - JmPotato:use_maybeuninit_for_vecdeque, r=m-ou-se
Use MaybeUninit in VecDeque to remove the undefined behavior of slice

Signed-off-by: JmPotato <ghzpotato@gmail.com>

Ref https://github.com/rust-lang/rust/issues/74189. Adjust the code to follow the [doc.rust-lang.org/reference/behavior-considered-undefined.html](https://doc.rust-lang.org/reference/behavior-considered-undefined.html).

* Change the return type of `buffer_as_slice` from `&[T]` to `&[MaybeUninit<T>]`.
* Add some corresponding safety comments.

Benchmark results:

master 8d6f527530

```rust
test collections::vec_deque::tests::bench_pop_back_100       ... bench:          47 ns/iter (+/- 1)
test collections::vec_deque::tests::bench_pop_front_100      ... bench:          50 ns/iter (+/- 4)
test collections::vec_deque::tests::bench_push_back_100      ... bench:          69 ns/iter (+/- 10)
test collections::vec_deque::tests::bench_push_front_100     ... bench:          72 ns/iter (+/- 6)
test collections::vec_deque::tests::bench_retain_half_10000  ... bench:     145,891 ns/iter (+/- 7,975)
test collections::vec_deque::tests::bench_retain_odd_10000   ... bench:     141,647 ns/iter (+/- 3,711)
test collections::vec_deque::tests::bench_retain_whole_10000 ... bench:     120,132 ns/iter (+/- 4,078)
```

This PR

```rust
test collections::vec_deque::tests::bench_pop_back_100       ... bench:          48 ns/iter (+/- 2)
test collections::vec_deque::tests::bench_pop_front_100      ... bench:          51 ns/iter (+/- 3)
test collections::vec_deque::tests::bench_push_back_100      ... bench:          73 ns/iter (+/- 2)
test collections::vec_deque::tests::bench_push_front_100     ... bench:          73 ns/iter (+/- 2)
test collections::vec_deque::tests::bench_retain_half_10000  ... bench:     131,796 ns/iter (+/- 5,440)
test collections::vec_deque::tests::bench_retain_odd_10000   ... bench:     137,563 ns/iter (+/- 3,349)
test collections::vec_deque::tests::bench_retain_whole_10000 ... bench:     128,815 ns/iter (+/- 3,289)
```
2022-03-11 19:23:55 +00:00
bors
c9b45e6010 Auto merge of #90253 - Kobzol:hash-stable-sort-index-map, r=cjgillot
Change several HashMaps to IndexMap to improve incremental hashing performance

Stable hashing hash maps in incremental mode takes a lot of time, especially for some benchmarks like `clap`. As noted by `@Mark-Simulacrum` [here](https://github.com/rust-lang/rust/pull/89404#issuecomment-950043892), this cost could be reduced by replacing some hash maps by indexmaps.

I gathered some statistics and found several hash maps that took a lot of time to hash and replaced them by indexmaps. However, in order for this to work, we need to make sure that these indexmaps have deterministic insertion order. These three are used only in visitors as far as I can see, which seems deterministic. Can we enforce this somehow? Or should some explaining comment be included for these maps?
2022-03-11 16:37:55 +00:00
bors
af8604fadd Auto merge of #94845 - Dylan-DPC:rollup-3phylaq, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #93283 (Fix for localized windows editions in testcase fn read_link() Issue#93211)
 - #94592 (Fallback to top-level config.toml if not present in current directory, and remove fallback for env vars and CLI flags)
 - #94776 (Optimize ascii::escape_default)
 - #94840 (update `replace_bound_vars_with_placeholders` doc comment)
 - #94842 (Remove unnecessary try_opt for operations that cannot fail)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-03-11 13:56:33 +00:00
Guillaume Gomez
aad4227607 Update GUI test 2022-03-11 14:48:53 +01:00
Guillaume Gomez
87fba23d52 Collapse Blanket Implementations and Auto-trait implementations by default 2022-03-11 14:48:53 +01:00
Dylan DPC
fb3d126458
Rollup merge of #94842 - tspiteri:there-is-no-try, r=Dylan-DPC
Remove unnecessary try_opt for operations that cannot fail

As indicated in the added comments, some operation cannot overflow, so using `try_opt!` for them is unnecessary.
2022-03-11 13:38:39 +01:00
Dylan DPC
4ec98d8415
Rollup merge of #94840 - lcnr:update-comment, r=Dylan-DPC
update `replace_bound_vars_with_placeholders` doc comment
2022-03-11 13:38:38 +01:00
Dylan DPC
cdd6d39ecc
Rollup merge of #94776 - martingms:optimize-escape-default, r=nnethercote
Optimize ascii::escape_default

`ascii::escape_default` showed up as a hot function when compiling `deunicode-1.3.1` in `@nnethercote's` [analysis](https://hackmd.io/mxdn4U58Su-UQXwzOHpHag) of `@lqd's` [rustc-benchmarking-data](https://github.com/lqd/rustc-benchmarking-data).
After taking a look at the generated assembly it looked like a LUT-based approach could be faster for `hexify()`-ing ascii characters, so that's what this PR implements

The patch looks like it provides about a 1-2% improvement in instructions for that particular crate. This should definitely be verified with a perf run as I'm still getting used to the `rustc-perf` tooling and might easily have made an error!
2022-03-11 13:38:37 +01:00
Dylan DPC
b711d17c37
Rollup merge of #94592 - jyn514:consistent-config-loading, r=Mark-Simulacrum
Fallback to top-level config.toml if not present in current directory, and remove fallback for env vars and CLI flags

This preserves the behavior where x.py will only give a hard error on a missing config file if it was configured through `--config` or RUST_BOOTSTRAP_CONFIG. It also removes the top-level fallback for everything except the default path; presumably if you're passing the path explicitly, you expect it to be exactly there and don't want to look in the root directory.

Fixes https://github.com/rust-lang/rust/issues/94589.
2022-03-11 13:38:36 +01:00