Commit Graph

81437 Commits

Author SHA1 Message Date
Mark Rousskov
7c09bab986
Rollup merge of #52674 - tinaun:patch-2, r=cramertj
Impl Executor for Box<E: Executor>

removes the need for the compatibility lib between futures 0.1 and 0.3 to use a wrapper type to implement Executor for Box<Executor>
2018-07-26 09:18:34 -06:00
Mark Rousskov
007177c445
Rollup merge of #52667 - japaric:stdsimd-up, r=alexcrichton
update the stdsimd submodule

to bring in the doc generation fix

r? @alexcrichton
cc @Mark-Simulacrum
2018-07-26 09:18:32 -06:00
Mark Rousskov
9f91195e2a
Rollup merge of #52654 - alecmocatta:master, r=alexcrichton
Format linker args in a way that works for gcc and ld

Pass multiple linker arguments rather than concatenate with commas (fixes #52634).

`-l library` -> `-llibrary` to work with apple's ld.

To build with apple's ld I'm currently also passing `-C link-args="-arch x86_64 -macosx_version_min 10.13.0"`. I'll try and understand the latter flag better before PRing that.

This PR currently works for me. Hopefully CI will pick up any grievous ramifications in other toolchains?

Thanks to @alexcrichton for the pointer to the relevant code!
2018-07-26 09:18:31 -06:00
Mark Rousskov
2aec4e882c
Rollup merge of #52649 - estebank:fmt-span, r=oli-obk
Point spans to inner elements of format strings

- Point at missing positional specifiers in string literal
```
error: invalid reference to positional arguments 3, 4 and 5 (there are 3 arguments)
  --> $DIR/ifmt-bad-arg.rs:34:38
   |
LL |     format!("{name} {value} {} {} {} {} {} {}", 0, name=1, value=2);
   |                                      ^^ ^^ ^^
   |
   = note: positional arguments are zero-based
```

- Point at named formatting specifier in string literal
```
error: there is no argument named `foo`
  --> $DIR/ifmt-bad-arg.rs:37:17
   |
LL |     format!("{} {foo} {} {bar} {}", 1, 2, 3);
   |                 ^^^^^
```

- Update label for formatting string in "multiple unused formatting arguments" to be more correct
```
error: multiple unused formatting arguments
  --> $DIR/ifmt-bad-arg.rs:42:17
   |
LL |     format!("", 1, 2);               //~ ERROR: multiple unused formatting arguments
   |             --  ^  ^
   |             |
   |             multiple missing formatting specifiers
```

- When using `printf` string formatting, provide a structured suggestion instead of a note
```
error: multiple unused formatting arguments
  --> $DIR/format-foreign.rs:12:30
   |
LL |     println!("%.*3$s %s!/n", "Hello,", "World", 4); //~ ERROR multiple unused formatting arguments
   |              --------------  ^^^^^^^^  ^^^^^^^  ^
   |              |
   |              multiple missing formatting specifiers
   |
   = note: printf formatting not supported; see the documentation for `std::fmt`
help: format specifiers in Rust are written using `{}`
   |
LL |     println!("{:.2$} {}!/n", "Hello,", "World", 4); //~ ERROR multiple unused formatting arguments
   |               ^^^^^^ ^^
```
2018-07-26 09:18:30 -06:00
Mark Rousskov
662fb069fd
Rollup merge of #52647 - csmoe:closure_arg_ignore, r=estebank
Suggest to take and ignore args while closure args count mismatching

Closes #52473
2018-07-26 09:18:29 -06:00
Mark Rousskov
c7555cedde
Rollup merge of #52635 - yodaldevoid:issue_18804, r=oli-obk
Fix #[linkage] propagation though generic functions

Fixes #18804

In the non-local branch of `get_static` (where the fix was implemented) `span_fatal` had to be replaced with `bug!` as we have no span in that case.
2018-07-26 09:18:27 -06:00
Mark Rousskov
2aeb76500e
Rollup merge of #52617 - matthewjasper:remove-unused-code, r=nikomatsakis
Don't match on region kinds when reporting NLL errors

First half (by number of tests affected) of the changes to "does not live long enough".

Now that lexical MIR borrowck is gone, region kinds are always ReVar, so matching on them to change errors does nothing.

Changes "borrowed value only lives until here" to "`x` is dropped here while still borrowed".

r? @pnkfelix  cc @nikomatsakis
2018-07-26 09:18:26 -06:00
Mark Rousskov
0127704c98
Rollup merge of #52610 - MajorBreakfast:task-terminology, r=cramertj
Clarify what a task is

Currently we call two distinct concepts "task":
1. The top-level future that is polled until completion
2. The lightweight "thread" that is responsible for polling the top-level future. What additional data beside the future is stored in this type varies between different `Executor` implementations.

I'd prefer to return to the old formulation by @alexcrichton:
```rust
/// A handle to a "task", which represents a single lightweight "thread" of
/// execution driving a future to completion.
pub struct Task {
```
Source: [`task_impl/mod.rs` in futures-rs 0.1](1328fc9e8a/src/task_impl/mod.rs (L49-L50))

I think that this change will make it much easier to explain everything.

r? @aturon
@cramertj
2018-07-26 09:18:25 -06:00
Mark Rousskov
e29f15bafd
Rollup merge of #52558 - wesleywiser:ice_melting, r=estebank
Add tests for ICEs which no longer repro

Adds tests for some ICEs which no longer repro and closes the associated issues.
2018-07-26 09:18:23 -06:00
Simonas Kazlauskas
cc2bd71269 Add a test for sparc64 ABI issue 2018-07-26 17:55:25 +03:00
Niko Matsakis
ce576ac259 fix sparse_matrix_iter unit test 2018-07-26 16:33:52 +03:00
Niko Matsakis
d376a6bc5d add type parameters to BitMatrix and SparseBitMatrix unit tests 2018-07-26 16:33:15 +03:00
Niko Matsakis
5c603e8752 convert tests of BitVector to use BitVector<usize> 2018-07-26 16:32:13 +03:00
Felix S. Klock II
a0ac188220 Regression test for the bug. 2018-07-26 15:15:19 +02:00
csmoe
d5347ff9c9 Fix ui test 2018-07-26 21:08:56 +08:00
csmoe
20151ca716 Suggest on method signature diff between impl and trait 2018-07-26 21:08:44 +08:00
Felix S. Klock II
9f05f29e56 Incorporate edition flag testing into tests of -Z borrowck=migrate. 2018-07-26 14:59:00 +02:00
Felix S. Klock II
94a2972d3f compiletest: Add support for ignoring certain tests under --compare-mode=... 2018-07-26 14:51:36 +02:00
Felix S. Klock II
4b2e553dac integrate the edition code.
As a driveby change, I made `#![feature(nll)]` *always* take
precedence over `-Z borrowck`.  The main effect this had is that it
means tests with `#![feature(nll)]` will ignore uses of `-Z
borrowck=compare`. This affected only one test as far as I can tell,
and I think that test used `-Z borrowck=compare` only as a historical
accident.
2018-07-26 14:51:32 +02:00
Niko Matsakis
fe34c90458 patch up mir-opt tests 2018-07-26 15:12:04 +03:00
Felix S. Klock II
1a59dafe11 Bug fix: #![feature(nll)] takes precedence over -Z borrowck=migrate.
(Includes test illustrating desired behavior; compare its diagnostic
output to that of the file `borrowck-migreate-to-nll.rs`.)
2018-07-26 13:17:55 +02:00
Felix S. Klock II
f808405328 Test for -Z borrowck=migrate.
Note that this test is carefully crafted to *try* to not segfault
during its run.  Howver, it really is representing unsound code that
should be rejected after we manage to remove the AST-borrowck entirely
from the compiler.
2018-07-26 13:17:55 +02:00
Felix S. Klock II
91dc3e5b56 Add scary warnings to errors-downgraded-to-warnings in borrowck=migrate.
Also convert an ICE that became reachable code under borrowck=migrate
into a normally reported error (which is then downgraded to a
warning). This actually has a nice side benefit of providing a
somewhat more useful error message, at least in the particular case of
the example from issue #27282.
2018-07-26 13:17:55 +02:00
Felix S. Klock II
3460115157 Allow elaborate_drops to progress under errors that come up during borrowck=migrate. 2018-07-26 13:17:55 +02:00
Felix S. Klock II
ff2f9e0234 Add migrate to list of values for -Z borrowck=... 2018-07-26 13:17:55 +02:00
Felix S. Klock II
a23e8a726c Add -Z borrowck=migrate flag, use it to link NLL up to AST-borrowck. 2018-07-26 13:17:55 +02:00
Felix S. Klock II
655894baf9 Add flag indicating whether AST borrowck query signalled any error. 2018-07-26 13:17:55 +02:00
Felix S. Klock II
97f3d21c64 Issue #51348: lower match so an ident gets a distinct temp *for each* candidate pat.
This required a bit of plumbing to keep track of candidates. But I
took advantage of the hack session to try to improve the docs for the
relevant structs here.

(I also tried to simplify some of the related code in passing.)
2018-07-26 13:15:31 +02:00
Felix S. Klock II
c636ded2c7 Improve the information provided when this assertion fails. 2018-07-26 13:15:31 +02:00
Petr Sumbera
051eddd9a9 sparc ABI issue - structure returning from function is returned
in 64bit registers

Fixes: #52638
2018-07-26 03:58:00 -07:00
Niko Matsakis
687f2526fb move mir_check_* to ui tests, add adjusted references 2018-07-26 08:21:35 +03:00
Tatsuyuki Ishi
62f73dc87c Refactor is_external_tool into source_type 2018-07-26 12:36:58 +09:00
Niko Matsakis
9f09127f4d fix reference file 2018-07-26 06:21:44 +03:00
Alex Crichton
12596893f9 Update the compiler-builtins submodule
Pull in a fix for japaric/libm#129
2018-07-25 18:12:39 -07:00
Alex Crichton
f069a57bb1 rustc: Register crates under their real names
Whenever we register a crate into the crate store, make sure to use the real
name mentioned in the metadata instead of the name mentioned in the `extern
crate` statement, as the statement can be wrong!

Closes #51796
2018-07-25 18:04:19 -07:00
Taylor Cramer
bce8a91f34 std::ops::Try impl for std::task::Poll 2018-07-25 17:26:12 -07:00
Jonathan Behrens
abb704ec78 State default capacity for BufReader/BufWriter 2018-07-26 00:49:35 +01:00
Niko Matsakis
118cad13a5 ignore code example in comment 2018-07-25 23:57:59 +03:00
Eduard-Mihai Burtescu
591eeff22a Change ManuallyDrop from an union to a struct and make it a lang item. 2018-07-25 21:01:02 +03:00
Niko Matsakis
21e4a0834e Nit: improve comment in hr-fn-aau-eq-abu.rs 2018-07-25 16:40:43 +03:00
Niko Matsakis
3171cbe986 Nit: improve Binders comment in relate_tys 2018-07-25 16:38:50 +03:00
Niko Matsakis
d85a7da8fe Nit: fix Debug impl of PlaceholderIndex 2018-07-25 16:37:05 +03:00
Niko Matsakis
e43096ff05 [nit] remove outdated comment 2018-07-25 16:36:40 +03:00
Niko Matsakis
0d918a8575 improve heuristics for what makes an interesting constraint 2018-07-25 16:36:03 +03:00
Niko Matsakis
76991ea237 [WIP] debug logs in error-reporting 2018-07-25 16:19:16 +03:00
Niko Matsakis
fa69e2183a [3f0fb4f7] improve comment on to_location 2018-07-25 16:18:37 +03:00
Oliver Schneider
01d4cd5aae 0-length arrays can even be mutably promoted 2018-07-25 14:09:06 +02:00
Gabriel Smith
be5b668a2e Place the ignore comments in the correct file for test issue-18804
Signed-off-by: Gabriel Smith <ga29smith@gmail.com>
2018-07-25 07:51:32 -04:00
Josef Reinhard Brandl
eacfd72522 Clarify what a task is 2018-07-25 13:39:14 +02:00
Oliver Schneider
ef5fba0067 Hide some lints which are not quite right the way they are reported to the user 2018-07-25 13:05:05 +02:00