Commit Graph

150244 Commits

Author SHA1 Message Date
Jacob Hoffman-Andrews
bff4f073c8 Use render_impl_summary when rendering traits. 2021-06-16 22:08:44 -07:00
Jacob Hoffman-Andrews
ce6472987d Remove methods under Implementors on trait pages
These were hidden by default, and duplicated information already on the
page anyhow.

Also remove the "Auto-hide trait implementors of a trait" setting,
which is not needed anymore.
2021-06-16 22:08:36 -07:00
Yuki Okushi
c0efd2a15b
Prefer partition_point to look up assoc items 2021-06-17 11:40:37 +09:00
Yerkebulan Tulibergenov
a89c7e1f61 add regression test for issue #37508 2021-06-16 18:44:26 -07:00
bors
50a407200b Auto merge of #86380 - cuviper:1.53-compat-bits, r=Mark-Simulacrum
Add a compatibility note for BITS in 1.53

Closes #85667
r? `@Mark-Simulacrum`
2021-06-17 01:12:30 +00:00
Kevin Reid
cb2f8d9b02 Make sum() and product() hyperlinks refer to Iterator methods.
The previous linking seemed confusing: within "the sum() method on
iterators", "sum()" was linked to `Sum::sum`, not `Iterator::sum`, even
though the sentence is talking about the latter.

I have rewritten the sentence to be, I believe, clearer, as well as
changing the link destinations; applying the same change to the
`Product` documentation as well as `Sum`.
2021-06-16 17:52:33 -07:00
Yuki Okushi
34f38bf760
Make s pre-interned 2021-06-17 09:45:19 +09:00
Sören Meier
664bde0770 rename remaining to remaining_slice and add a new remaining 2021-06-17 02:14:53 +02:00
Yuki Okushi
636170a1e2
Remove #[allow(unused_lifetimes)] which is now unnecessary 2021-06-17 08:56:54 +09:00
Yuki Okushi
4f8e0ebcc5
Use AttrVec for Arm, FieldDef, and Variant 2021-06-17 08:04:54 +09:00
bors
444a85ac38 Auto merge of #86379 - JohnTitor:rollup-mkz9x36, r=JohnTitor
Rollup of 10 pull requests

Successful merges:

 - #85870 (Allow whitespace in dump_mir filter)
 - #86104 (Fix span calculation in format strings)
 - #86140 (Mention the `Borrow` guarantee on the `Hash` implementations for Arrays and `Vec`)
 - #86141 (Link reference in `dyn` keyword documentation)
 - #86260 (Open trait implementations' toggles by default.)
 - #86339 (Mention #79078 on compatibility notes of 1.52)
 - #86341 (Stop returning a value from `report_assert_as_lint`)
 - #86353 (Remove `projection_ty_from_predicates`)
 - #86361 (Add missing backslashes to prevent unwanted newlines in rustdoc HTML)
 - #86372 (Typo correction: s/is/its)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-06-16 22:48:31 +00:00
Smitty
044b3620e7 Move some hard error logic to InterpError 2021-06-16 18:23:34 -04:00
The8472
bde9570069 Lazify is_really_default condition in the RustdocGUI bootstrap step
The `RustdocGUI::should_run` condition spawns `npm list` several times
which adds up to seconds of wall-time.
Evaluate the condition lazily to to keep `./x.py test tidy` and similar
short-running tasks fast.
2021-06-17 00:17:17 +02:00
Yerkebulan Tulibergenov
503abc77d2 add regression test for issue #39161 2021-06-16 14:05:36 -07:00
Josh Stone
fded947257 Add a compatibility note for BITS in 1.53 2021-06-16 14:04:33 -07:00
Yuki Okushi
27d5426bcf
Rollup merge of #86372 - snoyberg:patch-1, r=jonas-schievink
Typo correction: s/is/its
2021-06-17 05:55:02 +09:00
Yuki Okushi
129723553b
Rollup merge of #86361 - GuillaumeGomez:missing-backslashes, r=jsha
Add missing backslashes to prevent unwanted newlines in rustdoc HTML

