]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoRollup merge of #74294 - msirringhaus:master, r=pietroalbini
Manish Goregaokar [Wed, 15 Jul 2020 18:01:24 +0000 (11:01 -0700)]
Rollup merge of #74294 - msirringhaus:master, r=pietroalbini

Update cross-compilation README

README seemed rather out of date. I hope the information in my PR is now correct (it was more or less assembled by asking in zulip and learning-by-doing).

4 years agoRollup merge of #74291 - regexident:from-docs, r=GuillaumeGomez
Manish Goregaokar [Wed, 15 Jul 2020 18:01:22 +0000 (11:01 -0700)]
Rollup merge of #74291 - regexident:from-docs, r=GuillaumeGomez

Added docs for `From<c_int>` for `ExitStatus`

Partially addresses https://github.com/rust-lang/rust/issues/51430

4 years agoRollup merge of #74276 - lcnr:discriminant-kind-what, r=nagisa
Manish Goregaokar [Wed, 15 Jul 2020 18:01:20 +0000 (11:01 -0700)]
Rollup merge of #74276 - lcnr:discriminant-kind-what, r=nagisa

improve DiscriminantKind handling

Adds a lang item `discriminant_type` for the associated type `DiscriminantKind::Discriminant`.

Changes the discriminant of generators from `i32` to `u32`, which should not be observable to fix an
oversight where MIR was using `u32` and codegen and typeck used `i32`.

4 years agoRollup merge of #74218 - GuillaumeGomez:search-results-bottom-margin, r=Dylan-DPC
Manish Goregaokar [Wed, 15 Jul 2020 18:01:18 +0000 (11:01 -0700)]
Rollup merge of #74218 - GuillaumeGomez:search-results-bottom-margin, r=Dylan-DPC

Add margin after doc search results

I found it not really on computer that the last result is right at the bottom of the page. I find it better with margin below (especially when you hover the last element!). A screenshot to show the result:

