]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agobootstrap: fix a couple of clippy lint warnings
Matthias Krüger [Fri, 21 Aug 2020 23:08:04 +0000 (01:08 +0200)]
bootstrap: fix a couple of clippy lint warnings

clippy::print_literal
clippy::clone_on_copy
clippy::single_char_pattern
clippy::into_iter_on_ref
clippy::match_like_matches_macro

3 years agoAuto merge of #75708 - JohnTitor:stay-cool-full-bootstrap-builder, r=pietroalbini
bors [Fri, 21 Aug 2020 17:43:27 +0000 (17:43 +0000)]
Auto merge of #75708 - JohnTitor:stay-cool-full-bootstrap-builder, r=pietroalbini

Remove the full-bootstrap builder from CI

Fixes #75198

3 years agoAuto merge of #75694 - RalfJung:miri-align-to, r=nagisa
bors [Fri, 21 Aug 2020 15:40:48 +0000 (15:40 +0000)]
Auto merge of #75694 - RalfJung:miri-align-to, r=nagisa

enable align_to tests in Miri

With https://github.com/rust-lang/miri/issues/1074 resolved, we can enable these tests in Miri.

I also tweaked the test sized to get reasonable execution times with decent test coverage.

3 years agoAuto merge of #75697 - lzutao:mir-dumb-const-prefix, r=oli-obk
bors [Fri, 21 Aug 2020 11:08:31 +0000 (11:08 +0000)]
Auto merge of #75697 - lzutao:mir-dumb-const-prefix, r=oli-obk

Suppress "const" prefix of FnDef constants in MIR dump

I [was asked][1] to suppress the `const` infront of `FnDef`.
I tried to suppress comments for other types, but turned out that `const ()` and `()` is different: https://github.com/rust-lang/rust/pull/75697#discussion_r473892806

[1]: https://github.com/rust-lang/rust/pull/75670#issuecomment-675574333

3 years agoAuto merge of #75765 - JohnTitor:rollup-lexaoa9, r=JohnTitor
bors [Fri, 21 Aug 2020 09:00:49 +0000 (09:00 +0000)]
Auto merge of #75765 - JohnTitor:rollup-lexaoa9, r=JohnTitor

Rollup of 5 pull requests

Successful merges:

 - #75324 (clarify documentation of remove_dir errors)
 - #75532 (Fix RFC-1014 test)
 - #75664 (Update mailmap for mati865)
 - #75727 (Switch to intra-doc links in `core::result`)
 - #75750 (Move to intra doc links for std::thread documentation)

Failed merges:

r? @ghost

3 years agoRollup merge of #75750 - poliorcetics:intra-links-std-thread, r=jyn514
Yuki Okushi [Fri, 21 Aug 2020 08:55:15 +0000 (17:55 +0900)]
Rollup merge of #75750 - poliorcetics:intra-links-std-thread, r=jyn514

Move to intra doc links for std::thread documentation

Helps with #75080.

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

r? @jyn514

3 years agoRollup merge of #75727 - camelid:intra-doc-links-for-core-result, r=jyn514
Yuki Okushi [Fri, 21 Aug 2020 08:55:14 +0000 (17:55 +0900)]
Rollup merge of #75727 - camelid:intra-doc-links-for-core-result, r=jyn514

Switch to intra-doc links in `core::result`

Part of #75080.

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

3 years agoRollup merge of #75664 - mati865:mailmap, r=Dylan-DPC
Yuki Okushi [Fri, 21 Aug 2020 08:55:12 +0000 (17:55 +0900)]
Rollup merge of #75664 - mati865:mailmap, r=Dylan-DPC

Update mailmap for mati865

3 years agoRollup merge of #75532 - tmiasko:rfc-1014, r=nikomatsakis
Yuki Okushi [Fri, 21 Aug 2020 08:55:10 +0000 (17:55 +0900)]
Rollup merge of #75532 - tmiasko:rfc-1014, r=nikomatsakis

Fix RFC-1014 test

Use two printlns when testing that writing to a closed stdout does not
panic. Otherwise the test is ineffective, since the current implementation
silently ignores the error during first println regardless.

3 years agoRollup merge of #75324 - ericseppanen:master, r=JohnTitor
Yuki Okushi [Fri, 21 Aug 2020 08:55:08 +0000 (17:55 +0900)]
Rollup merge of #75324 - ericseppanen:master, r=JohnTitor

clarify documentation of remove_dir errors

remove_dir will error if the path doesn't exist or isn't a directory.

It's useful to clarify that this is "remove dir or fail" not "remove dir
if it exists".

I don't think this belongs in the title. "Removes an existing, empty
directory" is strangely worded-- there's no such thing as a non-existing
directory.  Better to just say explicitly it will return an error.