Just adding some forgotten backslashes.

r? `@jsha`
2021-06-17 05:55:01 +09:00
Yuki Okushi
05ba958fe8
Rollup merge of #86353 - JohnTitor:remove-projection_ty_from_predicates, r=oli-obk
Remove `projection_ty_from_predicates`

Fixes #86350
r? ``@oli-obk``
2021-06-17 05:54:59 +09:00
Yuki Okushi
36bf808aa1
Rollup merge of #86341 - LingMan:ret_val, r=davidtwco
Stop returning a value from `report_assert_as_lint`

This function only ever returns `None`. Make that explicity by not returning a value at all.

`@rustbot` modify labels +C-cleanup +T-compiler
2021-06-17 05:54:58 +09:00
Yuki Okushi
4e9dc76d36
Rollup merge of #86339 - JohnTitor:note-derive-on-proc-macros, r=petrochenkov
Mention #79078 on compatibility notes of 1.52

Closes #85854
r? ``@petrochenkov``
2021-06-17 05:54:57 +09:00
Yuki Okushi
b5c3ef66e6
Rollup merge of #86260 - jsha:expand-methods, r=GuillaumeGomez
Open trait implementations' toggles by default.

This makes it possible to use Ctrl-F to find methods defined in traits.

As discussed in #85923. This modifies the approach suggested in #40363, but still achieves the goal of skimmability. For new users who aren't familiar with all the traits, their methods are readily visible and searchable. For experienced users who prefer to skim the list of all traits, there are two options: the "collapse all" shortcut, and the "auto hide trait implementations" setting.

Demo https://hoffman-andrews.com/rust/expand-methods/std/string/struct.String.html#trait-implementations

r? `@GuillaumeGomez`
2021-06-17 05:54:56 +09:00
Yuki Okushi
0d14acad7e
Rollup merge of #86141 - amorison:link-ref-in-doc-dyn-keyword, r=kennytm
Link reference in `dyn` keyword documentation

The "read more" sentence formatted "object safety" as inline code
instead of providing a link to more information.  This PR adds a link
to the Reference about this matter, as well as the page regarding trait
objects.

---

We could also put these links in the very first line (instead of the link to the
Book) and in the first paragraph which mentions the "object safe" requirement.
Personally, I think it's good to keep the link to the Book up-front as it's more
accessible than the Reference.
2021-06-17 05:54:55 +09:00
Yuki Okushi
b1fb32d165
Rollup merge of #86140 - scottmcm:array-hash-facepalm, r=kennytm
Mention the `Borrow` guarantee on the `Hash` implementations for Arrays and `Vec`

To remind people like me who forget about it and send PRs to make them different, and to (probably) get a test failure if the code is changed to no longer uphold it.
2021-06-17 05:54:54 +09:00
Yuki Okushi
4ff55ecf04
Rollup merge of #86104 - FabianWolff:issue-86085, r=davidtwco
Fix span calculation in format strings

This pull request fixes #86085. The ICE described there is due to an error in the span calculation inside format strings, if the format string is the result of a macro invocation:
```rust
fn main() {
    format!(concat!("abc}"));
}
```
currently produces:
```
error: invalid format string: unmatched `}` found
 --> test.rs:2:17
  |
2 |     format!(concat!("abc}"));
  |                 ^ unmatched `}` in format string
```
which is obviously incorrect. This happens because the span of the entire `concat!()` is combined with the _relative_ location of the unmatched `` `}` `` in the _result_ of the macro invocation (i.e. 4).

In #86085, this has led to a span that starts or ends in the middle of a multibyte character, but the root cause was the same. This pull request fixes the problem.
2021-06-17 05:54:52 +09:00
Yuki Okushi
7030efbb77
Rollup merge of #85870 - ptrojahn:mir_dump_whitespace, r=davidtwco
Allow whitespace in dump_mir filter

At least on my system this is necessary to get more complex filters with spaces like in https://rustc-dev-guide.rust-lang.org/mir/debugging.html working.
2021-06-17 05:54:46 +09:00
Smitty
210e46bf24 Add pattern walking support to THIR walker 2021-06-16 16:36:43 -04:00
bors
a85f584aeb Auto merge of #86266 - LeSeulArtichaut:box-thir-adt, r=davidtwco
Box `thir::ExprKind::Adt` for performance