![Screenshot from 2020-07-10 16-32-23](https://user-images.githubusercontent.com/3050060/87166097-6103a580-c2cb-11ea-81a8-12772cf20f64.png)

r? @kinnison
cc @rust-lang/rustdoc @Manishearth @jyn514

4 years agoRollup merge of #74196 - GuillaumeGomez:auto-collapse-implementors, r=Manishearth
Manish Goregaokar [Wed, 15 Jul 2020 18:01:16 +0000 (11:01 -0700)]
Rollup merge of #74196 - GuillaumeGomez:auto-collapse-implementors, r=Manishearth

Add option to collapse automatically implementors

Fixes #73403

It adds an option (enabled by default) which collapses all implementors impl blocks.

r? @kinnison
cc @rust-lang/rustdoc

4 years agoRollup merge of #74119 - nnethercote:rm-Compiler-compile, r=Mark-Simulacrum
Manish Goregaokar [Wed, 15 Jul 2020 18:01:13 +0000 (11:01 -0700)]
Rollup merge of #74119 - nnethercote:rm-Compiler-compile, r=Mark-Simulacrum

Remove `Compiler::compile()`.

It's unused.

r? @Mark-Simulacrum

4 years agoRollup merge of #73959 - GuillaumeGomez:cleanup-e0716, r=Dylan-DPC
Manish Goregaokar [Wed, 15 Jul 2020 18:01:11 +0000 (11:01 -0700)]
Rollup merge of #73959 - GuillaumeGomez:cleanup-e0716, r=Dylan-DPC

Clean up E0716 explanation

r? @Dylan-DPC

4 years agoRollup merge of #73918 - GuillaumeGomez:cleanup-e0715, r=Dylan-DPC
Manish Goregaokar [Wed, 15 Jul 2020 18:01:08 +0000 (11:01 -0700)]
Rollup merge of #73918 - GuillaumeGomez:cleanup-e0715, r=Dylan-DPC

Clean up E0715 explanation

r? @Dylan-DPC

4 years agoRollup merge of #72973 - msizanoen1:riscv-host, r=pietroalbini
Manish Goregaokar [Wed, 15 Jul 2020 18:01:02 +0000 (11:01 -0700)]
Rollup merge of #72973 - msizanoen1:riscv-host, r=pietroalbini

RISC-V GNU/Linux as host platform

This PR add a new builder named `dist-riscv64-linux` that builds the compiler toolchain for RISC-V 64-bit GNU/Linux.

r? @alexcrichton

4 years agoImprove settings wording
Guillaume Gomez [Thu, 9 Jul 2020 20:51:04 +0000 (22:51 +0200)]
Improve settings wording

4 years agoAuto merge of #74113 - lcnr:type-dependent-consts-2, r=eddyb
bors [Wed, 15 Jul 2020 12:49:25 +0000 (12:49 +0000)]
Auto merge of #74113 - lcnr:type-dependent-consts-2, r=eddyb

Support const args in type dependent paths (Take 2)

once more, except it is sound this time :smiling_face_with_three_hearts: previously #71154

-----
```rust
#![feature(const_generics)]

struct A;
impl A {
    fn foo<const N: usize>(&self) -> usize { N }
}
struct B;
impl B {
    fn foo<const N: usize>(&self) -> usize { 42 }
}

fn main() {
    let a = A;
    a.foo::<7>();
}
```
When calling `type_of` for generic const arguments, we now use the `TypeckTables` of the surrounding body to get the expected type.

This alone causes cycle errors though, as we now have `typeck_tables_of(main)` -> `...` ->
`type_of(main_ANON0 := 7)` -> `typeck_tables_of(main)` :zap: (see https://github.com/rust-lang/rust/issues/68400#issuecomment-611760290)

To prevent this we must not call `type_of(const_arg)` during `typeck_tables_of`. This is achieved by
calling `type_of(param_def_id)` instead.

We have to somehow remember the `DefId` of the param through all of typeck, which is done using the
struct `ty::WithOptConstParam<DefId>`, which replaces `DefId` where needed and contains an `Option<DefId>` to
be able to store the const parameter in case it exists.

Queries which are currently cached on disk are split into two variants: `query_name`(cached) and `query_name_(of|for)_const_arg`(not cached), with `query_name_of_const_arg` taking a pair `(did, param_did): (LocalDefId, DefId)`.

For some queries a method `query_name_of_opt_const_arg` is added to `TyCtxt` which takes a `ty::WithOptConstParam` and either calls `query_name` or `query_name_of_const_arg` depending on the value of `const_param_did`.

r? @eddyb @varkor

4 years agounify Instance::resolve
Bastian Kauschke [Wed, 15 Jul 2020 09:45:01 +0000 (11:45 +0200)]
unify Instance::resolve

4 years agounsafety_check_result_for_const_arg
Bastian Kauschke [Wed, 15 Jul 2020 09:26:26 +0000 (11:26 +0200)]
unsafety_check_result_for_const_arg

4 years agoWithOptConstParam::dummy -> WithOptConstParam::unknown
Bastian Kauschke [Wed, 15 Jul 2020 08:55:41 +0000 (10:55 +0200)]
WithOptConstParam::dummy -> WithOptConstParam::unknown

4 years agoty_def_id -> def_id_for_type_of
Bastian Kauschke [Wed, 15 Jul 2020 08:53:11 +0000 (10:53 +0200)]
ty_def_id -> def_id_for_type_of

4 years agoimprove naming
Bastian Kauschke [Wed, 15 Jul 2020 08:50:54 +0000 (10:50 +0200)]
improve naming

4 years agocleanup
Bastian Kauschke [Wed, 8 Jul 2020 09:42:59 +0000 (11:42 +0200)]
cleanup

4 years agoupdate promoted_mir
Bastian Kauschke [Wed, 8 Jul 2020 08:35:58 +0000 (10:35 +0200)]
update promoted_mir

4 years agoupdate const arg queries
Bastian Kauschke [Tue, 7 Jul 2020 23:03:19 +0000 (01:03 +0200)]
update const arg queries

4 years agoupdate test
Bastian Kauschke [Tue, 7 Jul 2020 08:46:24 +0000 (10:46 +0200)]
update test

4 years agoonly call `typeck_tables_of_const_arg` for const args
Bastian Kauschke [Tue, 7 Jul 2020 08:40:36 +0000 (10:40 +0200)]
only call `typeck_tables_of_const_arg` for const args

4 years agomir opt cross compile
Bastian Kauschke [Tue, 7 Jul 2020 08:35:20 +0000 (10:35 +0200)]
mir opt cross compile

4 years agomir_built is a lie
Bastian Kauschke [Mon, 6 Jul 2020 22:35:06 +0000 (00:35 +0200)]
mir_built is a lie

4 years agodecode stuff
Bastian Kauschke [Mon, 6 Jul 2020 22:34:28 +0000 (00:34 +0200)]
decode stuff

4 years agoui test diff
Bastian Kauschke [Mon, 6 Jul 2020 22:03:36 +0000 (00:03 +0200)]
ui test diff

4 years agomir opt diff
Bastian Kauschke [Mon, 6 Jul 2020 22:03:30 +0000 (00:03 +0200)]
mir opt diff

4 years agoconst generics work!
Bastian Kauschke [Mon, 6 Jul 2020 21:49:53 +0000 (23:49 +0200)]
const generics work!

4 years agocontinue mir pipeline
Bastian Kauschke [Fri, 3 Jul 2020 20:15:27 +0000 (22:15 +0200)]
continue mir pipeline

4 years agooptimized_mir
Bastian Kauschke [Fri, 3 Jul 2020 18:38:31 +0000 (20:38 +0200)]
optimized_mir

4 years agoInstanceDef::Item
Bastian Kauschke [Fri, 3 Jul 2020 17:13:39 +0000 (19:13 +0200)]
InstanceDef::Item

4 years agotypeck all the tables
Bastian Kauschke [Fri, 3 Jul 2020 14:39:02 +0000 (16:39 +0200)]
typeck all the tables

4 years agoconst_eval_resolve
Bastian Kauschke [Thu, 2 Jul 2020 21:56:17 +0000 (23:56 +0200)]
const_eval_resolve

4 years agoConstKind::Unevaluated
Bastian Kauschke [Thu, 2 Jul 2020 21:13:32 +0000 (23:13 +0200)]
ConstKind::Unevaluated

4 years agobegin using `WithOptParam`
Bastian Kauschke [Thu, 2 Jul 2020 20:56:28 +0000 (22:56 +0200)]
begin using `WithOptParam`

4 years agointroduce the query `opt_const_param_of`
Bastian Kauschke [Thu, 2 Jul 2020 20:35:11 +0000 (22:35 +0200)]
introduce the query `opt_const_param_of`

4 years agoadd const generic tests
Bastian Kauschke [Thu, 2 Jul 2020 20:06:14 +0000 (22:06 +0200)]
add const generic tests

4 years agoAuto merge of #74214 - nnethercote:change-SymbolName-name, r=eddyb
bors [Wed, 15 Jul 2020 08:44:46 +0000 (08:44 +0000)]
Auto merge of #74214 - nnethercote:change-SymbolName-name, r=eddyb

Change `SymbolName::name` to a `&str`.

This eliminates a bunch of `Symbol::intern()` and `Symbol::as_str()`
calls, which is good, because they require locking the interner.

Note that the unsafety in `from_cycle_error()` is identical to the
unsafety on other adjacent impls.

r? @eddyb

4 years agoimprove DiscriminantKind handling
Bastian Kauschke [Wed, 15 Jul 2020 07:59:08 +0000 (09:59 +0200)]
improve DiscriminantKind handling

This now reuses `fn discriminant_ty` in project, removing
some code duplication. Doing so made me realize that
we previously had a disagreement about the discriminant
type of generators, with MIR using `u32` and codegen and
trait selection using `i32`.

We now always use `u32`.

4 years agoAuto merge of #71272 - jclulow:illumos-x86-ci, r=pietroalbini
bors [Wed, 15 Jul 2020 04:46:06 +0000 (04:46 +0000)]
Auto merge of #71272 - jclulow:illumos-x86-ci, r=pietroalbini

build dist for x86_64-unknown-illumos

This change creates a new Docker image, "dist-x86_64-illumos", and sets
things up to build the full set of "dist" packages for illumos hosts, so
that illumos users can use "rustup" to install packages.  It also
adjusts the manifest builder to expect complete toolchains for this
platform.

4 years agoUndo the `const_str` changes from the previous commit.
Nicholas Nethercote [Wed, 15 Jul 2020 01:58:51 +0000 (11:58 +1000)]
Undo the `const_str` changes from the previous commit.

4 years agoChange `SymbolName::name` to a `&str`.
Nicholas Nethercote [Fri, 10 Jul 2020 05:45:05 +0000 (15:45 +1000)]
Change `SymbolName::name` to a `&str`.

This eliminates a bunch of `Symbol::intern()` and `Symbol::as_str()`
calls, which is good, because they require locking the interner.

Note that the unsafety in `from_cycle_error()` is identical to the
unsafety on other adjacent impls.

4 years agoAuto merge of #74175 - nnethercote:more-static-symbols, r=oli-obk
bors [Wed, 15 Jul 2020 00:16:25 +0000 (00:16 +0000)]
Auto merge of #74175 - nnethercote:more-static-symbols, r=oli-obk

More static symbols

These commits add some more static symbols and convert lots of places to use them.

r? @oli-obk

4 years agoRemove lots of `Symbol::as_str()` calls.
Nicholas Nethercote [Wed, 8 Jul 2020 10:03:37 +0000 (20:03 +1000)]
Remove lots of `Symbol::as_str()` calls.

In various ways, such as changing functions to take a `Symbol` instead
of a `&str`.

4 years agoAdd and use more static symbols.
Nicholas Nethercote [Wed, 8 Jul 2020 01:04:10 +0000 (11:04 +1000)]
Add and use more static symbols.

Note that the output of `unpretty-debug.stdout` has changed. In that
test the hash values are normalized from a symbol numbers to small
numbers like "0#0" and "0#1". The increase in the number of static
symbols must have caused the original numbers to contain more digits,
resulting in different pretty-printing prior to normalization.

4 years agoFix the ordering of the static symbols.
Nicholas Nethercote [Wed, 8 Jul 2020 01:07:24 +0000 (11:07 +1000)]
Fix the ordering of the static symbols.

4 years agoRename `sym::nontrapping_fptoint`.
Nicholas Nethercote [Wed, 8 Jul 2020 01:54:27 +0000 (11:54 +1000)]
Rename `sym::nontrapping_fptoint`.

4 years agoAuto merge of #74342 - Manishearth:rollup-l63pesj, r=Manishearth
bors [Tue, 14 Jul 2020 20:19:59 +0000 (20:19 +0000)]
Auto merge of #74342 - Manishearth:rollup-l63pesj, r=Manishearth

Rollup of 11 pull requests

Successful merges:

 - #73759 (Add missing Stdin and StdinLock examples)
 - #74211 (Structured suggestion when not using struct pattern)
 - #74228 (Provide structured suggestion on unsized fields and fn params)
 - #74252 (Don't allow `DESTDIR` to influence LLVM builds)
 - #74263 (Slight reorganization of sys/(fast_)thread_local)
 - #74271 (process_unix: prefer i32::*_be_bytes over manually shifting bytes)
 - #74272 (pprust: support multiline comments within lines)
 - #74332 (Update cargo)
 - #74334 (bootstrap: Improve wording on docs for `verbose-tests`)
 - #74336 (typeck: use `item_name` in cross-crate packed diag)
 - #74340 (lint: use `transparent_newtype_field` to avoid ICE)

Failed merges:

r? @ghost

4 years agoRollup merge of #74340 - davidtwco:issue-73747-improper-ctypes-defns-is-zst-with...
Manish Goregaokar [Tue, 14 Jul 2020 20:19:39 +0000 (13:19 -0700)]
Rollup merge of #74340 - davidtwco:issue-73747-improper-ctypes-defns-is-zst-with-params, r=pnkfelix

lint: use `transparent_newtype_field` to avoid ICE

Fixes #73747.

This PR re-uses the `transparent_newtype_field` function instead of manually calling `is_zst` on normalized fields to determine which field in a transparent type is the non-zero-sized field, thus avoiding an ICE.

4 years agoRollup merge of #74336 - davidtwco:issue-73112-cross-crate-packed-type-diagnostic...
Manish Goregaokar [Tue, 14 Jul 2020 20:19:37 +0000 (13:19 -0700)]
Rollup merge of #74336 - davidtwco:issue-73112-cross-crate-packed-type-diagnostic, r=estebank

typeck: use `item_name` in cross-crate packed diag

Fixes #73112.

This PR replaces the use of `expect_local` and `hir().get` to fetch the identifier for a ADT with `item_name` - which works across crates.

4 years agoRollup merge of #74334 - jyn514:config-toml-docs, r=spastorino
Manish Goregaokar [Tue, 14 Jul 2020 20:19:35 +0000 (13:19 -0700)]
Rollup merge of #74334 - jyn514:config-toml-docs, r=spastorino

bootstrap: Improve wording on docs for `verbose-tests`

From https://github.com/rust-lang/rustc-dev-guide/pull/795#discussion_r454392291

r? @spastorino

4 years agoRollup merge of #74332 - ehuss:update-cargo, r=ehuss
Manish Goregaokar [Tue, 14 Jul 2020 20:19:33 +0000 (13:19 -0700)]
Rollup merge of #74332 - ehuss:update-cargo, r=ehuss

Update cargo

4 commits in 4f74d9b2a771c58b7ef4906b2668afd075bc8081..43cf77395cad5b79887b20b7cf19d418bbd703a9
2020-07-08 17:13:00 +0000 to 2020-07-13 17:35:42 +0000
- fix: add space to comments (rust-lang/cargo#8476)
- Allow configuring unstable flags via config file (rust-lang/cargo#8393)
- Add support for rustc's `-Z terminal-width`. (rust-lang/cargo#8427)
- Avoid colliding with older Cargo fingerprint changes (rust-lang/cargo#8473)

4 years agoRollup merge of #74272 - davidtwco:issue-73626-multiline-mixed-comments, r=Mark-Simul...
Manish Goregaokar [Tue, 14 Jul 2020 20:19:32 +0000 (13:19 -0700)]
Rollup merge of #74272 - davidtwco:issue-73626-multiline-mixed-comments, r=Mark-Simulacrum

pprust: support multiline comments within lines

Fixes #73626.

This PR adds support to `rustc_ast_pretty` for multiline comments that start and end within a line of source code.

Fun fact: [the commit which added this assert](https://github.com/rust-lang/rust/commit/d12ea3989649616437a7c1434f5c5a6438235eb7) was from 2011!
https://github.com/rust-lang/rust/blob/d12ea3989649616437a7c1434f5c5a6438235eb7/src/comp/pretty/pprust.rs#L1146-L1150

4 years agoRollup merge of #74271 - lzutao:cmdbytes, r=LukasKalbertodt
Manish Goregaokar [Tue, 14 Jul 2020 20:19:30 +0000 (13:19 -0700)]
Rollup merge of #74271 - lzutao:cmdbytes, r=LukasKalbertodt

process_unix: prefer i32::*_be_bytes over manually shifting bytes

This PR makes it more clear about the intend of the code.

4 years agoRollup merge of #74263 - RalfJung:thread-local, r=Mark-Simulacrum
Manish Goregaokar [Tue, 14 Jul 2020 20:19:28 +0000 (13:19 -0700)]
Rollup merge of #74263 - RalfJung:thread-local, r=Mark-Simulacrum

Slight reorganization of sys/(fast_)thread_local

I was long confused by the `thread_local` and `fast_thread_local` modules in the `sys(_common)` part of libstd. The names make it *sound* like `fast_thread_local` is just a faster version of `thread_local`, but really these are totally different APIs: one provides thread-local "keys", which are non-addressable pointer-sized pieces of local storage with an associated destructor; the other (the "fast" one) provides just a destructor.

So I propose we rename `fast_thread_local` to `thread_local_dtor`, and `thread_local` to `thread_local_key`. That's what this PR does.

4 years agoRollup merge of #74252 - shepmaster:bootstrap-rust-destdir, r=Mark-Simulacrum
Manish Goregaokar [Tue, 14 Jul 2020 20:19:26 +0000 (13:19 -0700)]
Rollup merge of #74252 - shepmaster:bootstrap-rust-destdir, r=Mark-Simulacrum

Don't allow `DESTDIR` to influence LLVM builds

When running a command like `DESTDIR=foo x.py install` in a completely
clean build directory, this will cause LLVM to be installed into
`DESTDIR`, which then causes the build to fail later when it attempts
to *use* those LLVM files.

4 years agoRollup merge of #74228 - estebank:unsized-param, r=davidtwco
Manish Goregaokar [Tue, 14 Jul 2020 20:19:24 +0000 (13:19 -0700)]
Rollup merge of #74228 - estebank:unsized-param, r=davidtwco

Provide structured suggestion on unsized fields and fn params

* Suggest borrowing or boxing unsized fields
* Suggest borrowing fn parameters
* Remove some verbosity of unsized errors
* Remove `on_unimplemented` note from `trait Sized`

Fix #23286, fix #28653.

r? @davidtwco

4 years agoRollup merge of #74211 - estebank:struct-pat-as-unit, r=petrochenkov
Manish Goregaokar [Tue, 14 Jul 2020 20:19:22 +0000 (13:19 -0700)]
Rollup merge of #74211 - estebank:struct-pat-as-unit, r=petrochenkov

Structured suggestion when not using struct pattern

r? @petrochenkov

4 years agoRollup merge of #73759 - GuillaumeGomez:stdin-examples, r=Dylan-DPC
Manish Goregaokar [Tue, 14 Jul 2020 20:19:20 +0000 (13:19 -0700)]
Rollup merge of #73759 - GuillaumeGomez:stdin-examples, r=Dylan-DPC

Add missing Stdin and StdinLock examples

r? @Dylan-DPC

4 years agoReword message
Esteban Küber [Tue, 14 Jul 2020 19:18:01 +0000 (12:18 -0700)]
Reword message

4 years agoRemove redundant explanatory `note` for type parameters
Esteban Küber [Sat, 11 Jul 2020 01:47:53 +0000 (18:47 -0700)]
Remove redundant explanatory `note` for type parameters

4 years agolint: use `transparent_newtype_field` to avoid ICE
David Wood [Tue, 14 Jul 2020 18:26:34 +0000 (19:26 +0100)]
lint: use `transparent_newtype_field` to avoid ICE

This commit re-uses the `transparent_newtype_field` function instead of
manually calling `is_zst` on normalized fields to determine which field
in a transparent type is the non-zero-sized field, thus avoiding an ICE.

Signed-off-by: David Wood <david@davidtw.co>
4 years agoSuggest borrowing in more unsized fn param cases
Esteban Küber [Sat, 11 Jul 2020 01:11:40 +0000 (18:11 -0700)]
Suggest borrowing in more unsized fn param cases

4 years agoRemove `Sized` `on_unimplemented` note
Esteban Küber [Fri, 10 Jul 2020 23:05:35 +0000 (16:05 -0700)]
Remove `Sized` `on_unimplemented` note

4 years agoSuggest boxing or borrowing unsized fields
Esteban Küber [Fri, 10 Jul 2020 22:13:49 +0000 (15:13 -0700)]
Suggest boxing or borrowing unsized fields

4 years agoPoint at type on E0275 instead of whole field
Esteban Küber [Fri, 10 Jul 2020 21:54:48 +0000 (14:54 -0700)]
Point at type on E0275 instead of whole field

4 years agoSuggest borrowing unsized argument types
Esteban Küber [Fri, 10 Jul 2020 21:53:48 +0000 (14:53 -0700)]
Suggest borrowing unsized argument types

4 years agoSuggest struct pat on incorrect unit or tuple pat
Esteban Küber [Fri, 10 Jul 2020 00:42:07 +0000 (17:42 -0700)]
Suggest struct pat on incorrect unit or tuple pat

When encountering a unit or tuple pattern for a struct-like item, suggest
using the correct pattern.

Use `insert_field_names_local` when evaluating variants and store field
names even when the list is empty in order to produce accurate
structured suggestions.

4 years agoAuto merge of #74330 - Manishearth:rollup-mrc09pb, r=Manishearth
bors [Tue, 14 Jul 2020 17:11:02 +0000 (17:11 +0000)]
Auto merge of #74330 - Manishearth:rollup-mrc09pb, r=Manishearth

Rollup of 15 pull requests

Successful merges:

 - #71237 (Add Ayu theme to rustdoc)
 - #73720 (Clean up E0704 error explanation)
 - #73866 (Obviate #[allow(improper_ctypes_definitions)])
 - #73965 (typeck: check for infer before type impls trait)
 - #73986 (add (unchecked) indexing methods to raw (and NonNull) slices)
 - #74173 (Detect tuple struct incorrectly used as struct pat)
 - #74220 (Refactor Windows `parse_prefix`)
 - #74227 (Remove an unwrap in layout computation)
 - #74239 (Update llvm-project to latest origin/rustc/10.0-2020-05-05 commit )
 - #74257 (don't mark linux kernel module targets as a unix environment)
 - #74270 (typeck: report placeholder type error w/out span)
 - #74296 (Clarify the description for rfind)
 - #74310 (Use `ArrayVec` in `SparseBitSet`.)
 - #74316 (Remove unnecessary type hints from Wake internals)
 - #74324 (Update Clippy)

Failed merges:

r? @ghost

4 years agotypeck: use `item_name` in cross-crate packed diag
David Wood [Tue, 14 Jul 2020 15:28:11 +0000 (16:28 +0100)]
typeck: use `item_name` in cross-crate packed diag

This commit replaces the use of `expect_local` and `hir().get` to fetch
the identifier for a ADT with `item_name` - which works across crates.

Signed-off-by: David Wood <david@davidtw.co>
4 years agobootstrap: Improve wording on docs for `verbose-tests`
Joshua Nelson [Tue, 14 Jul 2020 15:11:24 +0000 (11:11 -0400)]
bootstrap: Improve wording on docs for `verbose-tests`

4 years agoUpdate cargo
Eric Huss [Tue, 14 Jul 2020 14:50:18 +0000 (07:50 -0700)]
Update cargo

4 years agoRollup merge of #74324 - flip1995:clippyup, r=Manishearth
Manish Goregaokar [Tue, 14 Jul 2020 14:39:19 +0000 (07:39 -0700)]
Rollup merge of #74324 - flip1995:clippyup, r=Manishearth

Update Clippy

~~I'm not sure, if we can/should land this before beta is branched.~~ (Nvm, beta is already branched) The last Clippy update was 3 weeks ago: #73660

This includes, besides other minor things:

- New lints
- One lint deprecation
- One lint was moved to pedantic
- Some FP fixes
- I think an ICE fix?

cc @Mark-Simulacrum

r? @Manishearth

---

We probably should also think of some process when and how often we should sync Clippy to the rust repo, so that we don't end up with those huge updates. Maybe every 2 weeks? Or even every week? cc @rust-lang/clippy

4 years agoRollup merge of #74316 - yoshuawuyts:no-wake-type-hints, r=Mark-Simulacrum
Manish Goregaokar [Tue, 14 Jul 2020 14:39:17 +0000 (07:39 -0700)]
Rollup merge of #74316 - yoshuawuyts:no-wake-type-hints, r=Mark-Simulacrum

Remove unnecessary type hints from Wake internals

While working on https://github.com/rust-lang/rust/pull/74304 I noticed we were writing out the type signature twice in some internal `Wake` impl methods; this streamlines that. Thanks!

4 years agoRollup merge of #74310 - nnethercote:use-ArrayVec-in-SparseBitSet, r=eddyb
Manish Goregaokar [Tue, 14 Jul 2020 14:39:15 +0000 (07:39 -0700)]
Rollup merge of #74310 - nnethercote:use-ArrayVec-in-SparseBitSet, r=eddyb

Use `ArrayVec` in `SparseBitSet`.

Instead of `SmallVec`, because the maximum size is known.

r? @eddyb

4 years agoRollup merge of #74296 - Lynoure:rfind-doc-improvement, r=hanna-kruppe
Manish Goregaokar [Tue, 14 Jul 2020 14:39:13 +0000 (07:39 -0700)]
Rollup merge of #74296 - Lynoure:rfind-doc-improvement, r=hanna-kruppe

Clarify the description for rfind

Changes the wording in rfind description to be clearer and the example code to illustrate the difference between
find and rfind

4 years agoRollup merge of #74270 - davidtwco:issue-74086-more-placeholder-type-error, r=estebank
Manish Goregaokar [Tue, 14 Jul 2020 14:39:11 +0000 (07:39 -0700)]
Rollup merge of #74270 - davidtwco:issue-74086-more-placeholder-type-error, r=estebank

typeck: report placeholder type error w/out span

Fixes #74086.

This PR fixes a regression introduced in rust-lang/rust#70369 which meant that an error was not being emitted for invalid placeholder types when there wasn't a span available.

r? @estebank

4 years agoRollup merge of #74257 - alex:patch-1, r=joshtriplett
Manish Goregaokar [Tue, 14 Jul 2020 14:39:10 +0000 (07:39 -0700)]
Rollup merge of #74257 - alex:patch-1, r=joshtriplett

don't mark linux kernel module targets as a unix environment

refs #74247

r?@joshtriplett

cc: @ehuss

4 years agoRollup merge of #74239 - AdrianCX:master, r=cuviper
Manish Goregaokar [Tue, 14 Jul 2020 14:39:08 +0000 (07:39 -0700)]
Rollup merge of #74239 - AdrianCX:master, r=cuviper

Update llvm-project to latest origin/rustc/10.0-2020-05-05 commit

which includes LVI segfault fix when building https://github.com/fortanix/rust-sgx/issues/267
And a few earlier commits.

4 years agoRollup merge of #74227 - erikdesjardins:layun, r=estebank
Manish Goregaokar [Tue, 14 Jul 2020 14:39:06 +0000 (07:39 -0700)]
Rollup merge of #74227 - erikdesjardins:layun, r=estebank

Remove an unwrap in layout computation

A tiny improvement.

4 years agoRollup merge of #74220 - lzutao:windows-path-com, r=LukasKalbertodt
Manish Goregaokar [Tue, 14 Jul 2020 14:39:04 +0000 (07:39 -0700)]
Rollup merge of #74220 - lzutao:windows-path-com, r=LukasKalbertodt

Refactor Windows `parse_prefix`

These changes make me feel more readable.
See the commit messages for more details.

4 years agoRollup merge of #74173 - estebank:struct-pat-as-enum, r=petrochenkov
Manish Goregaokar [Tue, 14 Jul 2020 14:39:02 +0000 (07:39 -0700)]
Rollup merge of #74173 - estebank:struct-pat-as-enum, r=petrochenkov

Detect tuple struct incorrectly used as struct pat

Subpart of #74005.

r? @petrochenkov

4 years agoRollup merge of #73986 - RalfJung:raw-slice-as-ptr, r=sfackler
Manish Goregaokar [Tue, 14 Jul 2020 14:39:00 +0000 (07:39 -0700)]
Rollup merge of #73986 - RalfJung:raw-slice-as-ptr, r=sfackler

add (unchecked) indexing methods to raw (and NonNull) slices

This complements the existing (unstable) `len` method. Unfortunately, for non-null slices, we cannot call this method `as_ptr` as that overlaps with the existing method of the same name.

If this looks reasonable to accept, I propose to reuse the https://github.com/rust-lang/rust/issues/71146 tracking issue and rename the feature get to `slice_ptr_methods` or so.

Cc @SimonSapin
Fixes https://github.com/rust-lang/rust/issues/60639

4 years agoRollup merge of #73965 - davidtwco:issue-73886-non-primitive-slice-cast, r=estebank
Manish Goregaokar [Tue, 14 Jul 2020 14:38:58 +0000 (07:38 -0700)]
Rollup merge of #73965 - davidtwco:issue-73886-non-primitive-slice-cast, r=estebank

typeck: check for infer before type impls trait

Fixes #73886.

This PR checks that the target type of the cast (an error related to which is being reported) does not have types to be inferred before checking if it implements the `From` trait.

r? @estebank

4 years agoRollup merge of #73866 - Goirad:fix-entry-improper-ctypes, r=davidtwco
Manish Goregaokar [Tue, 14 Jul 2020 14:38:56 +0000 (07:38 -0700)]
Rollup merge of #73866 - Goirad:fix-entry-improper-ctypes, r=davidtwco

Obviate #[allow(improper_ctypes_definitions)]

Modifies the return type for `fn entry` so that allowing
improper_ctypes_definitions is no longer necessary. This change is
derived from a similar pattern in `libstd/sys/sgx/abi/usercalls/raw.rs`
with `UsercallReturn`.

cc @jethrogb

4 years agoRollup merge of #73720 - GuillaumeGomez:cleanup-e0704, r=Dylan-DPC
Manish Goregaokar [Tue, 14 Jul 2020 14:38:53 +0000 (07:38 -0700)]
Rollup merge of #73720 - GuillaumeGomez:cleanup-e0704, r=Dylan-DPC

Clean up E0704 error explanation

r? @Dylan-DPC

4 years agoRollup merge of #71237 - Cldfire:rustdoc-ayu-theme, r=GuilliaumeGomez
Manish Goregaokar [Tue, 14 Jul 2020 14:38:50 +0000 (07:38 -0700)]
Rollup merge of #71237 - Cldfire:rustdoc-ayu-theme, r=GuilliaumeGomez

Add Ayu theme to rustdoc

This is a port of a theme I maintain (https://github.com/Cldfire/ayu-rs) to the native rustdoc theme system. [Ayu](https://github.com/dempfi/ayu) (dark) is a richly-colored dark theme that many people enjoy using across a wide variety of environments.

Corresponds to the Ayu theme in [mdBook](https://github.com/rust-lang/mdBook).

Some screenshots:

![image](https://user-images.githubusercontent.com/13814214/79547087-6c935780-8061-11ea-8a33-38e9472e9fec.png)

![image](https://user-images.githubusercontent.com/13814214/79547150-8339ae80-8061-11ea-97be-9e13a8b275d7.png)

![image](https://user-images.githubusercontent.com/13814214/79547221-98164200-8061-11ea-9649-9b11ccbb33e3.png)

![image](https://user-images.githubusercontent.com/13814214/79547310-b419e380-8061-11ea-9965-d4f90b2280ab.png)

![image](https://user-images.githubusercontent.com/13814214/79547443-e7f50900-8061-11ea-8872-06d74010691e.png)

Note that this pull request also makes some small code changes to allow for disabling theme stylesheets, preventing the rules from all the different themes from conflicting with one another. The only stylesheet that is not disabled is `light.css`; the theming system (quite hackily) switches themes by changing the href on this stylesheet and so permanently disabling all the others works perfectly fine.

4 years agoMerge commit '2ca58e7dda4a9eb142599638c59dc04d15961175' into clippyup
flip1995 [Tue, 14 Jul 2020 12:59:59 +0000 (14:59 +0200)]
Merge commit '2ca58e7dda4a9eb142599638c59dc04d15961175' into clippyup

4 years agoRemove unnecessary type hints from the Wake impl
Yoshua Wuyts [Tue, 14 Jul 2020 09:59:11 +0000 (11:59 +0200)]
Remove unnecessary type hints from the Wake impl

4 years agoAuto merge of #5732 - bjorn3:patch-1, r=flip1995
bors [Tue, 14 Jul 2020 09:39:01 +0000 (09:39 +0000)]
Auto merge of #5732 - bjorn3:patch-1, r=flip1995

Rename collapsable_if fix suggestion to "collapse nested if block"

The name "try" is confusing when shown as quick fix by rust-analyzer

changelog: Rename `collapsable_if` fix suggestion to "collapse nested if block"

4 years agoAuto merge of #5773 - giraffate:repeat_once, r=flip1995
bors [Tue, 14 Jul 2020 09:13:58 +0000 (09:13 +0000)]
Auto merge of #5773 - giraffate:repeat_once, r=flip1995

Add a lint for `.repeat(1)`

changelog: New lint `repeat_once`

fix #3028.

4 years agoAuto merge of #73490 - CAD97:range-unchecked-stepping, r=Amanieu
bors [Tue, 14 Jul 2020 08:56:06 +0000 (08:56 +0000)]
Auto merge of #73490 - CAD97:range-unchecked-stepping, r=Amanieu

Use step_unchecked more liberally in range iter impls

Without these `_unchecked`, these operations on iterators of `char` fail to optimize out the unreachable panicking condition on overflow.

cc @cuviper https://github.com/rayon-rs/rayon/pull/771 where this was discovered.

4 years agoAdded docs for `From<c_int>` for `ExitStatus`
Vincent Esche [Mon, 13 Jul 2020 11:47:18 +0000 (13:47 +0200)]
Added docs for `From<c_int>` for `ExitStatus`

4 years agoAuto merge of #74313 - Manishearth:rollup-b55rn6t, r=Manishearth
bors [Tue, 14 Jul 2020 05:23:45 +0000 (05:23 +0000)]
Auto merge of #74313 - Manishearth:rollup-b55rn6t, r=Manishearth

Rollup of 8 pull requests

Successful merges:

 - #73354 (Update RELEASES.md for 1.45.0)
 - #73852 (rustdoc: insert newlines between attributes)
 - #73867 (Document the union keyword)
 - #74046 (Fix caching issue when building tools.)
 - #74123 (clean up E0718 explanation)
 - #74147 (rustdoc: Allow linking from private items to private types)
 - #74285 (#71669: add ui, codegen tests for volatile + nearby int intrinsics)
 - #74286 (Added detailed error code explanation for issue E0688 in Rust compiler.)

Failed merges:

r? @ghost

4 years agoRollup merge of #74286 - PankajChaudhary5:E0688, r=GuillaumeGomez
Manish Goregaokar [Tue, 14 Jul 2020 05:23:15 +0000 (22:23 -0700)]
Rollup merge of #74286 - PankajChaudhary5:E0688, r=GuillaumeGomez

Added detailed error code explanation for issue E0688 in Rust compiler.

Added proper error explanation for issue E0688 in the Rust compiler.
Error Code E0688

Sub Part of Issue #61137

r? @GuillaumeGomez

4 years agoRollup merge of #74285 - wangtheo:issue-71669, r=lcnr
Manish Goregaokar [Tue, 14 Jul 2020 05:23:13 +0000 (22:23 -0700)]
Rollup merge of #74285 - wangtheo:issue-71669, r=lcnr

#71669: add ui, codegen tests for volatile + nearby int intrinsics

Added some tests for intrinsics. See https://github.com/rust-lang/rust/issues/71669.

4 years agoRollup merge of #74147 - dennis-hamester:fix/issue-74134, r=jyn514
Manish Goregaokar [Tue, 14 Jul 2020 05:23:11 +0000 (22:23 -0700)]
Rollup merge of #74147 - dennis-hamester:fix/issue-74134, r=jyn514

rustdoc: Allow linking from private items to private types

Fixes #74134

After PR #72771 this would trigger an intra_doc_link_resolution_failure warning
when rustdoc is invoked without --document-private-items. Links from private
items to private types are however never actually generated in that case and
thus shouldn't produce a warning. These links are in fact a very useful tool to
document crate internals.

Tests are added for all 4 combinations of public/private items and link
targets. Test 1 is the case mentioned above and fails without this commit. Tests
2 - 4 passed before already but are added nonetheless to prevent regressions.

4 years agoRollup merge of #74123 - GuillaumeGomez:cleanup-e0718, r=pickfire
Manish Goregaokar [Tue, 14 Jul 2020 05:23:10 +0000 (22:23 -0700)]
Rollup merge of #74123 - GuillaumeGomez:cleanup-e0718, r=pickfire

clean up E0718 explanation

r? @Dylan-DPC

4 years agoRollup merge of #74046 - ehuss:deny-warnings-caching, r=Mark-Simulacrum
Manish Goregaokar [Tue, 14 Jul 2020 05:23:08 +0000 (22:23 -0700)]
Rollup merge of #74046 - ehuss:deny-warnings-caching, r=Mark-Simulacrum

Fix caching issue when building tools.

This fixes a problem with tool builds not being cached properly.

#73297 changed it so that Clippy will participate in the "deny warnings" setting. Unfortunately this causes a problem because Clippy shares the build directory with other tools which do not participate in "deny warnings".  Because Cargo does not independently cache artifacts based on different RUSTFLAGS settings, it causes all the shared dependencies to get rebuilt if Clippy ever gets built.

The solution here is to stop using RUSTFLAGS, and just sneak the settings in through the rustc wrapper. Cargo won't know about the different settings, so it will not bust the cache. This should be safe since lint settings on dependencies are ignored. This is how things used to work in the past before #64316.

Alternate solutions:
* Treat Clippy as a "submodule" and don't enforce warnings on it. This was the behavior before #73297. The consequence is that if a warning sneaks into clippy, that the clippy maintainers will need to fix it when they sync clippy back to the clippy repo.
* Just deny warnings on all tools (removing the in-tree/submodule distinction). This is tempting, but with some issues (cc #52336):
  * Adding or changing warnings in rustc can be difficult to land because tools have to be updated if they trip the warning. In practice, this isn't too bad.  Cargo (and rustfmt) already runs with `deny(warnings)`, so this has been the de-facto standard already (although they do not use the extra lints like `unused_lifetimes`).
* Teach Cargo to add flags to the workspace members, but not dependencies.
* Teach Cargo to add flags without fingerprinting them?
* Teach Cargo to independently cache different RUSTFLAGS artifacts (this was [reverted](https://github.com/rust-lang/cargo/pull/7417) due to complications). This would also unnecessarily rebuild dependencies, but would avoid cache thrashing.
* Teach Cargo about lint settings.

Closes #74016

4 years agoRollup merge of #73867 - poliorcetics:union-keyword, r=joshtriplett
Manish Goregaokar [Tue, 14 Jul 2020 05:23:03 +0000 (22:23 -0700)]
Rollup merge of #73867 - poliorcetics:union-keyword, r=joshtriplett

Document the union keyword

Partial fix of #34601.

This documents the `union` keyword by presenting three cases: simply using a union, matching on a union and referencing the fields of a union.

@rustbot modify labels: T-doc,C-enhancement

4 years agoRollup merge of #73852 - euclio:rustdoc-attr-newlines, r=GuillaumeGomez
Manish Goregaokar [Tue, 14 Jul 2020 05:23:00 +0000 (22:23 -0700)]
Rollup merge of #73852 - euclio:rustdoc-attr-newlines, r=GuillaumeGomez

rustdoc: insert newlines between attributes

Fixes #73205.