Commit Graph

125790 Commits

Author SHA1 Message Date
Tyler Mandry
0fdc8c06dd
Rollup merge of #75674 - poliorcetics:intra-links-std-io, r=jyn514
Move to intra doc links for std::io

Helps with #75080.

@rustbot modify labels: T-doc, A-intra-doc-links, T-rustdoc

r? @jyn514

I had no problems with those files so I added some small links here and there.
2020-08-19 11:12:23 -07:00
Tyler Mandry
7d1407721c
Rollup merge of #75649 - jyn514:inherent-lang-impls, r=guillaumegomez
Fix intra-doc links for inherent impls that are both lang items and not the default impl

I found in https://github.com/rust-lang/rust/pull/75464#issuecomment-675125984 that `str::to_uppercase()` doesn't resolve while `str::trim()` does. The only real difference is that `to_uppercase` is defined in `alloc`, while trim is defined in `core`. It turns out that rustdoc was ignoring `lang_items.str_alloc_impl()` - it saw them in `collect_trait_impls`, but not for intra-doc links.

This uses the same `impls` for all parts of rustdoc, so that there can be no more inconsistency. It does have the slight downside that the matches are no longer exhaustive but it will be very clear if a new lang item is missed because it will panic when you try to document it (and if you don't document it, does rustdoc really need to know about it?).

~~This needs a test case (probably just `str::to_uppercase`).~~ Added.

This is best reviewed commit-by-commit.

r? @GuillaumeGomez
2020-08-19 11:12:22 -07:00
Tyler Mandry
4123237fa1
Rollup merge of #75648 - matklad:lazy-dropck, r=KodrAus
Make OnceCell<T> transparent to dropck

See the failed build in

https://github.com/rust-lang/rust/pull/75555#issuecomment-675016718

for an example where we need this in real life

r? @ghost
2020-08-19 11:12:20 -07:00
Tyler Mandry
0e7e939788
Rollup merge of #75593 - Mark-Simulacrum:compiler-docs-must-not-overlap, r=pietroalbini
Adjust installation place for compiler docs

This avoids conflicts when installing with rustup; rustup does not currently
support overlapping installations.

r? @matthiaskrgr
2020-08-19 11:12:18 -07:00
Tyler Mandry
1f70776f7b
Rollup merge of #75587 - RalfJung:mir-comment-fixes, r=ecstatic-morse
mir building: fix some comments

r? @oli-obk

At least I hope these fixes are right, please double-check.^^
2020-08-19 11:12:16 -07:00
Tyler Mandry
672d009b0c
Rollup merge of #75069 - lcnr:type-of-lazy-norm, r=varkor
move const param structural match checks to wfcheck

fixes #75047 fixes #74950

We currently check for structural match violations inside of `type_of`.
As we need to check the array length when checking if `[NonEq; arr_len]` is structural match, we potentially require the variance of an expression. Computing the variance requires `type_of` for all types though, resulting in a cycle error.

r? @varkor @eddyb
2020-08-19 11:12:15 -07:00
ThibsG
ccb049387a Fix bad printing of const-eval queries 2020-08-19 17:48:20 +02:00
bors
443e177c7f Auto merge of #75480 - ssomers:btree_check_invariant, r=Mark-Simulacrum
BTreeMap: check some invariants in unit tests
2020-08-19 15:27:40 +00:00
Yuki Okushi
b985c29d53
Remove the full-bootstrap builder from CI 2020-08-20 00:02:52 +09:00
Joshua Nelson
aff01f8de9 Add test for f32 and f64 methods 2020-08-19 10:53:44 -04:00
Denis Vasilik
f71919c3db Fix anchor links 2020-08-19 16:44:20 +02:00
Alexis Bourget
dad8e11e9f Fix nits in intra-doc links for std io 2020-08-19 16:26:17 +02:00
Denis Vasilik
6e2f076917 Use intra-doc links for links with anchors 2020-08-19 15:22:04 +02:00
Denis Vasilik
d1838f6c73 Use intra-doc links for compare_exchange and compare_exchange_weak 2020-08-19 15:12:28 +02:00
bors
e7f6ed14d5 Auto merge of #74098 - GuillaumeGomez:doc-alias-checks, r=ollie27
Doc alias checks: ensure only items appearing in search index can use it

Following the discussion in #73721, I added checks to ensure that only items appearing in the search are allowed to have doc alias.

r? @ollie27
2020-08-19 13:10:16 +00:00
Joshua Nelson
570b0d9ece Add a test 2020-08-19 08:26:31 -04:00
Joshua Nelson
121974e37d xpy fmt 2020-08-19 08:26:31 -04:00
Joshua Nelson
219e93d91e Use impls for intra doc links as well 2020-08-19 08:26:28 -04:00
Guillaume Gomez
46f2b410e0 Clean up E0759 explanation 2020-08-19 14:22:52 +02:00
Joshua Nelson
9cf2fa84e8 Allow reusing the code in collect_trait_impls 2020-08-19 08:18:25 -04:00
Joshua Nelson
06d6d3dff5 impl_for_type -> PrimitiveType::impls 2020-08-19 08:18:25 -04:00
Joshua Nelson
3ddd8b233c Return all impls, not just the primary one 2020-08-19 08:18:24 -04:00
Joshua Nelson
8a0aa7bd9d Say tcx.lang_items() less 2020-08-19 08:18:24 -04:00
Joshua Nelson
967ec1f623 Refactor impl_for_type into a separate function 2020-08-19 08:18:24 -04:00
Denis Vasilik
751e343ab2 Use intra-doc linkks 2020-08-19 14:13:53 +02:00
Denis Vasilik
d339cfe4a1 Use intra-doc links for ptr::* 2020-08-19 13:38:22 +02:00
bors
11a44adc6f Auto merge of #75600 - nagisa:improve_align_offset, r=KodrAus
Improve codegen for `align_offset`

In this PR the `align_offset` implementation is changed/improved to produce better code in certain scenarios such as when pointer type is has a stride of 1 or when building for low optimisation levels.

While these changes do not achieve the "ideal" codegen referenced in #75579, it gets significantly closer to it. I’m not actually sure if the codegen can actually be much better with this function returning the offset, rather than the aligned pointer.

See the descriptions for separate commits for further information.
2020-08-19 10:54:44 +00:00
Denis Vasilik
2c7998720c Use intra-doc links for mem::* 2020-08-19 12:38:32 +02:00
Denis Vasilik
45b4e1470c Use intra-doc links for sync::* 2020-08-19 12:16:16 +02:00
Denis Vasilik
fb7d9170f4 Use intra-doc links for f32::* and f64::* 2020-08-19 12:04:23 +02:00
Ralf Jung
6a06bfc252 enable align_to tests in Miri 2020-08-19 10:41:51 +02:00
Aleksey Kladov
34e7eac1ca Remove #[cfg(miri)] from OnceCell tests
They were carried over from once_cell crate, but they are not entirely
correct (as miri now supports more things), and we don't run miri
tests for std, so let's just remove them.

Maybe one day we'll run miri in std, but then we can just re-install
these attributes.
2020-08-19 10:28:22 +02:00
Denis Vasilik
a929738478 Use intra-doc links for u32::* 2020-08-19 10:19:06 +02:00
Denis Vasilik
7b5ec9e9e0 Use intra-doc links for AtomicU32::* 2020-08-19 09:58:41 +02:00
Denis Vasilik
2373dbce83 Use intra-doc links for AtomicI32::* 2020-08-19 09:52:19 +02:00
bors
5b04bbfcbb Auto merge of #75692 - JohnTitor:rollup-8gr04ah, r=JohnTitor
Rollup of 9 pull requests

Successful merges:

 - #75038 (See also X-Link mem::{swap, take, replace})
 - #75049 (docs(marker/copy): provide example for `&T` being `Copy`)
 - #75499 (Fix documentation error)
 - #75554 (Fix clashing_extern_declarations stack overflow for recursive types.)
 - #75646 (Move to intra doc links for keyword documentation)
 - #75652 (Resolve true and false as booleans)
 - #75658 (Don't emit "is not a logical operator" error outside of associative expressions)
 - #75665 (Add doc examples coverage)
 - #75685 (Switch to intra-doc links in /src/sys/unix/ext/*.rs)

Failed merges:

r? @ghost
2020-08-19 06:59:13 +00:00
Yuki Okushi
07ea340e89
Rollup merge of #75685 - nixphix:docs/unix-ext, r=jyn514
Switch to intra-doc links in /src/sys/unix/ext/*.rs

Partial fix for #75080

@rustbot modify labels: T-doc, A-intra-doc-links, T-rustdoc

r? @jyn514

These two links are not resolving to either `crate::fs::File...` or `fs::File...`
```
# unix/ext/fs.rs
   27:    /// [`File::read`]: ../../../../std/fs/struct.File.html#method.read

  130:   /// [`File::write`]: ../../../../std/fs/struct.File.html#method.write
```
2020-08-19 15:54:39 +09:00
Yuki Okushi
98f7d882c8
Rollup merge of #75665 - GuillaumeGomez:doc-examples-coverage, r=jyn514
Add doc examples coverage

r? @jyn514
2020-08-19 15:54:37 +09:00
Yuki Okushi
e6fe5232df
Rollup merge of #75658 - tgnottingham:issue-75599, r=estebank
Don't emit "is not a logical operator" error outside of associative expressions

Avoid showing this error where it doesn't make sense by not assuming
"and" and "or" were intended to mean "&&" and "||" until after we decide
to continue parsing input as an associative expression.

Note that the decision of whether or not to continue parsing input as an
associative expression doesn't actually depend on this assumption.

Fixes #75599

---

First time contributor! Let me know if there are any conventions or policies I should be following that I missed here. Thanks :)
2020-08-19 15:54:35 +09:00
Yuki Okushi
e6e917e12d
Rollup merge of #75652 - jyn514:true-false-2, r=GuillaumeGomez
Resolve true and false as booleans

Successor to https://github.com/rust-lang/rust/pull/75101.

r? @Manishearth
cc @rust-lang/rustdoc
2020-08-19 15:54:34 +09:00
Yuki Okushi
9cf390357b
Rollup merge of #75646 - poliorcetics:intra-links-keywords, r=jyn514
Move to intra doc links for keyword documentation

Helps with #75080.

@rustbot modify labels: T-doc, A-intra-doc-links, T-rustdoc
2020-08-19 15:54:32 +09:00
Yuki Okushi
e8d30bf542
Rollup merge of #75554 - jumbatm:fix-clashing-extern-decl-overflow, r=lcnr
Fix clashing_extern_declarations stack overflow for recursive types.

Fixes #75512.

Adds a seen set to `structurally_same_type` to avoid recursing indefinitely for types which contain values of the same type through a pointer or reference.
2020-08-19 15:54:30 +09:00
Yuki Okushi
ac264b53d1
Rollup merge of #75499 - jack-champagne:jack-champagne/issue-75412, r=Dylan-DPC
Fix documentation error

This should fix #75412. Just a quick >= to > sign replacement.
2020-08-19 15:54:28 +09:00
Yuki Okushi
1f4f31785e
Rollup merge of #75049 - janriemer:patch-1, r=poliorcetics
docs(marker/copy): provide example for `&T` being `Copy`

### Edited 2020-08-16 (most recent)
In the current documentation about the `Copy` marker trait, there is a section
with examples of structs that can implement `Copy`. Currently there is no example for
showing that shared references (`&T`) are also `Copy`.
It is worth to have a dedicated example for `&T` being `Copy`, because shared
references are an integral part of the language and it being `Copy` is not as
intuitive as other types that share this behaviour like `i32` or `bool`.

The example picks up on the previous non-`Copy` struct and shows that
structs can be `Copy`, even when they hold a shared reference to a non-`Copy` type.

-----------------------------------------
### Edited 2020-08-02, 3:28 p.m.
I've just realized that it says "in addition to the **implementors listed below**", which makes this PR kind of "wrong", because `&T` is indeed in the "implementors listed below".
Maybe we can instead show an example with `&T` in the [When can my type be Copy](https://doc.rust-lang.org/std/marker/trait.Copy.html#when-can-my-type-be-copy) section.

What I really want to achieve is that it becomes more obvious that `&T` is also `Copy`, because, I think, it is very valuable to know and it wasn't obvious for me, until I read something about it in a forum post.

What do you think? I would create another PR for that.
**Please feel free to close this PR.**

-----------------------------------
### Original post
In the current documentation about the `Copy` marker trait, there is a section
about "additional implementors", which list additional implementors of the `Copy` trait.
The fact that shared references are also `Copy` is mixed with another point,
which makes it hard to recognize and make it seem not as important.

This clarifies the fact that shared references are also `Copy`, by mentioning it as a
separate item in the list of "additional implementors".
2020-08-19 15:54:26 +09:00
Yuki Okushi
17d3ce457f
Rollup merge of #75038 - rust-lang:Havvy-patch-1, r=steveklabnik
See also X-Link mem::{swap, take, replace}

Since it's easy to end up at one of these functions when you really wanted the other one, cross link them with descriptions of why you'd want to use them.
2020-08-19 15:54:24 +09:00
Surya Midatala
632db79ad6 Apply suggestions from code review 2020-08-19 10:29:31 +05:30
Rich Kadel
d129ac2655 Moved coverage counter injection from BasicBlock to Statement. 2020-08-18 21:06:45 -07:00
bors
c03c213daf Auto merge of #75677 - cuviper:shrink-towel, r=Mark-Simulacrum
Don't panic in Vec::shrink_to_fit

We can help the compiler see that `Vec::shrink_to_fit` will never reach the panic case in `RawVec::shrink_to_fit`, just by guarding the call only for cases where the capacity is strictly greater. A capacity less than the length is only possible through an unsafe call to `set_len`, which would break the `Vec` invariants, so `shrink_to_fit` can just ignore that.

This removes the panicking code from the examples in both #71861 and #75636.
2020-08-19 02:56:59 +00:00
bors
1656582822 Auto merge of #75555 - workingjubilee:update-everything, r=Mark-Simulacrum
Cargo update (almost) all the things!

This runs `cargo update` on our dependency tree, bumping numerous crates. See details in the first commit of this PR.

Several updates were held back intentionally; version_check in particular landed a change in behavior in 0.9.2 (arguably a bug fix, but still will be split into a separate PR).
2020-08-19 01:02:19 +00:00
Prabakaran Kumaresshan
63d2e9b05f resolve comments 2020-08-19 06:19:35 +05:30