]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoMake spotlight show on hover
Manish Goregaokar [Tue, 7 Jul 2020 00:18:04 +0000 (17:18 -0700)]
Make spotlight show on hover

This makes the spotlight show on hover instead of click. Clicks can be
used to persist it, which is also what's used on mobile.

3 years agoMove spotlight next to the return type
Manish Goregaokar [Mon, 6 Jul 2020 21:13:47 +0000 (14:13 -0700)]
Move spotlight next to the return type

3 years agoRevert "Remove spotlight usage"
Manish Goregaokar [Mon, 6 Jul 2020 19:54:33 +0000 (12:54 -0700)]
Revert "Remove spotlight usage"

This reverts commit 13c6d5819aae3c0de6a90e7f17ea967bf4487cbb.

3 years agoRevert "Remove "important traits" feature"
Manish Goregaokar [Mon, 6 Jul 2020 19:53:44 +0000 (12:53 -0700)]
Revert "Remove "important traits" feature"

This reverts commit 1244ced9580b942926afc06815e0691cf3f4a846.

3 years agoAuto merge of #72481 - marmeladema:duration-consts-2, r=oli-obk
bors [Thu, 16 Jul 2020 13:35:09 +0000 (13:35 +0000)]
Auto merge of #72481 - marmeladema:duration-consts-2, r=oli-obk

Constify most non-trait `Duration` methods as described in #72440

The remaining methods could probably be made const once https://github.com/rust-lang/rust/pull/72449 lands with support for `f<32|64>::is_finite()`.

3 years agoAuto merge of #74202 - oli-obk:mir_const, r=RalfJung
bors [Thu, 16 Jul 2020 10:18:24 +0000 (10:18 +0000)]
Auto merge of #74202 - oli-obk:mir_const, r=RalfJung

Reduce the amount of interning and `layout_of` calls in const eval.

r? @ghost

If we just want to get at some bits of a constant, we don't need to intern it before extracting those bits.
Also, if we want to read a `usize` or `bool`, we can fetch the size without invoking a query.

3 years agoGroup the try_eval functions before the eval functions
Oliver Scherer [Mon, 13 Jul 2020 17:07:37 +0000 (19:07 +0200)]
Group the try_eval functions before the eval functions

3 years agoMake `try_eval` private
Oliver Scherer [Mon, 13 Jul 2020 17:06:19 +0000 (19:06 +0200)]
Make `try_eval` private

3 years agoMove `ty::Const` and `ty::ConstKind` into their own modules
Oliver Scherer [Sat, 11 Jul 2020 07:49:22 +0000 (09:49 +0200)]
Move `ty::Const` and `ty::ConstKind` into their own modules

3 years agoAuto merge of #74388 - Manishearth:rollup-i7iueu8, r=Manishearth
bors [Thu, 16 Jul 2020 07:01:59 +0000 (07:01 +0000)]
Auto merge of #74388 - Manishearth:rollup-i7iueu8, r=Manishearth

Rollup of 7 pull requests

Successful merges:

 - #73421 (Clarify effect of orphan rule changes on From/Into)
 - #74037 (Update reference to CONTRIBUTING.md)
 - #74203 (Enforce the static symbol order.)
 - #74295 (Add and fix BTreeMap comments)
 - #74352 (Use local links in the alloc docs.)
 - #74377 (Move libstd's default feature to libtest)
 - #74381 (Update docs for str::as_bytes_mut.)

Failed merges:

r? @ghost

3 years agoRollup merge of #74381 - mbrubeck:docs, r=Mark-Simulacrum
Manish Goregaokar [Thu, 16 Jul 2020 07:01:13 +0000 (00:01 -0700)]
Rollup merge of #74381 - mbrubeck:docs, r=Mark-Simulacrum

Update docs for str::as_bytes_mut.

* Add "Safety" section describing UTF-8 invariant.

* Remove mention of `from_utf8_mut`.  It is not necessary to call
  a function to convert the byte slice back to a string slice.  The
  original string becomes accessible again after the byte slice is
  no longer used (as shown in the example code).

