Commit Graph

102742 Commits

Author SHA1 Message Date
Esteban Küber
d7efa5bd6a review comments 2019-11-16 17:10:13 -08:00
Esteban Küber
0487f0c0c3 Suggest calling async closure when needed
When using an async closure as a value in a place that expects a future,
suggest calling the closure.

Fix #65923.
2019-11-16 16:24:00 -08:00
Esteban Küber
2fe8371268 review comments and fix rebase 2019-11-16 16:12:22 -08:00
bors
2cdc289cb8 Auto merge of #66394 - wesleywiser:fix_oom, r=oli-obk
Fix two OOM issues related to `ConstProp`

Fixes #66342
Fixes #66397

r? @oli-obk
2019-11-16 22:54:33 +00:00
Alex Macleod
cfe94b421b Add test for issue 63116 2019-11-16 22:32:59 +00:00
Vadim Petrochenkov
28aec1beaa Add some more tests 2019-11-17 01:11:35 +03:00
Vadim Petrochenkov
11580ced40 Address review comments 2019-11-17 01:11:28 +03:00
Esteban Küber
7a2f3ee73f Account for rustc_on_unimplemented 2019-11-16 13:23:19 -08:00
Esteban Küber
0f7f2346a6 Remove unnecessary note 2019-11-16 13:23:19 -08:00
Esteban Küber
970503b2e1 Modify primary label message to be inline with error message 2019-11-16 13:23:19 -08:00
Esteban Küber
f57413b717 Suggest borrowing when it would satisfy an unmet trait bound
When there are multiple implementors for the same trait that is present
in an unmet binding, modify the E0277 error to refer to the parent
obligation and verify whether borrowing the argument being passed in
would satisfy the unmet bound. If it would, suggest it.
2019-11-16 13:23:19 -08:00
Esteban Küber
405a3dd91c Tweak code formatting 2019-11-16 13:23:19 -08:00
Adam Schwalm
3407c49c41 Clarify transmute_copy documentation example 2019-11-16 14:47:33 -06:00
Mahmoud Al-Qudsi
a36c3f6f68 Revise the text of vec::split_off() per review in #65739
Remove the incorrect usage of "copy" as the trait is not called.
2019-11-16 14:15:07 -06:00
Mahmoud Al-Qudsi
8c7530ade8 Improve documentation of Vec::split_off(...)
The previous ordering of the sentences kept switching between the return
value and the value of `self` after execution, making it hard to follow.

Additionally, as rendered in the browser, the period in "`Self`. `self`"
was difficult to make out as being a sentence separator and not one code
block.
2019-11-16 14:15:07 -06:00
bors
5c5b8afd80 Auto merge of #64694 - petrochenkov:reshelp, r=matthewjasper
Fully integrate derive helpers into name resolution

```rust
#[derive(Foo)]
#[foo_helper] // already goes through name resolution
struct S {
    #[foo_helper] // goes through name resolution after this PR
    field: u8
}
```
How name resolution normally works:
- We have an identifier we need to resolve, take its location (in some sense) and look what names are in scope in that location.

How derive helper attributes are "resolved" (before this PR):
- After resolving the derive `Foo` we visit the derive's input (`struct S { ... } `) as a piece of AST and mark attributes textually matching one of the derive's helper attributes (`foo_helper`) as "known", so they never go through name resolution.

