121130 Commits

Author SHA1 Message Date
Dylan DPC
b6a5fea2ce
Rollup merge of #72832 - joshtriplett:cargo-tree-d, r=Mark-Simulacrum
RELEASES.md: Expand `cargo tree` note to mention `cargo tree -d`

Useful feature that people might not automatically associate with `cargo
tree`.
2020-06-01 03:14:14 +02:00
Dylan DPC
cf4683665f
Rollup merge of #72823 - matthewjasper:describe-queries, r=eddyb
Add descriptions for all queries

This also removes the default description for queries with DefId keys and makes the macro validate that a description is provided.

cc  #72730
r? @eddyb
2020-06-01 03:14:12 +02:00
Dylan DPC
2e3417a82d
Rollup merge of #72818 - GuillaumeGomez:cleanup-e0622, r=Dylan-DPC
Clean up E0622 explanation

r? @Dylan-DPC
2020-06-01 03:14:10 +02:00
Dylan DPC
fa2943975a
Rollup merge of #72776 - lcnr:stalled_on-smallvec, r=nnethercote
fulfill: try using SmallVec or Box for stalled_on

Tested both `Box` and `SmallVec` for `stalled_on`, with both resulting in a perf loss.
Adds a comment mentioning this and removes an now outdated FIXME.

Logging the length of `stalled_on` resulted in the following distribution while building a part of stage 1 libs:
```
22627647 counts:
(  1) 20983696 (92.7%, 92.7%): process_obligation_len: 1
(  2)   959711 ( 4.2%, 97.0%): process_obligation_len: 2
(  3)   682326 ( 3.0%,100.0%): process_obligation_len: 0
(  4)     1914 ( 0.0%,100.0%): process_obligation_len: 3
```
cc @eddyb
r? @nnethercote
2020-06-01 03:14:05 +02:00
bors
0d93d3f4a4 Auto merge of #72831 - Dylan-DPC:rollup-6rxjwt9, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #72691 (Fix escape key handling)
 - #72807 (Avoid setting wrong obligation cause span of associated type mismatch)
 - #72812 (Miri tests: skip parts of test_char_range)
 - #72829 (Clarify terms in doc comments)
 - #72830 (Fix release notes for niche initialization change)

Failed merges:

r? @ghost
2020-05-31 20:58:56 +00:00
Josh Triplett
32736606fd RELEASES.md: Expand cargo tree note to mention cargo tree -d
Useful feature that people might not automatically associate with `cargo
tree`.
2020-05-31 12:39:28 -07:00
Dylan DPC
76e0ecca2b
Rollup merge of #72830 - rust-lang:sfackler-patch-1, r=Mark-Simulacrum
Fix release notes for niche initialization change

MaybeUninit is not affected by the linked PR.
2020-05-31 21:30:06 +02:00
Dylan DPC
2d4ed2aedd
Rollup merge of #72829 - JOE1994:clarify_terms, r=jonas-schievink
Clarify terms in doc comments

Doc comments of `copy_from_slice` say that people should use `clone_from_slice`
when 'src' doesn't implement `Copy`. However, 'src' is a reference and
it always implements `Copy`. The term 'src' should be fixed to `T`(element type of slice 'src') in
the doc comments.

Thank you for reviewing this PR :)  😺
2020-05-31 21:30:05 +02:00
Dylan DPC
5480120b26
Rollup merge of #72812 - RalfJung:miri-char-test, r=jonas-schievink
Miri tests: skip parts of test_char_range

The new `test_char_range` test takes forever in Miri as it loops over all values of `char`. This makes it skip most of them when being run in Miri.
2020-05-31 21:30:03 +02:00
Dylan DPC
8e83a7e126
Rollup merge of #72807 - xiaotianrandom:fix-assoc-type-diagnostics, r=estebank
Avoid setting wrong obligation cause span of associated type mismatch

Removes code that sets wrong obligation cause span of associated type mismatch. See the linked issue for details.

Closes #72806.
2020-05-31 21:30:01 +02:00
Dylan DPC
6cd9a67314
Rollup merge of #72691 - GuillaumeGomez:escape-key-handling, r=kinnison
Fix escape key handling

Fixes #72647.

The problem was that you could have a timeout just after the moment you press "escape", putting back the results.

r? @kinnison
2020-05-31 21:30:00 +02:00
Matthew Jasper
8894bd220b Add descriptions for all queries 2020-05-31 20:15:32 +01:00
Steven Fackler
0a71ba2243
Fix release notes for niche initialization change
MaybeUninit is not affected by the linked PR.
2020-05-31 14:51:08 -04:00
JOE1994
dd0338fbac Clarify terms in doc comments
Doc comments of 'copy_from_slice' say that people should use 'clone_from_slice'
when 'src' doesn't implement 'Copy'. However, 'src' is a reference and
it always implements 'Copy'. The term 'src' should be fixed to 'T' in
the doc comments.