3 years agoRollup merge of #74377 - alexcrichton:test-default, r=Mark-Simulacrum
Manish Goregaokar [Thu, 16 Jul 2020 07:01:11 +0000 (00:01 -0700)]
Rollup merge of #74377 - alexcrichton:test-default, r=Mark-Simulacrum

Move libstd's default feature to libtest

This commit makes it so `std` no longer has a `default` feature, but
instead the `test` crate has a `default` feature doing the same thing.
The purpose of this commit is to allow Cargo's `-Zbuild-std` command,
which could customize the features of the standard library, to handle
the `default` feature for libstd. Currently Cargo's `-Zbuild-std`
support starts at libtests's manifest as the entry point to the std set
of crates.

3 years agoRollup merge of #74352 - ehuss:fix-alloc-links, r=Mark-Simulacrum
Manish Goregaokar [Thu, 16 Jul 2020 07:01:09 +0000 (00:01 -0700)]
Rollup merge of #74352 - ehuss:fix-alloc-links, r=Mark-Simulacrum

Use local links in the alloc docs.

Links to other crates (like core) from the alloc crate were incorrectly using the `https://doc.rust-lang.org/nightly/` absolute (remote) links, instead of relative (local) links.  For example, the link to `Result` at https://doc.rust-lang.org/1.44.1/alloc/vec/struct.Vec.html#method.try_reserve goes to /nightly/.

This is because alloc was being documented before core, and rustdoc relies on the existence of the local directory to know if it should use a local or remote link.

There was code that tried to compensate for this (`create_dir_all`), but in #54543 it was broken because instead of running `cargo doc` once for all the crates, it was changed to run `cargo rustdoc` for each crate individually. This means that `create_dir_all` was no longer doing what it was supposed to be doing (creating all the directories before starting).

The solution here is to just build in the correct order (from the dependency leaves towards the root).  An alternate solution would be to switch back to running `cargo doc` once (and use RUSTDOCFLAGS for passing in flags).  Another alternate solution would be to iterate over the list twice, creating the directories during the first pass.

I also did a little cleanup to remove the "crate-docs" directory. This was added in the past because different crates were built in different directories. Over time, things have been unified (and rustc docs no longer include std), so it is no longer necessary.

3 years agoRollup merge of #74295 - ssomers:btree_comments, r=Mark-Simulacrum
Manish Goregaokar [Thu, 16 Jul 2020 07:01:07 +0000 (00:01 -0700)]
Rollup merge of #74295 - ssomers:btree_comments, r=Mark-Simulacrum

Add and fix BTreeMap comments

No code changed (yet)

3 years agoRollup merge of #74203 - nnethercote:enforce-static-symbol-order, r=petrochenkov
Manish Goregaokar [Thu, 16 Jul 2020 07:01:05 +0000 (00:01 -0700)]
Rollup merge of #74203 - nnethercote:enforce-static-symbol-order, r=petrochenkov

Enforce the static symbol order.

By making the proc macro abort if any symbols are out of order.

The commit also changes the proc macro collect multiple errors (of order
or duplicated symbols) and prints them at the end, which is useful if
you have multiple errors.

r? @petrochenkov

3 years agoRollup merge of #74037 - JohnTitor:contributing-md, r=Mark-Simulacrum
Manish Goregaokar [Thu, 16 Jul 2020 07:01:04 +0000 (00:01 -0700)]
Rollup merge of #74037 - JohnTitor:contributing-md, r=Mark-Simulacrum

Update reference to CONTRIBUTING.md

CONTRIBUTING.md has been migrated to the rustc-dev-guide but some still refer there.
Update them with the appropriate links.

Fixes #74253

3 years agoRollup merge of #73421 - janikrabe:master, r=joshtriplett
Manish Goregaokar [Thu, 16 Jul 2020 07:01:02 +0000 (00:01 -0700)]
Rollup merge of #73421 - janikrabe:master, r=joshtriplett