`Adt` is the biggest variant in the enum and probably isn't used very often compared to the other expr kinds, so boxing it should be beneficial for performance. We need a perf test to be sure.
2021-06-16 20:00:17 +00:00
Deadbeef
e4b3131584
Use as_secs_f64 in JunitFormatter 2021-06-17 03:23:17 +08:00
Jacob Hoffman-Andrews
62658bfc22 Open trait implementations' toggles by default.
This makes it possible to use Ctrl-F to find methods defined in traits.
2021-06-16 10:24:59 -07:00
Michael Snoyman
770e8cc01e
Typo correction: s/is/its 2021-06-16 19:20:15 +03:00
Sören Meier
212e91a356
Update tracking issue 2021-06-16 17:25:47 +02:00
bors
9fef8d91b4 Auto merge of #86179 - the8472:revere-path-cmp, r=kennytm
optimize Eq implementation for paths

Filesystems generally have a tree-ish structure which means paths are more likely to share a prefix than a suffix. Absolute paths are especially prone to share long prefixes.

quick benchmark consisting of a search through through a vec containing the absolute paths of all (1850) files in `compiler/`:

```
# old
test path::tests::bench_path_cmp                                  ... bench:     227,407 ns/iter (+/- 2,162)

# new
test path::tests::bench_path_cmp                                  ... bench:      64,976 ns/iter (+/- 1,142)
```
2021-06-16 15:18:19 +00:00
Trinity Pointard
5f7d44171d rename test-cases 2021-06-16 14:42:51 +02:00
Guillaume Gomez
a2a006d1cc Add missing backslashes to prevent unwanted backlines in rustdoc HTML 2021-06-16 14:39:51 +02:00
bors
8daad743c4 Auto merge of #86332 - rylev:fix-ice-docalias, r=GuillaumeGomez
Fix ICE when doc aliases were put on function params

Fixes #86239

r? `@GuillaumeGomez`
2021-06-16 10:01:20 +00:00
Yuki Okushi
fb06d9e0cd
Move some typeck-related tests to the typeck dir 2021-06-16 19:01:05 +09:00
Yuki Okushi
d828eadd7a
Remove invalid suggestions for assoc consts on placeholder type error 2021-06-16 18:57:53 +09:00
Guillaume Gomez
95c1bf6000 Allow to pass arguments to rustdoc-gui tool 2021-06-16 11:54:19 +02:00
Yuki Okushi
280d19395d
Remove projection_ty_from_predicates 2021-06-16 16:33:03 +09:00
bors
2336406b38 Auto merge of #86291 - crlf0710:trait_vtbl_refactor, r=bjorn3
Refactor vtable codegen

This refactor the codegen of vtables of miri interpreter, llvm, cranelift codegen backends.

This is preparation for the implementation of trait upcasting feature. cc #65991

Note that aside from code reorganization, there's an internal behavior change here that now InstanceDef::Virtual's index now include the three metadata slots, and now the first method is with index 3.

cc  `@RalfJung` `@bjorn3`
2021-06-16 07:20:27 +00:00
bors
52b22869db Auto merge of #86348 - JohnTitor:rollup-o6a6k67, r=JohnTitor
Rollup of 8 pull requests

Successful merges:

 - #85283 (Avoid possible filename collision in coverage tests)
 - #86200 (Updates `Clone` docs for `Copy` comparison.)
 - #86209 (fix minor wording/typo issues in core::option docs)
 - #86242 (rustdoc- dont ICE on `ConstEvaluatable` predicates)
 - #86280 (Add a regression test for issue-76510)
 - #86293 (Allow to run only a few GUI tests)
 - #86327 (Don't mark "safe" intrinsics as unsafe)
 - #86345 (Remove some duplicate `char` assoc items on RELEASES.md)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-06-16 04:51:54 +00:00