Thank you for reviewing this PR :)
2020-05-31 14:37:26 -04:00
bors
5fd2f06e99 Auto merge of #72767 - pnkfelix:track-devirtualized-filenames-issue-70924, r=eddyb
Track devirtualized filenames

Split payload of FileName::Real to track both real and virtualized paths.

(Such splits arise from metadata refs into libstd; the virtualized paths look like `/rustc/1.45.0/src/libstd/io/cursor.rs` rather than `/Users/felixklock/Dev/Mozilla/rust.git/src/libstd/io/cursor.rs`)

This way, we can emit the virtual name into things like the like the StableSourceFileId (as was done back before PR #70642) that ends up in incremental build artifacts, while still using the devirtualized file path when we want to access the file.

Fix #70924
2020-05-31 17:14:44 +00:00
bors
f6072cab13 Auto merge of #72813 - RalfJung:rollup-4ko6q8j, r=RalfJung
Rollup of 5 pull requests

Successful merges:

 - #72683 (from_u32_unchecked: check validity, and fix UB in Wtf8)
 - #72715 (Account for trailing comma when suggesting `where` clauses)
 - #72745 (generalize Borrow<[T]> for Interned<'tcx, List<T>>)
 - #72749 (Update stdarch submodule to latest head)
 - #72781 (Use `LocalDefId` instead of `NodeId` in `resolve_str_path_error`)

Failed merges:

r? @ghost
2020-05-31 13:39:05 +00:00
Guillaume Gomez
7a2efa3a10 Put input timeout clearance inside a function 2020-05-31 14:27:33 +02:00
Guillaume Gomez
1fbc037da6 Clean up E0622 explanation 2020-05-31 14:09:15 +02:00
Ralf Jung
532dabdb8e Miri tests: skip parts of test_char_range 2020-05-31 12:12:45 +02:00
Ralf Jung
cbc73dc263
Rollup merge of #72781 - marmeladema:rustdoc-def-id-resolve-str-path-error, r=petrochenkov
Use `LocalDefId` instead of `NodeId` in `resolve_str_path_error`

Together with https://github.com/rust-lang/rust/pull/72777 this should remove all uses of `NodeId` in `rustdoc`.

cc #50928

r? @petrochenkov
2020-05-31 12:03:30 +02:00
Ralf Jung
e16bd0206b
Rollup merge of #72749 - vertexclique:vcq/update-stdarch, r=Amanieu
Update stdarch submodule to latest head

Includes avx512 work & aarch64 tme.
2020-05-31 12:03:28 +02:00
Ralf Jung
e0b25905af
Rollup merge of #72745 - lcnr:interned-cleanup, r=petrochenkov
generalize Borrow<[T]> for Interned<'tcx, List<T>>
2020-05-31 12:03:26 +02:00
Ralf Jung
b714f5c9ac
Rollup merge of #72715 - estebank:trailing-comma-where, r=petrochenkov
Account for trailing comma when suggesting `where` clauses

Fix #72693.
2020-05-31 12:03:24 +02:00
Ralf Jung
3bbb475f00
Rollup merge of #72683 - RalfJung:char-debug-check, r=Mark-Simulacrum
from_u32_unchecked: check validity, and fix UB in Wtf8

Fixes https://github.com/rust-lang/rust/issues/72760
2020-05-31 12:03:22 +02:00
bors
4b1f86adbe Auto merge of #72759 - alexcrichton:update-compiler-builtins, r=Mark-Simulacrum
Update compiler-builtins

Pulls in a fix for #72758, more details on the linked issue.

[Crate changes included here][changes]

[changes]: https://github.com/rust-lang/compiler-builtins/compare/0.1.28...0.1.31

Closes #72758
2020-05-31 09:54:44 +00:00
Bastian Kauschke
0441763694 remove fixme for stalled_on 2020-05-31 10:01:45 +02:00
bors
b6fa392238 Auto merge of #72743 - lcnr:predicate_f, r=nikomatsakis
fix EncodeWithShorthand for Predicate

r? @nikomatsakis
2020-05-31 04:44:38 +00:00
XIAO Tian
1a68c8e8d9 Fix associate type diagnostics 2020-05-31 12:13:30 +08:00
XIAO Tian
3bf9eb0f7a Add a test for wrong assoc type diagnostics 2020-05-31 12:13:30 +08:00
bors
ea7181b5f7 Auto merge of #72116 - petrhosek:fuchsia-ld-flags, r=tmandry
Update the Fuchsia linker defaults

This updates the linker defaults aligning them with Clang. Specifically,
we use 4K pages on all platforms, we always use BIND_NOW, we prefer all
loadable segments be separate and page aligned, and we support RELR
relocations.
2020-05-31 01:07:37 +00:00
Mahmut Bulut
15201af7ed Update stdarch submodule to latest head 2020-05-31 00:12:59 +02:00
bors
8c5402efdd Auto merge of #72794 - RalfJung:rollup-gzs4nl4, r=RalfJung
Rollup of 13 pull requests

Successful merges:

 - #72543 (Account for missing lifetime in opaque and trait object return types)
 - #72625 (Improve inline asm error diagnostics)
 - #72637 (expand `env!` with def-site context)
 - #72650 (Sort sidebar elements)
 - #72657 (Allow types (with lifetimes/generics) in impl_lint_pass)
 - #72666 (Add -Z profile-emit=<path> for Gcov gcda output.)
 - #72668 (Fix missing parentheses Fn notation error)
 - #72669 (rustc_session: Cleanup session creation)
 - #72728 (Make bootstrap aware of relative libdir in stage0 compiler)
 - #72757 (rustc_lexer: Optimize shebang detection slightly)
 - #72772 (miri validation: clarify valid values of 'char')
 - #72773 (Fix is_char_boundary documentation)
 - #72777 (rustdoc: remove calls to `local_def_id_from_node_id`)

Failed merges:

r? @ghost
2020-05-30 21:23:19 +00:00
Ralf Jung
581eafcdf7
Rollup merge of #72777 - marmeladema:rustdoc-remove-local-def-id-from-node-id, r=petrochenkov
rustdoc: remove calls to `local_def_id_from_node_id`

rustdoc calls `local_def_id_from_node_id(CRATE_NODE_ID)` when it can just creates a top level `DefId` using `DefId::local(CRATE_DEF_INDEX)`.

cc #50928

r? @petrochenkov
2020-05-30 23:09:04 +02:00
Ralf Jung
b7f6a0b322
Rollup merge of #72773 - Rantanen:is_char_boundary-docs, r=joshtriplett
Fix is_char_boundary documentation

Given the "start _and/or end_" wording in the original, the way I understood it was that the `str::is_char_boundary` method would also return `true` for the last byte in a UTF-8 code point sequence. (Which would have meant that for a string consisting of nothing but 1 and 2 byte UTF-8 code point sequences, it would return nothing but `true`.)

In practice the method returns `true` only for the starting byte of each sequence and the end of the string: [Playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=e9f5fc4d6bf2f1bf57a75f3c9a180770)

I was also somewhat tempted to remove the _The start and end of the string are considered to be boundaries_, since that's implied by the first sentence, but I decided to avoid bikeshedding over it and left it as it was since it's not wrong in relation to how the method behaves.
2020-05-30 23:09:02 +02:00
Ralf Jung
356d1e9f4f
Rollup merge of #72772 - RalfJung:valid-char, r=petrochenkov
miri validation: clarify valid values of 'char'

The old text said "expected a valid unicode codepoint", which is not actually correct -- it has to be a scalar value (which is a code point that is not part of a surrogate pair).
2020-05-30 23:09:00 +02:00
Ralf Jung
32481bc80a
Rollup merge of #72757 - petrochenkov:shebang, r=varkor
rustc_lexer: Optimize shebang detection slightly

Sorry, I just couldn't resist.
It shouldn't make any difference in practice.

Also, documented a previously unnoticed case with doc comments treated as regular comments during shebang detection.
2020-05-30 23:08:58 +02:00
Ralf Jung
8f1c0d0a10
Rollup merge of #72728 - o01eg:fix-72661, r=Mark-Simulacrum
Make bootstrap aware of relative libdir in stage0 compiler

Follows up #72692

Fixes #72661
2020-05-30 23:08:57 +02:00
Ralf Jung
278e26eaf6
Rollup merge of #72669 - petrochenkov:smclean, r=Mark-Simulacrum
rustc_session: Cleanup session creation

Noticed while reviewing https://github.com/rust-lang/rust/pull/72618.
2020-05-30 23:08:55 +02:00
Ralf Jung
65a02f1841
Rollup merge of #72668 - awoimbee:give-fn-parenthetical-notation-parentheses, r=estebank
Fix missing parentheses Fn notation error

Fixes  #72611
Well, fixes the error output, I think E0658 is the right error to throw in this case so I didn't change that
2020-05-30 23:08:53 +02:00
Ralf Jung
ffe329250b
Rollup merge of #72666 - ivanloz:profile_emit_flag, r=matthewjasper
Add -Z profile-emit=<path> for Gcov gcda output.

Adds a -Z flag to control the file path that the Gcov gcda output is
written to during runtime. This flag expects a path and filename, e.g.
-Z profile-emit=gcov/out/lib.gcda.

This works similar to GCC/Clang's -fprofile-dir flag which allows
control over the output path for gcda coverage files.
2020-05-30 23:08:51 +02:00
Ralf Jung
320de71cdd
Rollup merge of #72657 - flip1995:impl_lint_pass-ty, r=matthewjasper
Allow types (with lifetimes/generics) in impl_lint_pass

cc https://github.com/rust-lang/rust-clippy/pull/5279#discussion_r430790267

This allows to implement `LintPass` for types with lifetimes and/or generics. The only thing, I'm not sure of is the `LintPass::name` function, which now includes the lifetime(s) (which will be `'_` most of the time) in the name returned for the lint pass, if it exists. But I don't think that this should be a problem, since the `LintPass::name` is never used for output for the user (?).
2020-05-30 23:08:49 +02:00
Ralf Jung
5f0aefda49
Rollup merge of #72650 - GuillaumeGomez:sort-sidebar-elements, r=kinnison
Sort sidebar elements

r? @kinnison
2020-05-30 23:08:47 +02:00
Ralf Jung
40fb1913e7
Rollup merge of #72637 - euclio:env-hygiene, r=davidtwco
expand `env!` with def-site context

Similar to #66349.

Fixes rust-lang/rust-clippy#5619.
2020-05-30 23:08:46 +02:00
Ralf Jung
fadfcb644e
Rollup merge of #72625 - Amanieu:asm-srcloc, r=petrochenkov
Improve inline asm error diagnostics

Previously we were just using the raw LLVM error output (with line, caret, etc) as the diagnostic message, which ends up looking rather out of place with our existing diagnostics.

The new diagnostics properly format the diagnostics and also take advantage of LLVM's per-line `srcloc` attribute to map an error in inline assembly directly to the relevant line of source code.

Incidentally also fixes #71639 by disabling `srcloc` metadata during LTO builds since we don't know what crate it might have come from. We can only resolve `srcloc`s from the currently crate since it indexes into the source map for the current crate.

Fixes #72664
Fixes #71639

r? @petrochenkov

### Old style

```rust
#![feature(llvm_asm)]

fn main() {
    unsafe {
        let _x: i32;
        llvm_asm!(
            "mov $0, $1
             invalid_instruction $0, $1
             mov $0, $1"
             : "=&r" (_x)
             : "r" (0)
             :: "intel"
        );
    }
}
```

```
error: <inline asm>:3:14: error: invalid instruction mnemonic 'invalid_instruction'
             invalid_instruction ecx, eax
             ^~~~~~~~~~~~~~~~~~~

  --> src/main.rs:6:9
   |
6  | /         llvm_asm!(
7  | |             "mov $0, $1
8  | |              invalid_instruction $0, $1
9  | |              mov $0, $1"
...  |
12 | |              :: "intel"
13 | |         );
   | |__________^
```

### New style

```rust
#![feature(asm)]

fn main() {
    unsafe {
        asm!(
            "mov {0}, {1}
             invalid_instruction {0}, {1}
             mov {0}, {1}",
            out(reg) _,
            in(reg) 0i64,
        );
    }
}
```

```
error: invalid instruction mnemonic 'invalid_instruction'
 --> test.rs:7:14
  |
7 |              invalid_instruction {0}, {1}
  |              ^
  |
note: instantiated into assembly here
 --> <inline asm>:3:14
  |
3 |              invalid_instruction rax, rcx
  |              ^^^^^^^^^^^^^^^^^^^
```
2020-05-30 23:08:44 +02:00
Ralf Jung
f1661d23e3
Rollup merge of #72543 - estebank:opaque-missing-lts-in-fn, r=nikomatsakis
Account for missing lifetime in opaque and trait object return types

When encountering an opaque closure return type that needs to bound a
lifetime to the function's arguments, including borrows and type params,
provide appropriate suggestions that lead to working code.

Get the user from

```rust
fn foo<G, T>(g: G, dest: &mut T) -> impl FnOnce()
where
    G: Get<T>
{
    move || {
        *dest = g.get();
    }
}
```

to

```rust
fn foo<'a, G: 'a, T>(g: G, dest: &'a mut T) -> impl FnOnce() +'a
where
    G: Get<T>
{
    move || {
        *dest = g.get();
    }
}
```
2020-05-30 23:08:42 +02:00
Esteban Küber
83f6f22358 Tweak wording and spans of 'static dyn Trait/impl Trait requirements 2020-05-30 10:22:27 -07:00
Esteban Küber
6dcd744df0 Consider all possible one letter lifetimes in suggestion 2020-05-30 10:22:27 -07:00
Esteban Küber
224ad326ea Account for enclosing item when suggesting new lifetime name 2020-05-30 10:22:27 -07:00
Esteban Küber
8f7ee34379 Tweak type parameter errors to reduce verbosity 2020-05-30 10:22:26 -07:00
Esteban Küber
1d9472b470 Update nll tests 2020-05-30 10:22:26 -07:00