I provided a separate commit that replaced links with anchors by intra-doc links.
Here the anchor location information gets lost, so its questionable whether to
actually replace those links.
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
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.
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.
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.
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.
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`.
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.
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)
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.
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.
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.
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.
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.
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)
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
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.
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.
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.
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.
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)
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.
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.
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.
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.
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.
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)
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
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 :)