This PR changes the rules for derive helpers, so they are not proactively marked as known (which is a big hack ignoring any ambiguities or hygiene), but go through regular name resolution instead.
This change was previously blocked by attributes not being resolved in some positions at all (fixed in https://github.com/rust-lang/rust/pull/63468).

"Where exactly are derive helpers in scope?" is an interesting question, and I need some feedback from proc macro authors to answer it, see the post below (https://github.com/rust-lang/rust/pull/64694#issuecomment-533925160).
2019-11-16 19:50:48 +00:00
Vadim Petrochenkov
a699f17483 parse: Use string literal parsing in the asm macro 2019-11-16 21:21:37 +03:00
Vadim Petrochenkov
b85a3da421 parse: Support parsing optional literals
Revert weird renaming of the former `LitError::report`
2019-11-16 21:21:37 +03:00
Vadim Petrochenkov
00bc449602 ast: Keep string literals in ABIs precisely 2019-11-16 21:21:37 +03:00
Vadim Petrochenkov
266f547127 ast: Keep extern qualifiers in functions more precisely 2019-11-16 21:21:37 +03:00
Wesley Wiser
2dea8af20c Only run tests on x86_64 2019-11-16 13:01:12 -05:00
clemencetbk
dc137dd868 Update ui tests 2019-11-16 12:05:26 -05:00
clemencetbk
4e1eeb9a45 Add explanation message for E0641 2019-11-16 12:04:17 -05:00
Nadrieril
5b420a9dc4 Add regression test for issue 53820 2019-11-16 16:43:55 +00:00
Nadrieril
d93c1b320c Introduce new FixedLenSlice constructor
It is used in the case where a variable-length slice pattern is used to
match on an array of known size. This allows considering only those
entries in the array that are captured by one of the patterns.
As a side-effect, diagnostics improve a bit for those cases.
2019-11-16 16:43:20 +00:00
Nadrieril
c00ecfa8d2 Add some tests 2019-11-16 16:18:46 +00:00
Vadim Petrochenkov
8575743793 rustc_plugin: Remove Registry::register_attribute 2019-11-16 18:50:23 +03:00
Vadim Petrochenkov
8668c1a190 Add some more tests 2019-11-16 18:31:55 +03:00
Vadim Petrochenkov
808522894b expand: Stop marking derive helper attributes as known
Pass them through name resolution instead
2019-11-16 18:31:47 +03:00
Vadim Petrochenkov
a3126a5013 resolve: Introduce a new scope for derive helpers 2019-11-16 18:20:57 +03:00
Vadim Petrochenkov
c064630e77 resolve: Scope::DeriveHelpers -> Scope::DeriveHelpersCompat
These helpers are resolved before their respective derives through a kind of look ahead into future expansions.
Some of these will migrate to proper resolution, others will be deprecated.

```
#[trait_helper] // Deprecate
#[derive(Trait)]
#[trait_helper] // Migrate to proper resolution
```
2019-11-16 18:20:39 +03:00
Ralf Jung
5e115a25ca avoid some casts 2019-11-16 16:09:45 +01:00
bors
5f00849dc4 Auto merge of #66333 - mark-i-m:fix-rustc-guide-1, r=ehuss
Fix rustc guide again

r? @ehuss

Sorry, links change fast in this world...
2019-11-16 14:27:53 +00:00
Nadrieril
143fb4357f Tweak VarLenSlice subtraction 2019-11-16 13:33:46 +00:00
Ralf Jung
8952c8aa42 ICE on invalid MIR 2019-11-16 14:10:07 +01:00
Ralf Jung
09180d71fd make simd_size return a u64 2019-11-16 13:31:09 +01:00
Ralf Jung
44b68116c5 rename and move read_vector_ty 2019-11-16 13:15:45 +01:00
cosine
bd63c594c2 Use "field is never read" instead of "field is never used" 2019-11-16 07:12:37 -05:00
Ralf Jung
405866aaa3 re-add miri intrinsic ABI check 2019-11-16 11:44:32 +01:00
Ralf Jung
e8ff4656fc avoid linking errors 2019-11-16 09:37:45 +01:00
Ralf Jung
52d7246a93 miri panic_unwind: fix hack for SEH platforms 2019-11-16 09:29:26 +01:00
Magnus Ulimoen
e85f40cbd2 add missing 'static lifetime in docs
The example refers to a static lifetime parameter that can be elided.
This parameter is not included, meaning lifetime elision is not shown.
2019-11-16 08:40:35 +01:00
bors
9b0214d9c5 Auto merge of #66255 - ehuss:update-cc, r=alexcrichton
Update cc, git2, num_cpus.

This updates the `cc` crate, bringing in better parallel building support. Also updates `git2` which enables the parallel feature. (Note: I don't expect it will have a significant impact on build time, but seems good to update anyways.)

The main thorn is that `cc` gained knowledge about RISC-V architectures (https://github.com/alexcrichton/cc-rs/pull/428, https://github.com/alexcrichton/cc-rs/pull/429, https://github.com/alexcrichton/cc-rs/pull/430), but the builders on CI do not have the riscv C compiler installed. This means that bootstraps' cc detection was finding a C compiler that isn't installed, and fails.

The solution here is to override the cc detection to `false`. The C compiler isn't actually used on riscv platforms. AFAIK, the only location would be compiler_builtins, and it currently forces C support off (a533ae9c5a/build.rs (L49-L55)).

Other possible solutions:
- Add the override in cc_detect for riscv (or any "no-C" platform like wasm32 and nvptx)
- Install and use the appropriate c compiler. I tried this the `g++-riscv64-linux-gnu` package, but it failed missing some header file.

Closes #66232
2019-11-16 07:26:57 +00:00
bors
1d8b6ce89e Auto merge of #66453 - Centril:rollup-w1ohzxs, r=Centril
Rollup of 5 pull requests

Successful merges:

 - #66350 (protect creation of destructors by a mutex)
 - #66407 (Add more tests for fixed ICEs)
 - #66415 (Add --force-run-in-process unstable option to libtest)
 - #66427 (Move the JSON error emitter to librustc_errors)
 - #66441 (libpanic_unwind for Miri: make sure we have the SEH lang items when needed)

Failed merges:

r? @ghost
2019-11-16 02:40:52 +00:00
Mazdak Farrokhzad
8444e1628c move DIAGNOSTICS usage to rustc_driver 2019-11-16 02:32:33 +01:00
bors
82161cda33 Auto merge of #66326 - Nadrieril:refactor-intrange, r=varkor
Refactor integer range handling in the usefulness algorithm

Integer range handling had accumulated a lot of debt. This cleans up a lot of it.

In particular this:
- removes unnecessary conversions between `Const` and `u128`, and between `Constructor` and `IntRange`
- clearly distinguishes between on the one hand ranges of integers that may or may not be matched exhaustively, and on the other hand ranges of non-integers that are never matched exhaustively and are compared using Const-based shenanigans
- cleans up some overly complicated code paths
- generally tries to be more idiomatic.

As a nice side-effect, I measured a 10% perf increase on `unicode_normalization`.

There's one thing that I feel remains to clean up: the [overlapping range check](https://github.com/rust-lang/rust/pull/64007), which is currently quite ad-hoc. But that is intricate enough that I'm leaving it out of this PR.

There's also one little thing I'm not sure I understand: can `try_eval_bits` fail for an integer constant value in that code ? What would that mean, and how do I construct a test case for this possibility ?
2019-11-15 23:28:50 +00:00
Wesley Wiser
9e1b210c6a Respond to review feedback 2019-11-15 18:18:50 -05:00
Wesley Wiser
3732b7acf1 [ConstProp] Avoid OOM crashes by not evaluating large Places
Fixes #66397
2019-11-15 18:18:50 -05:00
Wesley Wiser
d389f64cdb Fix spurious CI filures due to OOM
Fixes #66342
2019-11-15 18:18:50 -05:00
Eduard-Mihai Burtescu
d137e8e4a5 Update src/llvm-project to include rust-lang/llvm-project#27. 2019-11-15 22:56:40 +02:00