]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoAdd documentation for --show-coverage option
Guillaume Gomez [Thu, 20 Aug 2020 19:26:42 +0000 (21:26 +0200)]
Add documentation for --show-coverage option

3 years agoUpdate how doc examples are counted
Guillaume Gomez [Thu, 20 Aug 2020 19:15:02 +0000 (21:15 +0200)]
Update how doc examples are counted

3 years agoRemove "total" columns in --show-coverage output
Guillaume Gomez [Thu, 20 Aug 2020 19:09:40 +0000 (21:09 +0200)]
Remove "total" columns in --show-coverage output

3 years agoUpdate rustdoc coverage UI test
Guillaume Gomez [Wed, 19 Aug 2020 20:44:58 +0000 (22:44 +0200)]
Update rustdoc coverage UI test

3 years agoIgnore code examples on given items where it doesn't make sense
Guillaume Gomez [Wed, 19 Aug 2020 20:44:21 +0000 (22:44 +0200)]
Ignore code examples on given items where it doesn't make sense

3 years agoAuto merge of #75595 - davidtwco:polymorphization-predicate-simplification-correction...
bors [Thu, 20 Aug 2020 05:06:55 +0000 (05:06 +0000)]
Auto merge of #75595 - davidtwco:polymorphization-predicate-simplification-correction, r=eddyb

polymorphize: if any param in a predicate is used, then all are used

