bors [Sat, 22 Aug 2020 04:39:15 +0000 (04:39 +0000)]
Auto merge of #75772 - tmiasko:io-maybe-no, r=dtolnay
Remove unused `Maybe` wrapper around raw standard streams
* Remove result type from raw standard streams constructors
* Make raw standard stream constructors const
* Remove wrapper type handling absent raw standard streams
Dylan DPC [Sat, 22 Aug 2020 00:14:41 +0000 (02:14 +0200)]
Rollup merge of #75711 - CohenArthur:split-up-astconv, r=oli-obk
Split `astconv.rs` into its own submodule
Fixes #67418
This changed induced a few changes across the Type checker, but only there. Mostly, it was just renaming `Self::` into something else to call specific methods from a subtrait instead of having a 2500+ lines one.
I split up the `astconv.rs` file into its own module. This way, directives such as
```rust
use crate::astconv::AstConv;
```
are still valid, and doing
```rust
use crate::astconv::{AstConv, AstConvGeneric};
```
is possible
(instead of having two modules, one named `astconv_generic.rs` for example and `astconv.rs`)
I'm not entirely sure that the name `AstConvGeneric` is a good one. However, only methods related to lifetimes or generics have been moved over to this module. Sorry about the large diff.
I'd be very happy to make any correction you deem necessary.
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
CohenArthur [Wed, 19 Aug 2020 17:07:03 +0000 (19:07 +0200)]
astconv: Split astconv.rs into its own module with submodules
To separate the astconv.rs file, I split it into its own module with a
subtrait called GenericAstConv. This subtrait handles methods related to
generics, be it types or lifetimes.
typeck: Add bounds module and Bounds struct
bounds: Run fmt, add documentation
generic_astconv: Add subtrait GenericAstConv
Some methods of AstConv deal exclusively with Generics. Therefore, it
makes sense to have them in their own trait. Some other methods from
AstConv might be added to it later
generic_astconv: Add more methods from AstConv
Add check_generic_arg_count_for_call() and check_generic_arg_count()
astconv: Add module for clarity
generic: Rename GenericAstConv -> AstConvGeneric
generic: add more methods to AstConvGeneric
astconv: Remove AstConvGeneric trait, add impl dyn AstConv in other
module
astconv: Add errors module to handle AstConv complaints
fmt: format code in astconv/
astconv: Remove old file
astconv: Fix visibility on GenericArgPosition
astconv: Fix visibility on GenericArgPosition
astconv: Fix function visibility on other originally private functions
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