3 years agoAuto merge of #75642 - matklad:lexer-comments, r=petrochenkov
bors [Fri, 21 Aug 2020 06:05:39 +0000 (06:05 +0000)]
Auto merge of #75642 - matklad:lexer-comments, r=petrochenkov

Move doc comment parsing to rustc_lexer

Plain comments are trivia, while doc comments are not, so it feels
like this belongs to the rustc_lexer.

The specific reason to do this is the desire to use rustc_lexer in
rustdoc for syntax highlighting, without duplicating "is this a doc
comment?" logic there.

r? @ghost

3 years agoAuto merge of #74846 - Aaron1011:fix/pat-token-capture, r=petrochenkov
bors [Fri, 21 Aug 2020 02:16:35 +0000 (02:16 +0000)]
Auto merge of #74846 - Aaron1011:fix/pat-token-capture, r=petrochenkov

Capture tokens for Pat used in macro_rules! argument

This extends PR #73293 to handle patterns (Pat). Unlike expressions,
patterns do not support custom attributes, so we only need to capture
tokens during macro_rules! argument parsing.

3 years agoSuppress "const" prefix of FnDef in MIR dump
Lzu Tao [Thu, 20 Aug 2020 09:44:20 +0000 (09:44 +0000)]
Suppress "const" prefix of FnDef in MIR dump

3 years agoAuto merge of #73565 - matthewjasper:core-min-spec, r=nagisa
bors [Thu, 20 Aug 2020 23:05:31 +0000 (23:05 +0000)]
Auto merge of #73565 - matthewjasper:core-min-spec, r=nagisa

Use min_specialization in libcore

Getting `TrustedRandomAccess` to work is the main interesting thing here.

- `get_unchecked` is now an unstable, hidden method on `Iterator`
- The contract for `TrustedRandomAccess` is made clearer in documentation
- Fixed a bug where `Debug` would create aliasing references when using the specialized zip impl
- Added tests for the side effects of `next_back` and `nth`.

closes #68536

3 years agoAuto merge of #75494 - matthewjasper:defer-recursive-projection-error, r=nikomatsakis
bors [Thu, 20 Aug 2020 20:27:22 +0000 (20:27 +0000)]
Auto merge of #75494 - matthewjasper:defer-recursive-projection-error, r=nikomatsakis

Don't immediately error for cycles during normalization

#73452 meant some normalization cycles could be detected earlier, breaking some code.
This PR makes defers errors for normalization cycles to fulfillment, fixing said code.

Fixes #74868

r? @nikomatsakis

3 years agoMove to intra doc links for std::thread documentation
Alexis Bourget [Thu, 20 Aug 2020 20:03:00 +0000 (22:03 +0200)]
Move to intra doc links for std::thread documentation

3 years agoFix intra-doc links
Camelid [Thu, 20 Aug 2020 19:39:12 +0000 (12:39 -0700)]
Fix intra-doc links

One of the original links was linking to the wrong thing as well.

Co-authored-by: Joshua Nelson <joshua@yottadb.com>
3 years agoDon't immediately error for cycles during normalization
Matthew Jasper [Thu, 13 Aug 2020 19:45:08 +0000 (20:45 +0100)]
Don't immediately error for cycles during normalization

3 years agoAuto merge of #75747 - cuviper:rollup-icke90l, r=cuviper
bors [Thu, 20 Aug 2020 18:02:46 +0000 (18:02 +0000)]
Auto merge of #75747 - cuviper:rollup-icke90l, r=cuviper

Rollup of 8 pull requests

Successful merges:

 - #75672 (Move to intra-doc links for task.rs and vec.rs)
 - #75702 (Clean up E0759 explanation)
 - #75703 (Enable stack-overflow detection on musl for non-main threads)
 - #75710 (Fix bad printing of const-eval queries)
 - #75716 (Upgrade Emscripten on CI to 1.39.20 )
 - #75731 (Suppress ty::Float in MIR comments of ty::Const)
 - #75733 (Remove duplicated alloc vec bench push_all_move)
 - #75743 (Rename rustc_lexer::TokenKind::Not to Bang)

Failed merges:

r? @ghost

3 years agoRollup merge of #75743 - matklad:excl, r=davidtwco
Josh Stone [Thu, 20 Aug 2020 17:07:34 +0000 (10:07 -0700)]
Rollup merge of #75743 - matklad:excl, r=davidtwco

Rename rustc_lexer::TokenKind::Not to Bang

All other tokens are named by the punctuation they use, rather than
by semantics operation they stand for. `!` is the only exception to
the rule, let's fix it.

3 years agoRollup merge of #75733 - pickfire:patch-3, r=matklad
Josh Stone [Thu, 20 Aug 2020 17:07:32 +0000 (10:07 -0700)]
Rollup merge of #75733 - pickfire:patch-3, r=matklad

