]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoadd regression test for #73491
Bastian Kauschke [Thu, 16 Jul 2020 10:35:23 +0000 (12:35 +0200)]
add regression test for #73491

3 years agoadd regression test for #71169
Bastian Kauschke [Thu, 16 Jul 2020 10:14:03 +0000 (12:14 +0200)]
add regression test for #71169

3 years agobless ui tests
Bastian Kauschke [Thu, 16 Jul 2020 09:40:26 +0000 (11:40 +0200)]
bless ui tests

3 years agoupdate help message
Bastian Kauschke [Thu, 16 Jul 2020 09:10:22 +0000 (11:10 +0200)]
update help message

3 years agodon't supply generics to AnonConsts in param lists
Bastian Kauschke [Thu, 9 Jul 2020 20:26:49 +0000 (22:26 +0200)]
don't supply generics to AnonConsts in param lists

3 years agorelax Node lt bounds
Bastian Kauschke [Thu, 9 Jul 2020 20:18:22 +0000 (22:18 +0200)]
relax Node lt bounds

3 years agoadd self dependent const param test
Bastian Kauschke [Wed, 8 Jul 2020 20:25:22 +0000 (22:25 +0200)]
add self dependent const param test

3 years agoforbid generic params in the type of const params
Bastian Kauschke [Wed, 8 Jul 2020 20:16:18 +0000 (22:16 +0200)]
forbid generic params in the type of const params

3 years agoAuto merge of #74375 - Manishearth:rollup-10vbpdh, r=Manishearth
bors [Thu, 16 Jul 2020 03:16:07 +0000 (03:16 +0000)]
Auto merge of #74375 - Manishearth:rollup-10vbpdh, r=Manishearth

Rollup of 14 pull requests

Successful merges:

 - #72973 (RISC-V GNU/Linux as host platform)
 - #73918 (Clean up E0715 explanation)
 - #73959 (Clean up E0716 explanation)
 - #74119 (Remove `Compiler::compile()`.)
 - #74196 (Add option to collapse automatically implementors)
 - #74218 (Add margin after doc search results)
 - #74276 (improve DiscriminantKind handling)
 - #74291 (Added docs for `From<c_int>` for `ExitStatus`)
 - #74294 (Update cross-compilation README)
 - #74337 (Handle case of incomplete local ty more gracefully)
 - #74344 (Remove string comparison and use diagnostic item instead)
 - #74347 (Initialize default providers only once)
 - #74353 (Edit docs for rustc_middle::dep_graph::dep_node)
 - #74374 (Add a 1.45 release note on lto vs. embed-bitcode)

Failed merges:

 - #74251 (Teach bootstrap about target files vs target triples)

r? @ghost

4 years agoRollup merge of #74374 - cuviper:lto-bitcode-1.45, r=Mark-Simulacrum
Manish Goregaokar [Wed, 15 Jul 2020 18:01:33 +0000 (11:01 -0700)]
Rollup merge of #74374 - cuviper:lto-bitcode-1.45, r=Mark-Simulacrum

Add a 1.45 release note on lto vs. embed-bitcode

I added a bullet for Cargo's use of `embed-bitcode`, since that was even noteworthy enough for the Inside Rust blog. Then more importantly, I added a compatibility note for how this may interact poorly with manually enabling LTO.

r? @Mark-Simulacrum

4 years agoRollup merge of #74353 - pierwill:pierwill-edit-dep-node, r=jonas-schievink
Manish Goregaokar [Wed, 15 Jul 2020 18:01:31 +0000 (11:01 -0700)]
Rollup merge of #74353 - pierwill:pierwill-edit-dep-node, r=jonas-schievink

Edit docs for rustc_middle::dep_graph::dep_node

Fixes some missing punctuation, and adds a blank line for a more concise summary.

4 years agoRollup merge of #74347 - jyn514:ive-got-a-small-query-for-you, r=eddyb
Manish Goregaokar [Wed, 15 Jul 2020 18:01:29 +0000 (11:01 -0700)]
Rollup merge of #74347 - jyn514:ive-got-a-small-query-for-you, r=eddyb

Initialize default providers only once

This avoids copying a new `Providers` struct for each downstream crate
that wants to use it.

Follow-up to https://github.com/rust-lang/rust/pull/74283 without the perf hit.

r? @eddyb

4 years agoRollup merge of #74344 - estebank:stringly-wobbly, r=eddyb
Manish Goregaokar [Wed, 15 Jul 2020 18:01:28 +0000 (11:01 -0700)]
Rollup merge of #74344 - estebank:stringly-wobbly, r=eddyb

Remove string comparison and use diagnostic item instead

r? @eddyb

4 years agoRollup merge of #74337 - estebank:ty-parse-recovery, r=varkor
Manish Goregaokar [Wed, 15 Jul 2020 18:01:26 +0000 (11:01 -0700)]
Rollup merge of #74337 - estebank:ty-parse-recovery, r=varkor

Handle case of incomplete local ty more gracefully

When encountering a local binding with a type that isn't completed, the
parser will reach a `=` token. When this happen, consider the type
"complete" as far as the parser is concerned to avoid further errors
being emitted by parse recovery logic.

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 agoAdd a 1.45 release note on lto vs. embed-bitcode
Josh Stone [Wed, 15 Jul 2020 17:27:51 +0000 (10:27 -0700)]
Add a 1.45 release note on lto vs. embed-bitcode

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

4 years agoInitialize default providers only once
Joshua Nelson [Wed, 15 Jul 2020 00:23:35 +0000 (20:23 -0400)]
Initialize default providers only once

This avoids copying a new `Providers` struct for each downstream crate
that wants to use it.

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 agoEdit docs for rustc_middle::dep_graph::dep_node
pierwill [Wed, 15 Jul 2020 05:34:25 +0000 (22:34 -0700)]
Edit docs for rustc_middle::dep_graph::dep_node

Fixes some missing punctuation, and adds a blank line
for a more concise summary.

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 agoHandle case of incomplete local ty more gracefully
Esteban Küber [Tue, 14 Jul 2020 17:35:59 +0000 (10:35 -0700)]
Handle case of incomplete local ty more gracefully

When encountering a local binding with a type that isn't completed, the
parser will reach a `=` token. When this happen, consider the type
"complete" as far as the parser is concerned to avoid further errors
being emitted by parse recovery logic.

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 string comparison and use diagnostic item instead
Esteban Küber [Tue, 14 Jul 2020 23:08:02 +0000 (16:08 -0700)]
Remove string comparison and use diagnostic item instead

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