Addresses [review](https://github.com/rust-lang/rust/pull/75518#discussion_r470907646) [comments](https://github.com/rust-lang/rust/pull/75518#discussion_r470907865) [from](https://github.com/rust-lang/rust/pull/75518#discussion_r470908188) @eddyb in #75518 that I didn't get to resolve before bors merged.

This PR modifies polymorphization's handling of predicates so that if any generic parameter is used in a predicate then all parameters in that predicate are used.

r? @eddyb

3 years agoAuto merge of #75720 - ehuss:update-books, r=ehuss
bors [Thu, 20 Aug 2020 03:09:19 +0000 (03:09 +0000)]
Auto merge of #75720 - ehuss:update-books, r=ehuss

Update books

## nomicon

2 commits in bfe1ab96d717d1dda50e499b360f2e2f57e1750a..25854752549d44d76fbd7650e17cb4f167a0b8fb
2020-06-05 13:19:42 -0400 to 2020-08-19 16:41:48 -0400
- Follow-up of rust-lang/rust#75152 (rust-lang-nursery/nomicon#235)
- Follow-up for rust-lang/rust#74850 (rust-lang-nursery/nomicon#233)

## reference

7 commits in c9b2736a059469043177e1e4ed41a55d7c63ac28..1b6c4b0afab97c0230433466c97167bbbe8445f6
2020-08-03 03:34:03 -0700 to 2020-08-18 17:04:28 -0700
- Some constant/static updates. (rust-lang-nursery/reference#867)
- Add casting rules from function items to other types (rust-lang-nursery/reference#878)
- Apply joshtriplett's suggestion
- Add note clarifying 16-bit support.
- Document min pointer width.
- Update to `dyn Trait` syntax in a couple places (rust-lang-nursery/reference#875)
- mention that `#[track_caller]` on `fn main` is forbidden (rust-lang-nursery/reference#872)

## book

2 commits in 363293c1c5ce9e84ea3935a5e29ce8624801208a..c0a6a61b8205da14ac955425f74258ffd8ee065d
2020-08-03 15:56:30 -0500 to 2020-08-14 14:21:49 -0500
- Correct listing 11-10: Take tests module out of main function. (rust-lang/book#2427)
- Update link to russian translation (rust-lang/book#2423)

## rust-by-example

5 commits in 2e9271981adc32613365810f3428334c07095215..80a10e22140e28392b99d24ed02f4c6d8cb770a0
2020-07-27 13:39:16 -0500 to 2020-08-08 09:56:46 -0300
- Add tuple `..` operator example (rust-lang/rust-by-example#1368)
- Clarify wording (rust-lang/rust-by-example#1366)
- Include arc (rust-lang/rust-by-example#1365)
- Modify supertraits sample code (rust-lang/rust-by-example#1361)
- Remove mention of `try!` in `Display` example (rust-lang/rust-by-example#1357)

## embedded-book

3 commits in b5256448a2a4c1bec68b93c0847066f92f2ff5a9..0cd2ca116274b915924c3a7e07c1e046b6f19b77
2020-07-24 23:09:29 +0000 to 2020-08-19 10:33:15 +0000
- Ignore unused argument in closure  (rust-embedded/book#261)
- Fix broken sentence  (rust-embedded/book#260)
- Add additional command to try when verifying installation.  (rust-embedded/book#259)

3 years agoAuto merge of #75723 - ehuss:update-cargo, r=ehuss
bors [Thu, 20 Aug 2020 01:08:08 +0000 (01:08 +0000)]
Auto merge of #75723 - ehuss:update-cargo, r=ehuss

Update cargo

5 commits in ab32ee88dade1b50c77347599e82ca2de3fb8a51..51b66125ba97d2906f461b3f4e0408f206299bb6
2020-08-10 17:44:43 +0000 to 2020-08-19 20:22:52 +0000
- Add chapters on dependency resolution and SemVer compatibility. (rust-lang/cargo#8609)
- Renames SourceId::into_url -> SourceId::as_url (rust-lang/cargo#8611)
- Fix bug with PathAndArg config values (rust-lang/cargo#8629)
- Show full error context on `cargo run` error. (rust-lang/cargo#8627)
- Fix typo in SIGQUIT description (rust-lang/cargo#8615)

3 years agoAuto merge of #75563 - richkadel:llvm-coverage-map-gen-5.4, r=wesleywiser
bors [Wed, 19 Aug 2020 22:48:40 +0000 (22:48 +0000)]
Auto merge of #75563 - richkadel:llvm-coverage-map-gen-5.4, r=wesleywiser

Moved coverage counter injection from BasicBlock to Statement.

As discussed on Zulip: https://rust-lang.zulipchat.com/#narrow/stream/233931-t-compiler.2Fmajor-changes/topic/Implement.20LLVM-compatible.20source-based.20cod.20compiler-team.23278

3 years agoUpdate cargo
Eric Huss [Wed, 19 Aug 2020 22:11:58 +0000 (15:11 -0700)]
Update cargo

3 years agoUpdate books
Eric Huss [Wed, 19 Aug 2020 21:07:46 +0000 (14:07 -0700)]
Update books

3 years agoAuto merge of #75590 - Mark-Simulacrum:tagged-ptr, r=ecstatic-morse
bors [Wed, 19 Aug 2020 20:20:31 +0000 (20:20 +0000)]
Auto merge of #75590 - Mark-Simulacrum:tagged-ptr, r=ecstatic-morse

Add a packed/tagged pointer abstraction and utilize it for ParamEnv

The intent here is mostly just to add the abstraction; I suspect that there are definitely more use cases for it, and we can explore those over time now that there's a (mostly) safe abstraction that can be used in rustc.

3 years agoUse CopyTaggedPtr for ParamEnv
Mark Rousskov [Sun, 16 Aug 2020 15:08:55 +0000 (11:08 -0400)]
Use CopyTaggedPtr for ParamEnv

3 years agoAdd tagged pointer impl to data structures
Mark Rousskov [Sat, 15 Aug 2020 23:12:27 +0000 (19:12 -0400)]
Add tagged pointer impl to data structures

3 years agoAuto merge of #75715 - tmandry:rollup-18atkj4, r=tmandry
bors [Wed, 19 Aug 2020 18:13:03 +0000 (18:13 +0000)]
Auto merge of #75715 - tmandry:rollup-18atkj4, r=tmandry

Rollup of 7 pull requests

Successful merges:

 - #75069 (move const param structural match checks to wfcheck)
 - #75587 (mir building: fix some comments)
 - #75593 (Adjust installation place for compiler docs)
 - #75648 (Make OnceCell<T> transparent to dropck)
 - #75649 (Fix intra-doc links for inherent impls that are both lang items and not the default impl)
 - #75674 (Move to intra doc links for std::io)
 - #75696 (Remove `#[cfg(miri)]` from OnceCell tests)

Failed merges:

r? @ghost

3 years agoRollup merge of #75696 - matklad:mirit, r=RalfJung
Tyler Mandry [Wed, 19 Aug 2020 18:12:25 +0000 (11:12 -0700)]
Rollup merge of #75696 - matklad:mirit, r=RalfJung

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.

3 years agoRollup merge of #75674 - poliorcetics:intra-links-std-io, r=jyn514
Tyler Mandry [Wed, 19 Aug 2020 18:12:23 +0000 (11:12 -0700)]
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.

3 years agoRollup merge of #75649 - jyn514:inherent-lang-impls, r=guillaumegomez
Tyler Mandry [Wed, 19 Aug 2020 18:12:22 +0000 (11:12 -0700)]
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

3 years agoRollup merge of #75648 - matklad:lazy-dropck, r=KodrAus
Tyler Mandry [Wed, 19 Aug 2020 18:12:20 +0000 (11:12 -0700)]
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

3 years agoRollup merge of #75593 - Mark-Simulacrum:compiler-docs-must-not-overlap, r=pietroalbini
Tyler Mandry [Wed, 19 Aug 2020 18:12:18 +0000 (11:12 -0700)]
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

3 years agoRollup merge of #75587 - RalfJung:mir-comment-fixes, r=ecstatic-morse
Tyler Mandry [Wed, 19 Aug 2020 18:12:16 +0000 (11:12 -0700)]
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.^^

3 years agoRollup merge of #75069 - lcnr:type-of-lazy-norm, r=varkor
Tyler Mandry [Wed, 19 Aug 2020 18:12:15 +0000 (11:12 -0700)]
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

3 years agoAuto merge of #75480 - ssomers:btree_check_invariant, r=Mark-Simulacrum
bors [Wed, 19 Aug 2020 15:27:40 +0000 (15:27 +0000)]
Auto merge of #75480 - ssomers:btree_check_invariant, r=Mark-Simulacrum

BTreeMap: check some invariants in unit tests

3 years agoAdd test for f32 and f64 methods
Joshua Nelson [Wed, 19 Aug 2020 14:35:56 +0000 (10:35 -0400)]
Add test for f32 and f64 methods

3 years agoFix nits in intra-doc links for std io
Alexis Bourget [Wed, 19 Aug 2020 14:26:17 +0000 (16:26 +0200)]
Fix nits in intra-doc links for std io

3 years agoAuto merge of #74098 - GuillaumeGomez:doc-alias-checks, r=ollie27
bors [Wed, 19 Aug 2020 13:10:16 +0000 (13:10 +0000)]
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

3 years agoAdd a test
Joshua Nelson [Mon, 17 Aug 2020 23:42:39 +0000 (19:42 -0400)]
Add a test

3 years agoxpy fmt
Joshua Nelson [Mon, 17 Aug 2020 23:36:29 +0000 (19:36 -0400)]
xpy fmt

3 years agoUse `impls` for intra doc links as well
Joshua Nelson [Mon, 17 Aug 2020 22:54:29 +0000 (18:54 -0400)]
Use `impls` for intra doc links as well

3 years agoAllow reusing the code in `collect_trait_impls`
Joshua Nelson [Mon, 17 Aug 2020 22:45:18 +0000 (18:45 -0400)]
Allow reusing the code in `collect_trait_impls`

3 years agoimpl_for_type -> PrimitiveType::impls
Joshua Nelson [Mon, 17 Aug 2020 22:26:10 +0000 (18:26 -0400)]
impl_for_type -> PrimitiveType::impls

3 years agoReturn all impls, not just the primary one
Joshua Nelson [Mon, 17 Aug 2020 22:21:31 +0000 (18:21 -0400)]
Return all impls, not just the primary one

3 years agoSay `tcx.lang_items()` less
Joshua Nelson [Mon, 17 Aug 2020 22:06:46 +0000 (18:06 -0400)]
Say `tcx.lang_items()` less

3 years agoRefactor `impl_for_type` into a separate function
Joshua Nelson [Mon, 17 Aug 2020 22:03:38 +0000 (18:03 -0400)]
Refactor `impl_for_type` into a separate function

3 years agoAuto merge of #75600 - nagisa:improve_align_offset, r=KodrAus
bors [Wed, 19 Aug 2020 10:54:44 +0000 (10:54 +0000)]
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.

3 years agoRemove `#[cfg(miri)]` from OnceCell tests
Aleksey Kladov [Wed, 19 Aug 2020 08:28:22 +0000 (10:28 +0200)]
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.

3 years agoAuto merge of #75692 - JohnTitor:rollup-8gr04ah, r=JohnTitor
bors [Wed, 19 Aug 2020 06:59:13 +0000 (06:59 +0000)]
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

3 years agoRollup merge of #75685 - nixphix:docs/unix-ext, r=jyn514
Yuki Okushi [Wed, 19 Aug 2020 06:54:39 +0000 (15:54 +0900)]
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
```

3 years agoRollup merge of #75665 - GuillaumeGomez:doc-examples-coverage, r=jyn514
Yuki Okushi [Wed, 19 Aug 2020 06:54:37 +0000 (15:54 +0900)]
Rollup merge of #75665 - GuillaumeGomez:doc-examples-coverage, r=jyn514

Add doc examples coverage

r? @jyn514

3 years agoRollup merge of #75658 - tgnottingham:issue-75599, r=estebank
Yuki Okushi [Wed, 19 Aug 2020 06:54:35 +0000 (15:54 +0900)]
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 :)

3 years agoRollup merge of #75652 - jyn514:true-false-2, r=GuillaumeGomez
Yuki Okushi [Wed, 19 Aug 2020 06:54:34 +0000 (15:54 +0900)]
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

3 years agoRollup merge of #75646 - poliorcetics:intra-links-keywords, r=jyn514
Yuki Okushi [Wed, 19 Aug 2020 06:54:32 +0000 (15:54 +0900)]
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

3 years agoRollup merge of #75554 - jumbatm:fix-clashing-extern-decl-overflow, r=lcnr
Yuki Okushi [Wed, 19 Aug 2020 06:54:30 +0000 (15:54 +0900)]
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.

3 years agoRollup merge of #75499 - jack-champagne:jack-champagne/issue-75412, r=Dylan-DPC
Yuki Okushi [Wed, 19 Aug 2020 06:54:28 +0000 (15:54 +0900)]
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.

3 years agoRollup merge of #75049 - janriemer:patch-1, r=poliorcetics
Yuki Okushi [Wed, 19 Aug 2020 06:54:26 +0000 (15:54 +0900)]
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".

3 years agoRollup merge of #75038 - rust-lang:Havvy-patch-1, r=steveklabnik
Yuki Okushi [Wed, 19 Aug 2020 06:54:24 +0000 (15:54 +0900)]
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.

3 years agoMoved coverage counter injection from BasicBlock to Statement.
Rich Kadel [Sat, 15 Aug 2020 11:42:13 +0000 (04:42 -0700)]
Moved coverage counter injection from BasicBlock to Statement.

3 years agoAuto merge of #75677 - cuviper:shrink-towel, r=Mark-Simulacrum
bors [Wed, 19 Aug 2020 02:56:59 +0000 (02:56 +0000)]
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.

3 years agoAuto merge of #75555 - workingjubilee:update-everything, r=Mark-Simulacrum
bors [Wed, 19 Aug 2020 01:02:19 +0000 (01:02 +0000)]
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).

3 years agoresolve comments
Prabakaran Kumaresshan [Wed, 19 Aug 2020 00:49:35 +0000 (06:19 +0530)]
resolve comments

3 years agoSwitch to intra-doc links in /src/sys/unix/ext/*.rs
Prabakaran Kumaresshan [Tue, 18 Aug 2020 16:41:20 +0000 (22:11 +0530)]
Switch to intra-doc links in /src/sys/unix/ext/*.rs

3 years agoAuto merge of #75516 - matklad:remove-deprecation, r=petrochenkov
bors [Tue, 18 Aug 2020 20:51:22 +0000 (20:51 +0000)]
Auto merge of #75516 - matklad:remove-deprecation, r=petrochenkov

Promote missing_fragment_specifier to hard error

It has been deny_by_default since 2017 (and warned for some time
before that), so it seems reasonable to promote it.

The specific technical motivation to do this now is to remove a field
from `ParseSess` -- it is a global state, and global state makes
extracting libraries annoying.

Closes #40107

3 years agochange const param ty warning message
Bastian Kauschke [Tue, 18 Aug 2020 20:44:06 +0000 (22:44 +0200)]
change const param ty warning message

3 years agorun wfcheck in parralel again, add test for 74950
Bastian Kauschke [Thu, 13 Aug 2020 20:26:55 +0000 (22:26 +0200)]
run wfcheck in parralel again, add test for 74950

3 years agomove const param structural match checks to wfcheck
Bastian Kauschke [Sun, 2 Aug 2020 19:28:18 +0000 (21:28 +0200)]
move const param structural match checks to wfcheck

3 years agoFix asm compiler flags change from cmake 0.1.44
Tomasz Miąsko [Tue, 18 Aug 2020 19:55:54 +0000 (12:55 -0700)]
Fix asm compiler flags change from cmake 0.1.44

cmake-rs@8141f0e changed the logic for handling asm compiler flags.
This change was pulled in with the cmake 0.1.42 -> 0.1.44 update.

This introduced two new flags to the LLVM build, breaking it:
"-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64"
"-DCMAKE_ASM_COMPILER=/usr/bin/cc"

This patch should resolve the breakage by handling it in bootstrap.

3 years agoDon't emit "is not a logical operator" error outside of associative expressions
Tyson Nottingham [Tue, 18 Aug 2020 02:15:51 +0000 (19:15 -0700)]
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

3 years agoDon't panic in Vec::shrink_to_fit
Josh Stone [Tue, 18 Aug 2020 18:45:40 +0000 (11:45 -0700)]
Don't panic in Vec::shrink_to_fit

3 years agoAuto merge of #75657 - TimDiekmann:allocref-cleanup, r=Amanieu
bors [Tue, 18 Aug 2020 18:43:50 +0000 (18:43 +0000)]
Auto merge of #75657 - TimDiekmann:allocref-cleanup, r=Amanieu

Clean up AllocRef implementation and documentation

r? @Amanieu

3 years agoMove to intra doc links for std::io
Alexis Bourget [Tue, 18 Aug 2020 17:36:52 +0000 (19:36 +0200)]
Move to intra doc links for std::io

3 years agodocs: add another `derive` for `Copy`able struct
Jan Riemer [Tue, 18 Aug 2020 16:40:19 +0000 (18:40 +0200)]
docs: add another `derive` for `Copy`able struct

This adds another `derive` for a `Copy`able struct, so that we are
consistent with `derive` annotations.

3 years agoAuto merge of #75635 - Aaron1011:fix/incr-fn-param-names, r=eddyb
bors [Tue, 18 Aug 2020 16:18:07 +0000 (16:18 +0000)]
Auto merge of #75635 - Aaron1011:fix/incr-fn-param-names, r=eddyb

Don't use `dep_graph.with_ignore` when encoding fn param names

The call to `with_ignore` was added years ago, and should no longer be
necessary with the modern incremental query infrastructure.

I also removed a related FIXME comment for issue #38501, which was
closed months ago.

3 years agoDowngrade version_check 0.9.2 -> 0.9.1
Jubilee Young [Tue, 18 Aug 2020 00:09:36 +0000 (17:09 -0700)]
Downgrade version_check 0.9.2 -> 0.9.1

0.9.2 is a breaking change to the #[cfg(version)] test in
src/test/ui/feature-gates/feature-gate-config-version.*
Let's downgrade for now.

3 years agoResolve licensing by updating tinyvec 0.3.3 -> 0.3.4
Jubilee Young [Mon, 17 Aug 2020 23:07:09 +0000 (16:07 -0700)]
Resolve licensing by updating tinyvec 0.3.3 -> 0.3.4

Per https://github.com/rust-lang/rust/pull/75555#issuecomment-675090858
Zlib license might be OK. "OR Apache-2.0 OR MIT" definitely is.
unicode-normalization depends on this and rustc_parse, clippy,
and many other things depend on unicode-normalization.

3 years agoUpdate license check post-cargo update
Mark Rousskov [Mon, 17 Aug 2020 19:13:04 +0000 (15:13 -0400)]
Update license check post-cargo update

3 years agoUpdate dependencies
Mark Rousskov [Mon, 17 Aug 2020 15:21:44 +0000 (11:21 -0400)]
Update dependencies

This runs cargo update, applying the following changes:
      Adding arrayref v0.3.6
      Adding base64 v0.11.0
      Adding blake2b_simd v0.5.10
      Adding cloudabi v0.1.0
      Adding crossbeam-queue v0.2.3
      Adding instant v0.1.6
      Adding lock_api v0.4.1
      Adding maybe-uninit v2.0.0
      Adding parking_lot_core v0.7.2
      Adding parking_lot_core v0.8.0
      Adding parking_lot v0.11.0
      Adding proc-macro-error-attr v1.0.4
      Adding quick-error v2.0.0
      Adding rust-argon2 v0.7.0
      Adding signal-hook-registry v1.2.1
      Adding smallvec v0.6.13
      Adding smallvec v1.4.2
      Adding tinyvec v0.3.3
    Removing argon2rs v0.2.5
    Removing arrayvec v0.4.7
    Removing blake2-rfc v0.2.18
    Removing fuchsia-cprng v0.1.1
    Removing nodrop v0.1.12
    Removing parking_lot_core v0.7.1
    Removing rand_core v0.3.0
    Removing rand_core v0.4.0
    Removing rand_os v0.1.3
    Removing rdrand v0.4.0
    Removing scoped_threadpool v0.1.9
    Removing signal-hook v0.1.7
    Removing smallvec v0.6.10
    Removing smallvec v1.4.0
    Updating aho-corasick v0.7.10 -> v0.7.13
    Updating anyhow v1.0.31 -> v1.0.32
    Updating arc-swap v0.3.7 -> v0.4.7
    Updating bitmaps v2.0.0 -> v2.1.0
    Updating bstr v0.1.3 -> v0.2.13
    Updating byteorder v1.3.2 -> v1.3.4
    Updating bytesize v1.0.0 -> v1.0.1
    Updating bytes v0.4.11 -> v0.4.12
    Updating cargo_metadata v0.8.0 -> v0.8.2
    Updating chrono v0.4.6 -> v0.4.15
    Updating clap v2.33.0 -> v2.33.3
    Updating cmake v0.1.42 -> v0.1.44
    Updating constant_time_eq v0.1.3 -> v0.1.5
    Updating crossbeam-channel v0.4.0 -> v0.4.3
    Updating crossbeam-deque v0.7.1 -> v0.7.3
    Updating crossbeam-epoch v0.7.2 -> v0.8.2
    Updating crossbeam-utils v0.6.5 -> v0.6.6
    Updating crypto-hash v0.3.1 -> v0.3.4
    Updating ctor v0.1.13 -> v0.1.15
    Updating curl-sys v0.4.25 -> v0.4.34+curl-7.71.1
    Updating curl v0.4.25 -> v0.4.31
    Updating derive_more v0.99.2 -> v0.99.9
    Updating diff v0.1.11 -> v0.1.12
    Updating directories v2.0.1 -> v2.0.2
    Updating dirs-sys v0.3.3 -> v0.3.5
    Updating dirs v2.0.1 -> v2.0.2
    Updating either v1.5.0 -> v1.6.0
    Updating failure v0.1.5 -> v0.1.8
    Updating filetime v0.2.9 -> v0.2.12
    Updating fnv v1.0.6 -> v1.0.7
    Updating fortanix-sgx-abi v0.3.2 -> v0.3.3
    Updating fst v0.3.0 -> v0.3.5
    Updating futures v0.1.28 -> v0.1.29
    Updating git2 v0.13.5 -> v0.13.8
    Updating globset v0.4.3 -> v0.4.5
    Updating handlebars v3.0.1 -> v3.4.0
    Updating heck v0.3.0 -> v0.3.1
    Updating hex v0.4.0 -> v0.4.2
    Updating home v0.5.1 -> v0.5.3
    Updating humantime v2.0.0 -> v2.0.1
    Updating ignore v0.4.11 -> v0.4.16
    Updating itertools v0.8.0 -> v0.8.2
    Updating itoa v0.4.4 -> v0.4.6
    Updating jemalloc-sys v0.3.0 -> v0.3.2
    Updating jsonrpc-client-transports v14.0.5 -> v14.2.1
    Updating jsonrpc-core-client v14.0.5 -> v14.2.0
    Updating jsonrpc-core v14.0.5 -> v14.2.0
    Updating jsonrpc-derive v14.0.5 -> v14.2.1
    Updating jsonrpc-pubsub v14.0.6 -> v14.2.0
    Updating jsonrpc-server-utils v14.0.5 -> v14.2.0
    Updating json v0.11.13 -> v0.11.15
    Updating lazycell v1.2.1 -> v1.3.0
    Updating libgit2-sys v0.12.7+1.0.0 -> v0.12.9+1.0.1
    Updating libnghttp2-sys v0.1.2 -> v0.1.4+1.41.0
    Updating libssh2-sys v0.2.14 -> v0.2.18
    Updating libz-sys v1.0.25 -> v1.0.27
    Updating linked-hash-map v0.5.2 -> v0.5.3
    Updating log v0.4.8 -> v0.4.11
    Updating lzma-sys v0.1.14 -> v0.1.16
    Updating macro-utils v0.1.2 -> v0.1.3
    Updating maplit v1.0.1 -> v1.0.2
    Updating mdbook v0.4.0 -> v0.4.2
    Updating memoffset v0.5.1 -> v0.5.5
    Updating mio-named-pipes v0.1.6 -> v0.1.7
    Updating mio-uds v0.6.7 -> v0.6.8
    Updating mio v0.6.16 -> v0.6.22
    Updating miow v0.3.3 -> v0.3.5
    Updating net2 v0.2.33 -> v0.2.34
    Updating new_debug_unreachable v1.0.3 -> v1.0.4
    Updating num_cpus v1.10.1 -> v1.13.0
    Updating num-integer v0.1.39 -> v0.1.43
    Updating num-traits v0.2.6 -> v0.2.12
    Updating once_cell v1.1.0 -> v1.4.0
    Updating opener v0.4.0 -> v0.4.1
    Updating openssl-src v111.9.0+1.1.1g -> v111.10.2+1.1.1g
    Updating openssl-sys v0.9.54 -> v0.9.58
    Updating openssl v0.10.25 -> v0.10.30
    Updating open v1.2.1 -> v1.4.0
    Updating packed_simd v0.3.1 -> v0.3.3
    Updating pest v2.1.0 -> v2.1.3
    Updating pkg-config v0.3.17 -> v0.3.18
    Updating proc-macro2 v1.0.3 -> v1.0.19
    Updating proc-macro-crate v0.1.4 -> v0.1.5
    Updating proc-macro-error v0.2.6 -> v1.0.4
    Updating psm v0.1.10 -> v0.1.11
    Updating pulldown-cmark v0.7.1 -> v0.7.2
    Updating punycode v0.4.0 -> v0.4.1
    Updating quote v1.0.2 -> v1.0.7
    Updating rayon-core v1.6.0 -> v1.7.1
    Updating rayon v1.2.0 -> v1.3.1
    Updating redox_syscall v0.1.56 -> v0.1.57
    Updating redox_users v0.3.0 -> v0.3.4
    Updating regex-syntax v0.6.17 -> v0.6.18
    Updating regex v1.3.7 -> v1.3.9
    Updating remove_dir_all v0.5.2 -> v0.5.3
    Updating rustfix v0.5.0 -> v0.5.1
    Updating ryu v1.0.0 -> v1.0.5
    Updating same-file v1.0.4 -> v1.0.6
    Updating schannel v0.1.16 -> v0.1.19
    Updating scopeguard v1.0.0 -> v1.1.0
    Updating serde_derive v1.0.106 -> v1.0.115
    Updating serde_ignored v0.1.0 -> v0.1.2
    Updating serde_json v1.0.40 -> v1.0.57
    Updating serde_repr v0.1.5 -> v0.1.6
    Updating serde v1.0.99 -> v1.0.115
    Updating shell-escape v0.1.4 -> v0.1.5
    Updating stable_deref_trait v1.1.0 -> v1.2.0
    Updating stacker v0.1.9 -> v0.1.11
    Updating structopt-derive v0.3.1 -> v0.4.9
    Updating structopt v0.3.1 -> v0.3.16
    Updating synstructure v0.12.1 -> v0.12.4
    Updating syn v1.0.11 -> v1.0.38
    Updating tar v0.4.26 -> v0.4.29
    Updating tendril v0.4.0 -> v0.4.1
    Updating term v0.6.0 -> v0.6.1
    Updating thiserror-impl v1.0.5 -> v1.0.20
    Updating thiserror v1.0.5 -> v1.0.20
    Updating time v0.1.42 -> v0.1.43
    Updating tokio-codec v0.1.1 -> v0.1.2
    Updating tokio-current-thread v0.1.6 -> v0.1.7
    Updating tokio-executor v0.1.9 -> v0.1.10
    Updating tokio-fs v0.1.6 -> v0.1.7
    Updating tokio-io v0.1.12 -> v0.1.13
    Updating tokio-process v0.2.4 -> v0.2.5
    Updating tokio-reactor v0.1.11 -> v0.1.12
    Updating tokio-signal v0.2.7 -> v0.2.9
    Updating tokio-sync v0.1.7 -> v0.1.8
    Updating tokio-tcp v0.1.3 -> v0.1.4
    Updating tokio-threadpool v0.1.17 -> v0.1.18
    Updating tokio-timer v0.2.12 -> v0.2.13
    Updating tokio-udp v0.1.5 -> v0.1.6
    Updating tokio-uds v0.2.5 -> v0.2.7
    Updating toml v0.5.3 -> v0.5.6
    Updating tracing-attributes v0.1.9 -> v0.1.10
    Updating tracing-core v0.1.12 -> v0.1.14
    Updating tracing-subscriber v0.2.10 -> v0.2.11
    Updating tracing v0.1.18 -> v0.1.19
    Updating ucd-parse v0.1.4 -> v0.1.8
    Updating ucd-trie v0.1.1 -> v0.1.3
    Updating unicode-normalization v0.1.12 -> v0.1.13
    Updating unicode-script v0.5.1 -> v0.5.2
    Updating unicode-width v0.1.6 -> v0.1.8
    Updating unicode-xid v0.2.0 -> v0.2.1
    Updating url v2.1.0 -> v2.1.1
    Updating utf-8 v0.7.2 -> v0.7.5
    Updating vcpkg v0.2.8 -> v0.2.10
    Updating vec_map v0.8.1 -> v0.8.2
    Updating version_check v0.9.1 -> v0.9.2
    Updating walkdir v2.2.7 -> v2.3.1
    Updating winapi v0.3.8 -> v0.3.9
    Updating xz2 v0.1.5 -> v0.1.6
    Updating yaml-merge-keys v0.4.0 -> v0.4.1
    Updating yaml-rust v0.4.3 -> v0.4.4

3 years agoAuto merge of #75639 - RalfJung:miri, r=RalfJung
bors [Tue, 18 Aug 2020 14:23:22 +0000 (14:23 +0000)]
Auto merge of #75639 - RalfJung:miri, r=RalfJung

update miri

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

3 years agoMake `grow_impl` unsafe
Tim Diekmann [Tue, 18 Aug 2020 13:22:10 +0000 (15:22 +0200)]
Make `grow_impl` unsafe

3 years agoUpdate rustdoc-ui tests
Guillaume Gomez [Tue, 18 Aug 2020 11:31:40 +0000 (13:31 +0200)]
Update rustdoc-ui tests

3 years agoAuto merge of #75663 - Xanewok:update-rls, r=Mark-Simulacrum
bors [Tue, 18 Aug 2020 12:29:50 +0000 (12:29 +0000)]
Auto merge of #75663 - Xanewok:update-rls, r=Mark-Simulacrum

Use git for Rustfmt dependency of RLS

Closes #75442

r? @Mark-Simulacrum

cc @calebcartwright for changed rustfmt dep kind

3 years agoAdd doc examples count for --show-coverage
Guillaume Gomez [Tue, 18 Aug 2020 11:31:23 +0000 (13:31 +0200)]
Add doc examples count for --show-coverage

3 years agoRemove broken clap versions from cargotest
Aleksey Kladov [Sat, 15 Aug 2020 12:12:51 +0000 (14:12 +0200)]
Remove broken clap versions from cargotest

treeify depends on an outdated version of clap, which will fail to compile
when we promote missing_fragment_specifier future compat lint to
error (ie, old clap contains code that shouldn't have compiled in the
first place).

Additionally, this crate seem tiny relative to other crates we are
testing here, so it seems like it doesn't provide that much additional
confidence.

The same happens with tokei project, but it is an actively maintained
one, so we can just upgrade it to a version from 2018, where clap was
upgraded.

3 years agomir building: fix some comments
Ralf Jung [Sun, 16 Aug 2020 08:44:53 +0000 (10:44 +0200)]
mir building: fix some comments

3 years agoBump RLS
Igor Matuszewski [Tue, 18 Aug 2020 10:45:20 +0000 (12:45 +0200)]
Bump RLS

3 years agoBTreeMap: check some invariants, avoid recursion in depth first search
Stein Somers [Tue, 18 Aug 2020 10:01:43 +0000 (12:01 +0200)]
BTreeMap: check some invariants, avoid recursion in depth first search

3 years agoAuto merge of #75631 - matklad:rust-analyzer-2020-08-17, r=matklad
bors [Tue, 18 Aug 2020 10:23:28 +0000 (10:23 +0000)]
Auto merge of #75631 - matklad:rust-analyzer-2020-08-17, r=matklad

:arrow_up: rust-analyzer

r? @ghost

3 years agoupdate miri
Ralf Jung [Tue, 18 Aug 2020 09:04:01 +0000 (11:04 +0200)]
update miri

3 years agoAdd comment, which was removed by accident (again)
Tim Diekmann [Tue, 18 Aug 2020 08:00:31 +0000 (10:00 +0200)]
Add comment, which was removed by accident (again)

3 years agoClean up AllocRef implementation and documentation
Tim Diekmann [Tue, 18 Aug 2020 05:41:06 +0000 (07:41 +0200)]
Clean up AllocRef implementation and documentation

3 years agoAuto merge of #75566 - alasher:master, r=oli-obk
bors [Tue, 18 Aug 2020 07:39:48 +0000 (07:39 +0000)]
Auto merge of #75566 - alasher:master, r=oli-obk

Suppress verbose MIR comments for trivial types

Addresses #74508

This is my first contribution to the Rust project! Please let me know if anything needs revising, I'm happy to make changes.

3 years agoRemove missing_fragment_specifier lint
Aleksey Kladov [Fri, 14 Aug 2020 09:29:22 +0000 (11:29 +0200)]
Remove missing_fragment_specifier lint

3 years agoPromote missing_fragment_specifier to hard error
Aleksey Kladov [Fri, 14 Aug 2020 09:24:01 +0000 (11:24 +0200)]
Promote missing_fragment_specifier to hard error

It has been deny_by_default since 2017 (and warned for some time
before that), so it seems reasonable to promote it.

The specific technical motivation to do this now is to remove a field
from `ParseSess` -- it is a global state, and global state makes
extracting libraries annoying.

Closes #40107

3 years agoMove macro test to ui/macros
Aleksey Kladov [Fri, 14 Aug 2020 08:46:39 +0000 (10:46 +0200)]
Move macro test to ui/macros

3 years agoAuto merge of #75621 - TimDiekmann:no-fast-realloc, r=Amanieu
bors [Tue, 18 Aug 2020 05:42:05 +0000 (05:42 +0000)]
Auto merge of #75621 - TimDiekmann:no-fast-realloc, r=Amanieu

Remove fast path in reallocation for same layout sizes

r? @Amanieu

Before merging a perf-run should be done.

Closes https://github.com/rust-lang/wg-allocators/issues/70

3 years agoAuto merge of #75654 - tmandry:rollup-ej0oezi, r=tmandry
bors [Tue, 18 Aug 2020 03:21:22 +0000 (03:21 +0000)]
Auto merge of #75654 - tmandry:rollup-ej0oezi, r=tmandry

Rollup of 3 pull requests

Successful merges:

 - #75548 (librustc_metadata::locator: Properly detect file type.)
 - #75603 (Use more compatible out-implib style)
 - #75637 (update stacker to 0.1.11 to unbreak build for wasm32-unknown-unknown)

Failed merges:

r? @ghost

3 years agoRollup merge of #75637 - ctaggart:wasm32build, r=Mark-Simulacrum
Tyler Mandry [Tue, 18 Aug 2020 03:20:29 +0000 (20:20 -0700)]
Rollup merge of #75637 - ctaggart:wasm32build, r=Mark-Simulacrum

update stacker to 0.1.11 to unbreak build for wasm32-unknown-unknown

Like #72079, this updates stacker. The related problem is stacker is here https://github.com/rust-lang/stacker/issues/42. It was fixed by switching from `libc::c_void` to `std::ffi::c_void` https://github.com/rust-lang/stacker/pull/43/files.

3 years agoRollup merge of #75603 - mati865:mingw-out-implib-compat, r=oli-obk
Tyler Mandry [Tue, 18 Aug 2020 03:20:27 +0000 (20:20 -0700)]
Rollup merge of #75603 - mati865:mingw-out-implib-compat, r=oli-obk

Use more compatible out-implib style

When calling `rust-lld` directly it accepts only `--out-implib {}` or `--out-implib={}` not `--out-implib,{}`.

3 years agoRollup merge of #75548 - dancrossnyc:master, r=tmandry
Tyler Mandry [Tue, 18 Aug 2020 03:20:25 +0000 (20:20 -0700)]
Rollup merge of #75548 - dancrossnyc:master, r=tmandry

librustc_metadata::locator: Properly detect file type.

Make sure to test file types against the non-canonicalized name to
avoid detecting the wrong type.  Some systems save build artifacts
into associate file stores that do not preserve extensions, and
then link to those using conventionally-named symbolic links, that
are the arguments to `rustc` et al.  If we canonicalize before
testing the type, we resolve the symlink, the extension is
lost and we might treat rlibs and rmetas as dylibs.

The fix is to tntroduce a temporary to hold the canonicalized name,
compare against the non-canonical name, and add a comment
explaining what's going on for the would-be mainter who sees a
potential cleanup.

Signed-off-by: Dan Cross <dcross@google.com>
3 years agoAuto merge of #75653 - JohnTitor:rollup-0ejtdfo, r=JohnTitor
bors [Tue, 18 Aug 2020 01:11:43 +0000 (01:11 +0000)]
Auto merge of #75653 - JohnTitor:rollup-0ejtdfo, r=JohnTitor

Rollup of 8 pull requests

Successful merges:

 - #75389 (attempt to improve span_label docs)
 - #75392 (Add `as_uninit`-like methods to pointer types and unify documentation of `as_ref` methods)
 - #75464 (Move to intra doc links for ascii.rs and panic.rs)
 - #75578 (Allowing raw ptr dereference in const fn)
 - #75613 (Add explanation for `&mut self` method call when expecting `-> Self`)
 - #75626 (Clean up E0754 explanation)
 - #75629 (Use intra-doc links in `std::env`, `std::alloc` and `std::error`)
 - #75634 (Mark x86_64-linux-kernel as *)

Failed merges:

r? @ghost

3 years agoRollup merge of #75634 - scileo:fix-75581, r=ehuss
Yuki Okushi [Tue, 18 Aug 2020 00:27:53 +0000 (09:27 +0900)]
Rollup merge of #75634 - scileo:fix-75581, r=ehuss

Mark x86_64-linux-kernel as *

This should fix #75581.

This is my first contribution to the Rust organization. Please, feel free to tell me if I did anything wrong :)

3 years agoRollup merge of #75629 - EllenNyan:ellen-intra-doc-links, r=jyn514
Yuki Okushi [Tue, 18 Aug 2020 00:27:51 +0000 (09:27 +0900)]
Rollup merge of #75629 - EllenNyan:ellen-intra-doc-links, r=jyn514

Use intra-doc links in `std::env`, `std::alloc` and `std::error`

This is partial fixes for #75080.

3 years agoRollup merge of #75626 - GuillaumeGomez:cleanup-e0754, r=pickfire
Yuki Okushi [Tue, 18 Aug 2020 00:27:49 +0000 (09:27 +0900)]
Rollup merge of #75626 - GuillaumeGomez:cleanup-e0754, r=pickfire

Clean up E0754 explanation

r? @Dylan-DPC

cc @pickfire

3 years agoRollup merge of #75613 - estebank:explain-mut-method, r=petrochenkov
Yuki Okushi [Tue, 18 Aug 2020 00:27:47 +0000 (09:27 +0900)]
Rollup merge of #75613 - estebank:explain-mut-method, r=petrochenkov

Add explanation for `&mut self` method call when expecting `-> Self`

When a user tries to use a method as if it returned a new value of the
same type as its receiver, we will emit a type error. Try to detect this
and provide extra explanation that the method modifies the receiver
in-place.

This has confused people in the wild, like in
https://users.rust-lang.org/t/newbie-why-the-commented-line-stops-the-snippet-from-compiling/47322

3 years agoRollup merge of #75578 - 5M1Sec:master, r=oli-obk
Yuki Okushi [Tue, 18 Aug 2020 00:27:45 +0000 (09:27 +0900)]
Rollup merge of #75578 - 5M1Sec:master, r=oli-obk

Allowing raw ptr dereference in const fn

Reflect on issue #75340
Discussion in previous PR  #75425

## Updates
Change `UnsafetyViolationKind::General` to `UnsafetyViolationKind::GeneralAndConstFn` in check_unsafety.rs

Remove `unsafe` in min_const_fn_unsafe_bad.rs

Bless min_const_fn

Add the test case from issue 75340
***
Sorry for the chaos. I messed up and ended up deleting the repo in the last PR. I have to create a new PR for the new repo. I will make a feature branch next time. I will edit the old PR once I receive the commends.

@RalfJung Thank you all for your replies. They are helpful!

r? @oli-obk

3 years agoRollup merge of #75464 - poliorcetics:intra-links-panic-and-ascii, r=jyn514
Yuki Okushi [Tue, 18 Aug 2020 00:27:43 +0000 (09:27 +0900)]
Rollup merge of #75464 - poliorcetics:intra-links-panic-and-ascii, r=jyn514

Move to intra doc links for ascii.rs and panic.rs

Helps with #75080.

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

I also updated the doc to fix the wording in `AsciiExt` since it is now deprecated.
The two file are small changes so I bundled them together.

Some links could not be changed to make them work, I believe those are known issues with primitive types.

3 years agoRollup merge of #75392 - TimDiekmann:non-null-uninit-slice, r=RalfJung
Yuki Okushi [Tue, 18 Aug 2020 00:27:42 +0000 (09:27 +0900)]
Rollup merge of #75392 - TimDiekmann:non-null-uninit-slice, r=RalfJung

Add `as_uninit`-like methods to pointer types and unify documentation of `as_ref` methods

This adds a convenient method to retrieve a `&(mut) [MaybeUninit<T>]` from slice pointers (`*const [T]`, `*mut [T]`, `NonNull<[T]>`). See also https://github.com/rust-lang/wg-allocators/issues/66#issuecomment-671789105.

~I'll add a tracking issue as soon as it's reviewed and CI passed.~
Tracking Issue: #75402

r? @RalfJung

3 years agoRollup merge of #75389 - RalfJung:span_label, r=davidtwco
Yuki Okushi [Tue, 18 Aug 2020 00:27:39 +0000 (09:27 +0900)]
Rollup merge of #75389 - RalfJung:span_label, r=davidtwco

attempt to improve span_label docs

I was still confused by the `span_label` docs, so I did some more digging. However, this needs careful checking as I have no idea if any of this is correct.

3 years agoResolve true and false as booleans
Joshua Nelson [Mon, 17 Aug 2020 23:51:09 +0000 (19:51 -0400)]
Resolve true and false as booleans

3 years agoAuto merge of #75120 - JulianKnodt:rm_reps, r=oli-obk
bors [Mon, 17 Aug 2020 23:16:08 +0000 (23:16 +0000)]
Auto merge of #75120 - JulianKnodt:rm_reps, r=oli-obk

rust_ast::ast => rustc_ast

Rework of #71199 which is a rework #70621

Still working on this but just made the PR to track progress

r? @Dylan-DPC

3 years agoMake OnceCell<T> transparent to dropck
Aleksey Kladov [Mon, 17 Aug 2020 21:54:41 +0000 (23:54 +0200)]
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