Remove duplicated alloc vec bench push_all_move

push_all_move is the same as extend

3 years agoRollup merge of #75731 - lzutao:mir-cmts-suppress-float-ty-const, r=oli-obk
Josh Stone [Thu, 20 Aug 2020 17:07:30 +0000 (10:07 -0700)]
Rollup merge of #75731 - lzutao:mir-cmts-suppress-float-ty-const, r=oli-obk

Suppress ty::Float in MIR comments of ty::Const

Already covered by MIR constant comments

3 years agoRollup merge of #75716 - tlively:upgrade-emscripten-1.39.20, r=cuviper
Josh Stone [Thu, 20 Aug 2020 17:07:28 +0000 (10:07 -0700)]
Rollup merge of #75716 - tlively:upgrade-emscripten-1.39.20, r=cuviper

Upgrade Emscripten on CI to 1.39.20

This Emscripten version was the first to be cut after the LLVM 11
release branch was created, so it should be the most compatible with
LLVM 11. The old version we were using was incompatible with LLVM 11
because its wasm-ld did not understand all the relocations that LLVM
11 emits.

3 years agoRollup merge of #75710 - ThibsG:FixBadPrinting75447, r=oli-obk
Josh Stone [Thu, 20 Aug 2020 17:07:27 +0000 (10:07 -0700)]
Rollup merge of #75710 - ThibsG:FixBadPrinting75447, r=oli-obk

Fix bad printing of const-eval queries

Fixes: #75447
r? @RalfJung

cc @oli-obk

3 years agoRollup merge of #75703 - tmiasko:stack-overflow-musl, r=cuviper
Josh Stone [Thu, 20 Aug 2020 17:07:24 +0000 (10:07 -0700)]
Rollup merge of #75703 - tmiasko:stack-overflow-musl, r=cuviper

Enable stack-overflow detection on musl for non-main threads

3 years agoRollup merge of #75702 - GuillaumeGomez:cleanup-e0759, r=pickfire
Josh Stone [Thu, 20 Aug 2020 17:07:22 +0000 (10:07 -0700)]
Rollup merge of #75702 - GuillaumeGomez:cleanup-e0759, r=pickfire

Clean up E0759 explanation

r? @Dylan-DPC

cc @pickfire

3 years agoRollup merge of #75672 - kofls:intradoc-fix, r=jyn514
Josh Stone [Thu, 20 Aug 2020 17:07:19 +0000 (10:07 -0700)]
Rollup merge of #75672 - kofls:intradoc-fix, r=jyn514

Move to intra-doc links for task.rs and vec.rs

Partial fix for #75080

links for [`get`], [`get_mut`] skipped due to #75643
link for [`copy_from_slice`] skipped due to #63351

3 years agoSuppress ty::Float in MIR comments of ty::Const
Lzu Tao [Thu, 20 Aug 2020 03:43:17 +0000 (03:43 +0000)]
Suppress ty::Float in MIR comments of ty::Const

Already covered by MIR constant comments

3 years agoAuto merge of #75562 - oli-obk:const_prop_no_aggregates, r=wesleywiser
bors [Thu, 20 Aug 2020 15:39:06 +0000 (15:39 +0000)]
Auto merge of #75562 - oli-obk:const_prop_no_aggregates, r=wesleywiser

Check that we don't use `Rvalue::Aggregate` after the deaggregator

fixes #75481

r? @wesleywiser

cc @RalfJung (modified the validator)

3 years agoApply suggestions from code review
Oliver Scherer [Thu, 20 Aug 2020 14:56:19 +0000 (16:56 +0200)]
Apply suggestions from code review

Co-authored-by: Wesley Wiser <wwiser@gmail.com>
3 years agoRename rustc_lexer::TokenKind::Not to Bang
Aleksey Kladov [Thu, 20 Aug 2020 13:51:39 +0000 (13:51 +0000)]
Rename rustc_lexer::TokenKind::Not to Bang

All other tokens are named by the punctuation they use, rather than
by semantics operation they stand for. `!` is the only exception to
the rule, let's fix it.

3 years agoApply review comments
Guillaume Gomez [Thu, 20 Aug 2020 13:25:35 +0000 (15:25 +0200)]
Apply review comments

3 years agoAuto merge of #75670 - lzutao:suppress-mir-fndef-ty, r=oli-obk
bors [Thu, 20 Aug 2020 12:42:13 +0000 (12:42 +0000)]
Auto merge of #75670 - lzutao:suppress-mir-fndef-ty, r=oli-obk

Suppress MIR comments of FnDef and unit types

An expansion of #75566.
Comments of FnDef MIR constant already contain `ty::Contains` comments.