Yerkebulan Tulibergenov
782824c48f add regression test for issue #78632 2021-06-15 21:32:13 -07:00
Yuki Okushi
59ffa34fa8
Rollup merge of #86345 - JohnTitor:dup-char-items-in-relnotes, r=Mark-Simulacrum
Remove some duplicate `char` assoc items on RELEASES.md

They were stabilized on 1.52 but 1.53's note also has them mistakenly.
Originally reported on [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/241545-t-release/topic/incorrect.20relnotes).
2021-06-16 13:31:13 +09:00
Yuki Okushi
98d58420c1
Rollup merge of #86327 - GuillaumeGomez:safe-intrinsics, r=lqd
Don't mark "safe" intrinsics as unsafe

A good example of this is [intrinsics::abort](https://doc.rust-lang.org/nightly/core/intrinsics/fn.abort.html).

Before:

![Screenshot from 2021-06-15 14-58-42](https://user-images.githubusercontent.com/3050060/122056942-65ddad00-cdea-11eb-829e-5f5e258387de.png)

After:

![Screenshot from 2021-06-15 14-59-22](https://user-images.githubusercontent.com/3050060/122056956-6aa26100-cdea-11eb-94d8-e18b4956cfa4.png)

cc ``@jyn514``
r? ``@lqd``
2021-06-16 13:31:12 +09:00
Yuki Okushi
daee58cab8
Rollup merge of #86293 - GuillaumeGomez:filter-gui-tests-run, r=jsha
Allow to run only a few GUI tests

It allows to specify only one (or more) GUI tests. Considering the tests are not super fast to run, this is very useful for development.

cc `@Mark-Simulacrum`
r? `@jsha`
2021-06-16 13:31:11 +09:00
Yuki Okushi
5387b2444f
Rollup merge of #86280 - JohnTitor:issue-76510, r=oli-obk
Add a regression test for issue-76510

Fixed by #78407, closes #76510
r? ``@oli-obk``
2021-06-16 13:31:09 +09:00
Yuki Okushi
9fcbbbb1fb
Rollup merge of #86242 - BoxyUwU:rustdoc-const-evaluatable-ice, r=oli-obk
rustdoc- dont ICE on `ConstEvaluatable` predicates

Fixes #77647

rustdoc doesn't need to be handling these as you cant write them, they just get added implicitly when you write a where clause containing an expression.
2021-06-16 13:31:08 +09:00
Yuki Okushi
d476707a1f
Rollup merge of #86209 - tlyu:option-doc-typos, r=JohnTitor
fix minor wording/typo issues in core::option docs

These are just minor wording or typo things I came across while making other edits.
2021-06-16 13:31:07 +09:00
Yuki Okushi
7ceb706e9d
Rollup merge of #86200 - qwerty01:clone-doc-update, r=JohnTitor
Updates `Clone` docs for `Copy` comparison.

Quite a few people (myself included) have come under the impression that the difference between `Copy` and `Clone` is that `Copy` is cheap and `Clone` is expensive, where the actual difference is that `Copy` constrains the type to bit-wise copying, and `Clone` allows for more expensive operations. The source of this misconception is in the `Clone` docs, where the following line is in the description:

> Differs from `Copy` in that `Copy` is implicit and extremely inexpensive, while `Clone` is always explicit and may or may not be expensive.

The `Clone` documentation page also comes up before the `Copy` page on google when searching for "the difference between `Clone` and `Copy`".

This PR updates the documentation to clarify that "extremely inexpensive" means an "inexpensive bit-wise copy" to hopefully prevent future rust users from falling into this misunderstanding.
2021-06-16 13:31:06 +09:00
Yuki Okushi
163dbda22b
Rollup merge of #85283 - Swatinem:ordered-profraw, r=tmandry
Avoid possible filename collision in coverage tests

Previously, coverage tests were writing profiler data to files based on
their pid. As rustdoc spawns each doctest as its own process, it might
be possible in rare cases that a pid is being reused which would cause
a file to be overwritten, leading to incorrect coverage results.

should help with #83262

r? `@tmandry`
2021-06-16 13:31:04 +09:00