Clarify effect of orphan rule changes on From/Into

Updated documentation for `std::convert` and `std::convert::From` to reflect changes to orphan rule in Rust 1.41. It should no longer be necessary to implement `Into` directly, unless targeting an older version.

r? @steveklabnik

3 years agoRename `sym::item_context` as `sym::ItemContext`.
Nicholas Nethercote [Fri, 10 Jul 2020 00:14:55 +0000 (10:14 +1000)]
Rename `sym::item_context` as `sym::ItemContext`.

Because it represents the symbol `ItemContext`, and `sym` identifiers
are supposed to match the actual symbol whenever possible.

3 years agoEnforce the static symbol order.
Nicholas Nethercote [Thu, 9 Jul 2020 23:46:38 +0000 (09:46 +1000)]
Enforce the static symbol order.

By making the proc macro abort if any symbols are out of order.

The commit also changes the proc macro collect multiple errors (of order
or duplicated symbols) and prints them at the end, which is useful if
you have multiple errors.

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

3 years agoUpdate docs for str::as_bytes_mut.
Matt Brubeck [Wed, 15 Jul 2020 20:21:02 +0000 (13:21 -0700)]
Update docs for str::as_bytes_mut.

* Add "Safety" section describing UTF-8 invariant.

* Remove mention of `from_utf8_mut`.  It is not necessary to call
  a function to convert the byte slice back to a string slice.  The
  original string becomes accessible again after the byte slice is
  no longer used (as shown in the example code).

3 years agoConstify most non-trait `Duration` methods as described in #72440
marmeladema [Thu, 21 May 2020 19:22:47 +0000 (20:22 +0100)]
Constify most non-trait `Duration` methods as described in #72440

3 years agoClarify effect of orphan rule changes on From/Into
Janik Rabe [Tue, 16 Jun 2020 13:14:16 +0000 (16:14 +0300)]
Clarify effect of orphan rule changes on From/Into

Updated documentation for `std::convert` and `std::convert::From` to
reflect changes to orphan rule in Rust 1.41. It should no longer be
necessary to implement Into directly, unless targeting an older version.

3 years agoMove libstd's default feature to libtest
Alex Crichton [Wed, 15 Jul 2020 18:31:48 +0000 (11:31 -0700)]
Move libstd's default feature to libtest

This commit makes it so `std` no longer has a `default` feature, but
instead the `test` crate has a `default` feature doing the same thing.
The purpose of this commit is to allow Cargo's `-Zbuild-std` command,
which could customize the features of the standard library, to handle
the `default` feature for libstd. Currently Cargo's `-Zbuild-std`
support starts at libtests's manifest as the entry point to the std set
of crates.

3 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

3 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.

3 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

3 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

3 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.

3 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).

3 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

3 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`.

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 years agos/try_to_usize/try_to_machine_usize/
Oliver Scherer [Sat, 11 Jul 2020 07:28:10 +0000 (09:28 +0200)]
s/try_to_usize/try_to_machine_usize/

3 years agoReduce the amount of interning and `layout_of` calls in const eval.
Oliver Scherer [Thu, 9 Jul 2020 22:24:48 +0000 (00:24 +0200)]
Reduce the amount of interning and `layout_of` calls in const eval.

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

3 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.

3 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

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

3 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

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

3 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

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

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

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

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

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

3 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

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

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

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

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

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

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

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

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

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

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

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

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

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

3 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`

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

3 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

3 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`.

3 years agoUse local links in the alloc docs.
Eric Huss [Wed, 15 Jul 2020 04:18:41 +0000 (21:18 -0700)]
Use local links in the alloc docs.

3 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.

3 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.

3 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.

3 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.

3 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.

3 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

3 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

3 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`.

3 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.

3 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.

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

3 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

3 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.

3 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.

3 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

3 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)

3 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

3 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.

3 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.

3 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.

3 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

3 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

3 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

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

3 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

3 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>
3 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

3 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