3 years agoLiballoc bench rename push_all extend_from_slice
Ivan Tham [Thu, 20 Aug 2020 11:04:52 +0000 (19:04 +0800)]
Liballoc bench rename push_all extend_from_slice

3 years agoSuppress MIR comments of Unit type
Lzu Tao [Thu, 20 Aug 2020 09:25:06 +0000 (09:25 +0000)]
Suppress MIR comments of Unit type

3 years agoAdd missing tick for doc
Lzu Tao [Thu, 20 Aug 2020 09:15:23 +0000 (09:15 +0000)]
Add missing tick for doc

3 years agoSuppress MIR comments for FnDef in ty::Const
Lzu Tao [Tue, 18 Aug 2020 15:49:51 +0000 (15:49 +0000)]
Suppress MIR comments for FnDef in ty::Const

3 years agoSet RUST_BACKTRACE env variable
ThibsG [Thu, 20 Aug 2020 07:20:57 +0000 (09:20 +0200)]
Set RUST_BACKTRACE env variable

3 years agoRemove duplicated alloc vec bench push_all_move
Ivan Tham [Thu, 20 Aug 2020 07:20:46 +0000 (15:20 +0800)]
Remove duplicated alloc vec bench push_all_move

push_all_move is the same as extend

3 years agoCapture tokens for Pat used in macro_rules! argument
Aaron Hill [Mon, 27 Jul 2020 22:02:29 +0000 (18:02 -0400)]
Capture tokens for Pat used in macro_rules! argument

This extends PR #73293 to handle patterns (Pat). Unlike expressions,
patterns do not support custom attributes, so we only need to capture
tokens during macro_rules! argument parsing.

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 agoRevert to old link since intra-doc link is broken
Camelid [Thu, 20 Aug 2020 01:17:55 +0000 (18:17 -0700)]
Revert to old link since intra-doc link is broken

Can't link from `core` to `std` yet.

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 -&gt; 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 agoSwitch to intra-doc links in `core::result`
Camelid [Wed, 19 Aug 2020 21:00:53 +0000 (14:00 -0700)]
Switch to intra-doc links in `core::result`

3 years agoSimplify search for bare `\r` in doc comments
Aleksey Kladov [Mon, 17 Aug 2020 19:52:49 +0000 (21:52 +0200)]
Simplify search for bare `\r` in doc comments

Outer `if` is the fast path -- it calls into hyperoptimized memchr.

The inner loop is just the simplest code possible -- it doesn't
generated the tightest code, but that shouldn't matter if we are going
to error anyhow.

3 years agoMove doc comment parsing to rustc_lexer
Aleksey Kladov [Mon, 17 Aug 2020 16:43:35 +0000 (18:43 +0200)]
Move doc comment parsing to rustc_lexer

Plain comments are trivial, while doc comments are not, so it feels
like this belongs to the rustc_lexer.

The specific reason to do this is the desire to use rustc_lexer in
rustdoc for syntax highlighting, without duplicating "is this a doc
comment?" logic there.

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 agoUse min_specialization in libcore
Matthew Jasper [Mon, 17 Aug 2020 18:34:44 +0000 (19:34 +0100)]
Use min_specialization in libcore

3 years agoUpgrade Emscripten on CI to 1.39.20
Thomas Lively [Wed, 19 Aug 2020 18:22:24 +0000 (11:22 -0700)]
Upgrade Emscripten on CI to 1.39.20

This Emscripten version was the first to be cut after the LLVM 11
release branch was created, so it should be the most compatible with
LLVM 11. The old version we were using was incompatible with LLVM 11
because its wasm-ld did not understand all the relocations that LLVM
11 emits.

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 agoFix bad printing of const-eval queries
ThibsG [Wed, 19 Aug 2020 10:05:32 +0000 (12:05 +0200)]
Fix bad printing of const-eval queries

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 agoRemove the full-bootstrap builder from CI
Yuki Okushi [Wed, 19 Aug 2020 15:02:52 +0000 (00:02 +0900)]
Remove the full-bootstrap builder from CI

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 agoClean up E0759 explanation
Guillaume Gomez [Wed, 19 Aug 2020 12:22:52 +0000 (14:22 +0200)]
Clean up E0759 explanation

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 agoenable align_to tests in Miri
Ralf Jung [Wed, 19 Aug 2020 07:56:38 +0000 (09:56 +0200)]
enable align_to tests in Miri

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 agoApply suggestions from code review
Surya Midatala [Wed, 19 Aug 2020 04:59:31 +0000 (10:29 +0530)]
Apply suggestions from code review

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 agoEnable stack-overflow detection on musl for non-main threads
Tomasz Miąsko [Wed, 19 Aug 2020 00:00:00 +0000 (00:00 +0000)]
Enable stack-overflow detection on musl for non-main threads

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