Commit Graph

81082 Commits

Author SHA1 Message Date
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
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
bors fefe81605d Auto merge of #52561 - ljedrz:fixme_cc_271, r=alexcrichton
Remove obsolete armv5te vars from the dist-various-1 Dockerfile

The [related cc issue](https://github.com/alexcrichton/cc-rs/issues/271) is closed and its changes are in force.
2018-07-25 09:45:06 +00:00
Esteban Küber 9a893cc2b8 Add span label for format str missing specifier 2018-07-24 20:46:22 -07:00
Esteban Küber 7bd94e0738 Rename method and remove commented out code 2018-07-24 20:37:38 -07:00
Esteban Küber 3298b9f8c7 Fix unittest 2018-07-24 18:44:34 -07:00
csmoe 1d79588994 Update ui test 2018-07-25 09:30:53 +08:00
csmoe d5256b75df Update comment and do suggest 2018-07-25 09:30:10 +08:00
csmoe 40c0339cf6 Fix test 2018-07-25 09:09:13 +08:00
bors 1398572403 Auto merge of #52680 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 7 pull requests

Successful merges:

 - #52391 (Add unaligned volatile intrinsics)
 - #52402 (impl PartialEq+Eq for BuildHasherDefault)
 - #52645 (Allow declaring existential types inside blocks)
 - #52656 (Stablize Redox Unix Sockets)
 - #52658 (Prefer `Option::map`/etc over `match` wherever it improves clarity)
 - #52668 (clarify pointer offset function safety concerns)
 - #52677 (Release notes: add some missing 1.28 libs stabilization)

Failed merges:

r? @ghost
2018-07-25 00:31:58 +00:00
Gabriel Smith e58e7b045c Disable regression test for issue #18804 on Emscripten and Asmjs
The Emscripten compiler does not support weak symbols at the moment.

Signed-off-by: Gabriel Smith <ga29smith@gmail.com>
2018-07-24 20:17:15 -04:00
Gabriel Smith 0bcbe91b48 Deduplicate linkage checking code for statics
Signed-off-by: Gabriel Smith <ga29smith@gmail.com>
2018-07-24 20:17:14 -04:00
Gabriel Smith a20262c069 Properly set the linkage type on non-local statics
Fixes issue #18804

Signed-off-by: Gabriel Smith <ga29smith@gmail.com>
2018-07-24 20:15:06 -04:00
Gabriel Smith e8bc064c5e Add regression test for issue #18804
Signed-off-by: Gabriel Smith <ga29smith@gmail.com>
2018-07-24 20:15:06 -04:00
csmoe 94921768ea Suggest in separate line 2018-07-25 08:06:45 +08:00
Esteban Küber 4d8aa5989c Use suggestions for `printf` format 2018-07-24 16:01:38 -07:00
Mark Rousskov 1deaed9e5e
Rollup merge of #52677 - SimonSapin:relnotes, r=Mark-Simulacrum
Release notes: add some missing 1.28 libs stabilization

Some URLs are not valid yet unless you add `beta/`, but they should be when 1.28 is released.
2018-07-24 16:43:51 -06:00
Mark Rousskov 4bb8c31f10
Rollup merge of #52668 - RalfJung:ptr-doc, r=cramertj
clarify pointer offset function safety concerns
2018-07-24 16:43:50 -06:00
Mark Rousskov c7a178ea5f
Rollup merge of #52658 - Wallacoloo:topics/use-option-methods, r=cramertj
Prefer `Option::map`/etc over `match` wherever it improves clarity

This isn't intended to change behavior anywhere. A lot of times statements like `match x { None => None, Some(y) => [...] }` can be rewritten using `Option::map` or `Option::and_then` in a way that preserves or improves clarity, so that's what I've done here.

I think it's particularly valuable to keep things in `libcore` and `libstd` pretty/idiomatic since it's not uncommon to follow the `[src]` links when browsing the rust-lang.org docs for std/core. If there's any concern about pushing style-based changes though, I'll happily back out the non-std/core commits here.
2018-07-24 16:43:49 -06:00
Mark Rousskov 28f8cb585a
Rollup merge of #52656 - jD91mZM2:stablize-uds, r=alexcrichton
Stablize Redox Unix Sockets

I don't know if I did this correctly, but I basically spammed the `#[stable]` attribute everywhere :^)
2018-07-24 16:43:48 -06:00
Mark Rousskov f930017e10
Rollup merge of #52645 - oli-obk:existential_in_fn_body, r=dtolnay
Allow declaring existential types inside blocks

fixes #52631

r? @dtolnay
2018-07-24 16:43:46 -06:00
Mark Rousskov dab595e96a
Rollup merge of #52402 - crepererum:build_hasher_eq, r=sfackler
impl PartialEq+Eq for BuildHasherDefault

`BuildHasherDefault`is only one way of implementing `BuildHasher`. Clearly, every `BuildHasherDefault` for the same type `H` is identical, since it just uses `Default<H>` to construct `H`. In general, this is not true for every `BuildHasher`, so I think it is helpful to implement `PartialEq` and `Eq`.
2018-07-24 16:43:45 -06:00
Mark Rousskov 06ba69d043
Rollup merge of #52391 - Amanieu:volatile_unaligned, r=alexcrichton
Add unaligned volatile intrinsics

Surprisingly enough, it turns out that unaligned volatile loads are actually useful for certain (very niche) types of lock-free code. I included unaligned volatile stores for completeness, but I currently do not know of any use cases for them.

These are only exposed as intrinsics for now. If they turn out to be useful in practice, we can work towards stabilizing them.

r? @alexcrichton
2018-07-24 16:43:44 -06:00
bors 46804ef0ce Auto merge of #52257 - steveklabnik:refactor-rustdoc, r=QuietMisdreavus
Refactor rustdoc

This is based on https://github.com/rust-lang/rust/pull/52194 and so shouldn't be merged until it gets merged.

Now that plugin functionality has been removed, let's kill PluginManager. Additionally, rustdoc now follows the standard cargo layout instead of dumping everything at the top level.

r? @rust-lang/rustdoc
2018-07-24 22:25:42 +00:00
steveklabnik 0bf2a06bc0 remove zombie code 2018-07-24 16:44:52 -04:00
steveklabnik 86d2ba4f59 remove pluginmanager 2018-07-24 16:44:52 -04:00
Simon Sapin 3cce003f15 Release notes: add some missing 1.28 libs stabilization 2018-07-24 22:35:15 +02:00
bors 487e961c6a Auto merge of #52181 - QuietMisdreavus:panicked-tester, r=GuillaumeGomez
rustdoc: set panic output before starting compiler thread pool

When the compiler was updated to run on a thread pool, rustdoc's processing of compiler/doctest stderr/stdout was moved into each compiler thread. However, this caused output of the test to be lost if the test failed at *runtime* instead of compile time. This change sets up the `set_panic` call and output bomb before starting the compiler thread pool, so that the `Drop` call that writes back to the test's stdout happens after the test runs, not just after it compiles.

Fixes https://github.com/rust-lang/rust/issues/51162
2018-07-24 19:34:11 +00:00
Esteban Küber f9e37625e6 Reword missing formatting arguments label 2018-07-24 09:51:04 -07:00
Esteban Küber f487e39e91 Add documentation for `Parser::arg_places` 2018-07-24 09:46:41 -07:00
Ralf Jung fb08915622 clarify offset function safety concerns 2018-07-24 18:23:10 +02:00
Jorge Aparicio 9808f7cb39 update the stdsimd submodule
to bring in the doc generation fix
2018-07-24 11:08:11 -05:00
QuietMisdreavus 76e33b4eb4 force the doctest rustc thread to share the name of the test 2018-07-24 10:35:55 -05:00
bors f498e4ec1b Auto merge of #51587 - mark-i-m:at_most_once_rep_2018, r=alexcrichton
2018 edition `?` Kleene operator

This is my first attempt at implementing the migration lint + 2018 behavior as discussed in #48075

r? @nikomatsakis
2018-07-24 15:11:56 +00:00
bors 6a3db033ad Auto merge of #52597 - oli-obk:promotion_simplify, r=nagisa
Promoteds are statics and statics have a place, not just a value

r? @eddyb

This makes everything around promoteds a little simpler
2018-07-24 13:10:06 +00:00
bors a1e6bcb208 Auto merge of #52189 - cuviper:static-box-leak, r=bluss
doc: Clarify the lifetime returned by `Box::leak`

`Box::leak` mentions that it can return a `'static` reference, but it
wasn't immediately clear to me why it doesn't always do so.  This is
because of the `T: 'a` constraint needed to form a valid reference, and
in general we want to be more flexible than requiring `T: 'static`.
This patch tries to clarify the relationship between `T` and `'a`.
2018-07-24 10:46:21 +00:00
bors a2af8667b1 Auto merge of #52646 - ljedrz:single_char_pattern, r=michaelwoerister
Change single char str patterns to chars

A `char` is faster.
2018-07-24 08:24:11 +00:00
Oliver Schneider 2e33a557de Allow declaring existential types inside blocks 2018-07-24 10:07:45 +02:00
Colin Wallace cbe5f1c420 libsyntax_ext: Prefer `Option::map` over `match` where applicable 2018-07-23 22:06:45 -07:00
Colin Wallace 10d82137b3 librustc: Prefer `Option::map`/etc over `match` where applicable 2018-07-23 22:05:45 -07:00
Colin Wallace 727bd7de7e libcore: Prefer `Option::map` over `match` where applicable 2018-07-23 22:04:33 -07:00
Colin Wallace 4f3ab4986e libstd: Prefer `Option::map`/etc over `match` where applicable 2018-07-23 22:00:51 -07:00