]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoRollup merge of #52734 - nagisa:sparcfix, r=oli-obk
Mark Rousskov [Thu, 26 Jul 2018 15:18:42 +0000 (09:18 -0600)]
Rollup merge of #52734 - nagisa:sparcfix, r=oli-obk

sparc ABI issue - structure returning from function is returned in 64bit registers (with tests)

Fixes #52638

Supersedes #52730

cc @psumbera

5 years agoRollup merge of #52723 - alexcrichton:fix-extern-rename-ice, r=estebank
Mark Rousskov [Thu, 26 Jul 2018 15:18:41 +0000 (09:18 -0600)]
Rollup merge of #52723 - alexcrichton:fix-extern-rename-ice, r=estebank

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

5 years agoRollup merge of #52721 - cramertj:try-poll, r=aturon
Mark Rousskov [Thu, 26 Jul 2018 15:18:40 +0000 (09:18 -0600)]
Rollup merge of #52721 - cramertj:try-poll, r=aturon

std::ops::Try impl for std::task::Poll

I originally left out the `Try` impl for `Poll` because I was curious if we needed it, and @MajorBreakfast and I had discussed the potential for it to introduce confusion about exactly what control-flow was happening at different points. However, after porting a pretty significant chunk of Fuchsia over to futures 0.3, I discovered that I was *constantly* having to do repetitive matching on `Poll<Result<...>>` or `Poll<Option<Result<...>>>` in order to propagate errors correctly. `try_poll` (propagate `Poll::Ready(Err(..))`s) helped in some places, but it was far more common to need some form of conversion between `Result`, `Poll<Result<...>>`, and `Poll<Option<Result<...>>>`. The `Try` trait conveniently provides all of these conversions in addition to a more concise syntax (`?`), so I'd like to experiment with using these instead.

cc @seanmonstar

r? @aturon

Note: this change means that far more futures 0.1 code can work without significant changes since it papers over the fact that `Result` is no longer at the top-level when using `Stream` and `Future` (since it's now `Poll<Result<...>>` or `Poll<Option<Result<...>>>` instead of `Result<Poll<..>>` and `Result<Poll<Option<...>>>`).

5 years agoRollup merge of #52718 - fintelia:patch-2, r=cramertj
Mark Rousskov [Thu, 26 Jul 2018 15:18:39 +0000 (09:18 -0600)]
Rollup merge of #52718 - fintelia:patch-2, r=cramertj

State default capacity for BufReader/BufWriter

Addresses #52513

5 years agoRollup merge of #52695 - oli-obk:const_err_panic, r=petrochenkov
Mark Rousskov [Thu, 26 Jul 2018 15:18:37 +0000 (09:18 -0600)]
Rollup merge of #52695 - oli-obk:const_err_panic, r=petrochenkov

Hide some lints which are not quite right the way they are reported to the user

fixes #52603

5 years agoRollup merge of #52692 - ljedrz:sort_improvements, r=petrochenkov
Mark Rousskov [Thu, 26 Jul 2018 15:18:36 +0000 (09:18 -0600)]
Rollup merge of #52692 - ljedrz:sort_improvements, r=petrochenkov

Improve readability in a few sorts

Use `sort_by_key` where possible.

5 years agoRollup merge of #52690 - paoloteti:rclass-dsp, r=alexcrichton
Mark Rousskov [Thu, 26 Jul 2018 15:18:35 +0000 (09:18 -0600)]
Rollup merge of #52690 - paoloteti:rclass-dsp, r=alexcrichton

ARM: expose `rclass` and `dsp` target features

- `dsp`: the subtarget supports the DSP (saturating arith. and such)
         instructions
- `rclass`: target is a Cortex-R

Both features are useful to support ARM MCUs on `coresimd`.

Note: Cortex-R52 is the first Armv8-R with `neon` support.

r? @alexcrichton
cc @japaric

5 years agoRollup merge of #52674 - tinaun:patch-2, r=cramertj
Mark Rousskov [Thu, 26 Jul 2018 15:18:34 +0000 (09:18 -0600)]
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>

5 years agoRollup merge of #52667 - japaric:stdsimd-up, r=alexcrichton
Mark Rousskov [Thu, 26 Jul 2018 15:18:32 +0000 (09:18 -0600)]
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

5 years agoRollup merge of #52654 - alecmocatta:master, r=alexcrichton
Mark Rousskov [Thu, 26 Jul 2018 15:18:31 +0000 (09:18 -0600)]
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!

5 years agoRollup merge of #52649 - estebank:fmt-span, r=oli-obk
Mark Rousskov [Thu, 26 Jul 2018 15:18:30 +0000 (09:18 -0600)]
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
   |               ^^^^^^ ^^
```

5 years agoRollup merge of #52647 - csmoe:closure_arg_ignore, r=estebank
Mark Rousskov [Thu, 26 Jul 2018 15:18:29 +0000 (09:18 -0600)]
Rollup merge of #52647 - csmoe:closure_arg_ignore, r=estebank

Suggest to take and ignore args while closure args count mismatching

Closes #52473

5 years agoRollup merge of #52635 - yodaldevoid:issue_18804, r=oli-obk
Mark Rousskov [Thu, 26 Jul 2018 15:18:27 +0000 (09:18 -0600)]
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.

5 years agoRollup merge of #52617 - matthewjasper:remove-unused-code, r=nikomatsakis
Mark Rousskov [Thu, 26 Jul 2018 15:18:26 +0000 (09:18 -0600)]
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

5 years agoRollup merge of #52610 - MajorBreakfast:task-terminology, r=cramertj
Mark Rousskov [Thu, 26 Jul 2018 15:18:25 +0000 (09:18 -0600)]
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](https://github.com/rust-lang-nursery/futures-rs/blob/1328fc9e8af5737183df477c7501e6ea24ff2053/src/task_impl/mod.rs#L49-L50)

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

r? @aturon
@cramertj

5 years agoRollup merge of #52558 - wesleywiser:ice_melting, r=estebank
Mark Rousskov [Thu, 26 Jul 2018 15:18:23 +0000 (09:18 -0600)]
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.

5 years agoAdd a test for sparc64 ABI issue
Simonas Kazlauskas [Thu, 26 Jul 2018 14:55:25 +0000 (17:55 +0300)]
Add a test for sparc64 ABI issue

5 years agosparc ABI issue - structure returning from function is returned
Petr Sumbera [Thu, 26 Jul 2018 10:58:00 +0000 (03:58 -0700)]
sparc ABI issue - structure returning from function is returned
in 64bit registers

Fixes: #52638
5 years agorustc: Register crates under their real names
Alex Crichton [Thu, 26 Jul 2018 01:02:03 +0000 (18:02 -0700)]
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

5 years agostd::ops::Try impl for std::task::Poll
Taylor Cramer [Thu, 26 Jul 2018 00:10:05 +0000 (17:10 -0700)]
std::ops::Try impl for std::task::Poll

5 years agoState default capacity for BufReader/BufWriter
Jonathan Behrens [Wed, 25 Jul 2018 23:42:59 +0000 (00:42 +0100)]
State default capacity for BufReader/BufWriter

5 years agoPlace the ignore comments in the correct file for test issue-18804
Gabriel Smith [Wed, 25 Jul 2018 11:51:32 +0000 (07:51 -0400)]
Place the ignore comments in the correct file for test issue-18804

Signed-off-by: Gabriel Smith <ga29smith@gmail.com>
5 years agoClarify what a task is
Josef Reinhard Brandl [Sun, 22 Jul 2018 09:08:31 +0000 (11:08 +0200)]
Clarify what a task is

5 years agoHide some lints which are not quite right the way they are reported to the user
Oliver Schneider [Wed, 25 Jul 2018 11:05:05 +0000 (13:05 +0200)]
Hide some lints which are not quite right the way they are reported to the user

5 years agoImprove readability in a few sorts
ljedrz [Wed, 25 Jul 2018 08:36:57 +0000 (10:36 +0200)]
Improve readability in a few sorts

5 years agoAuto merge of #52561 - ljedrz:fixme_cc_271, r=alexcrichton
bors [Wed, 25 Jul 2018 09:45:06 +0000 (09:45 +0000)]
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.

5 years agoARM: expose `rclass` and `dsp` target features
Paolo Teti [Wed, 25 Jul 2018 07:27:55 +0000 (09:27 +0200)]
ARM: expose `rclass` and `dsp` target features

- `dsp`: the subtarget supports the DSP (saturating arith. and such)
         instructions
- `rclass`: target is a Cortex-R

Both features are useful to support ARM MCUs on `coresimd`.

Note: Cortex-R52 is the first Armv8-R with `neon` support

5 years agoAdd span label for format str missing specifier
Esteban Küber [Wed, 25 Jul 2018 03:46:22 +0000 (20:46 -0700)]
Add span label for format str missing specifier

5 years agoRename method and remove commented out code
Esteban Küber [Wed, 25 Jul 2018 03:37:38 +0000 (20:37 -0700)]
Rename method and remove commented out code

5 years agoFix unittest
Esteban Küber [Wed, 25 Jul 2018 01:44:34 +0000 (18:44 -0700)]
Fix unittest

5 years agoUpdate ui test
csmoe [Wed, 25 Jul 2018 01:30:53 +0000 (09:30 +0800)]
Update ui test

5 years agoUpdate comment and do suggest
csmoe [Wed, 25 Jul 2018 01:30:10 +0000 (09:30 +0800)]
Update comment and do suggest

5 years agoFix test
csmoe [Wed, 25 Jul 2018 01:09:13 +0000 (09:09 +0800)]
Fix test

5 years agoAuto merge of #52680 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
bors [Wed, 25 Jul 2018 00:31:58 +0000 (00:31 +0000)]
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

5 years agoDisable regression test for issue #18804 on Emscripten and Asmjs
Gabriel Smith [Tue, 24 Jul 2018 12:51:57 +0000 (08:51 -0400)]
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>
5 years agoDeduplicate linkage checking code for statics
Gabriel Smith [Mon, 23 Jul 2018 12:43:22 +0000 (08:43 -0400)]
Deduplicate linkage checking code for statics

Signed-off-by: Gabriel Smith <ga29smith@gmail.com>
5 years agoProperly set the linkage type on non-local statics
Gabriel Smith [Sun, 22 Jul 2018 23:30:52 +0000 (19:30 -0400)]
Properly set the linkage type on non-local statics

Fixes issue #18804

Signed-off-by: Gabriel Smith <ga29smith@gmail.com>
5 years agoAdd regression test for issue #18804
Gabriel Smith [Mon, 23 Jul 2018 00:33:04 +0000 (20:33 -0400)]
Add regression test for issue #18804

Signed-off-by: Gabriel Smith <ga29smith@gmail.com>
5 years agoSuggest in separate line
csmoe [Wed, 25 Jul 2018 00:06:45 +0000 (08:06 +0800)]
Suggest in separate line

5 years agoUse suggestions for `printf` format
Esteban Küber [Tue, 24 Jul 2018 23:01:38 +0000 (16:01 -0700)]
Use suggestions for `printf` format

5 years agoRollup merge of #52677 - SimonSapin:relnotes, r=Mark-Simulacrum
Mark Rousskov [Tue, 24 Jul 2018 22:43:51 +0000 (16:43 -0600)]
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.

5 years agoRollup merge of #52668 - RalfJung:ptr-doc, r=cramertj
Mark Rousskov [Tue, 24 Jul 2018 22:43:50 +0000 (16:43 -0600)]
Rollup merge of #52668 - RalfJung:ptr-doc, r=cramertj

clarify pointer offset function safety concerns

5 years agoRollup merge of #52658 - Wallacoloo:topics/use-option-methods, r=cramertj
Mark Rousskov [Tue, 24 Jul 2018 22:43:49 +0000 (16:43 -0600)]
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.

5 years agoRollup merge of #52656 - jD91mZM2:stablize-uds, r=alexcrichton
Mark Rousskov [Tue, 24 Jul 2018 22:43:48 +0000 (16:43 -0600)]
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 :^)

5 years agoRollup merge of #52645 - oli-obk:existential_in_fn_body, r=dtolnay
Mark Rousskov [Tue, 24 Jul 2018 22:43:46 +0000 (16:43 -0600)]
Rollup merge of #52645 - oli-obk:existential_in_fn_body, r=dtolnay

Allow declaring existential types inside blocks

fixes #52631

r? @dtolnay

5 years agoRollup merge of #52402 - crepererum:build_hasher_eq, r=sfackler
Mark Rousskov [Tue, 24 Jul 2018 22:43:45 +0000 (16:43 -0600)]
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`.

5 years agoRollup merge of #52391 - Amanieu:volatile_unaligned, r=alexcrichton
Mark Rousskov [Tue, 24 Jul 2018 22:43:44 +0000 (16:43 -0600)]
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

5 years agoAuto merge of #52257 - steveklabnik:refactor-rustdoc, r=QuietMisdreavus
bors [Tue, 24 Jul 2018 22:25:42 +0000 (22:25 +0000)]
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

5 years agoImpl Executor for Box<E: Executor>
tinaun [Tue, 24 Jul 2018 19:33:19 +0000 (15:33 -0400)]
Impl Executor for Box<E: Executor>

5 years agoremove zombie code
steveklabnik [Mon, 23 Jul 2018 13:19:30 +0000 (09:19 -0400)]
remove zombie code

5 years agoremove pluginmanager
steveklabnik [Wed, 11 Jul 2018 13:08:27 +0000 (09:08 -0400)]
remove pluginmanager

5 years agoRelease notes: add some missing 1.28 libs stabilization
Simon Sapin [Tue, 24 Jul 2018 20:35:15 +0000 (22:35 +0200)]
Release notes: add some missing 1.28 libs stabilization

5 years agoAuto merge of #52181 - QuietMisdreavus:panicked-tester, r=GuillaumeGomez
bors [Tue, 24 Jul 2018 19:34:11 +0000 (19:34 +0000)]
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

5 years agoReword missing formatting arguments label
Esteban Küber [Tue, 24 Jul 2018 16:51:04 +0000 (09:51 -0700)]
Reword missing formatting arguments label

5 years agoAdd documentation for `Parser::arg_places`
Esteban Küber [Tue, 24 Jul 2018 16:46:41 +0000 (09:46 -0700)]
Add documentation for `Parser::arg_places`

5 years agoclarify offset function safety concerns
Ralf Jung [Tue, 24 Jul 2018 16:23:10 +0000 (18:23 +0200)]
clarify offset function safety concerns

5 years agoupdate the stdsimd submodule
Jorge Aparicio [Tue, 24 Jul 2018 16:08:11 +0000 (11:08 -0500)]
update the stdsimd submodule

to bring in the doc generation fix

5 years agoforce the doctest rustc thread to share the name of the test
QuietMisdreavus [Tue, 24 Jul 2018 15:35:55 +0000 (10:35 -0500)]
force the doctest rustc thread to share the name of the test

5 years agoAuto merge of #51587 - mark-i-m:at_most_once_rep_2018, r=alexcrichton
bors [Tue, 24 Jul 2018 15:11:56 +0000 (15:11 +0000)]
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

5 years agoAuto merge of #52597 - oli-obk:promotion_simplify, r=nagisa
bors [Tue, 24 Jul 2018 13:10:06 +0000 (13:10 +0000)]
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

5 years agoAuto merge of #52189 - cuviper:static-box-leak, r=bluss
bors [Tue, 24 Jul 2018 10:46:21 +0000 (10:46 +0000)]
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`.

5 years agoAuto merge of #52646 - ljedrz:single_char_pattern, r=michaelwoerister
bors [Tue, 24 Jul 2018 08:24:11 +0000 (08:24 +0000)]
Auto merge of #52646 - ljedrz:single_char_pattern, r=michaelwoerister

Change single char str patterns to chars

A `char` is faster.

5 years agoAllow declaring existential types inside blocks
Oliver Schneider [Mon, 23 Jul 2018 12:56:36 +0000 (14:56 +0200)]
Allow declaring existential types inside blocks

5 years agolibsyntax_ext: Prefer `Option::map` over `match` where applicable
Colin Wallace [Tue, 24 Jul 2018 05:06:45 +0000 (22:06 -0700)]
libsyntax_ext: Prefer `Option::map` over `match` where applicable

5 years agolibrustc: Prefer `Option::map`/etc over `match` where applicable
Colin Wallace [Tue, 24 Jul 2018 05:05:45 +0000 (22:05 -0700)]
librustc: Prefer `Option::map`/etc over `match` where applicable

5 years agolibcore: Prefer `Option::map` over `match` where applicable
Colin Wallace [Tue, 24 Jul 2018 05:04:33 +0000 (22:04 -0700)]
libcore: Prefer `Option::map` over `match` where applicable

5 years agolibstd: Prefer `Option::map`/etc over `match` where applicable
Colin Wallace [Tue, 24 Jul 2018 05:00:51 +0000 (22:00 -0700)]
libstd: Prefer `Option::map`/etc over `match` where applicable

5 years agoStablize Redox Unix Sockets
jD91mZM2 [Tue, 24 Jul 2018 03:27:45 +0000 (05:27 +0200)]
Stablize Redox Unix Sockets

5 years agoAuto merge of #52655 - kennytm:rollup, r=kennytm
bors [Tue, 24 Jul 2018 03:01:11 +0000 (03:01 +0000)]
Auto merge of #52655 - kennytm:rollup, r=kennytm

Rollup of 10 pull requests

Successful merges:

 - #52538 (Remove obsolete flags in the i586_musl Dockerfile)
 - #52548 (Cursor: update docs to clarify Cursor only works with in-memory buffers)
 - #52605 (Do not suggest using `to_owned()` on `&str += &str`)
 - #52621 (Fix color detection for Windows msys terminals.)
 - #52622 (Use MultiSpan in E0707 and E709)
 - #52627 (Compile rustc before building tests for rustdoc)
 - #52637 (Don't use NonNull::dangling as sentinel value in Rc, Arc)
 - #52640 (Forget Waker when cloning LocalWaker)
 - #52641 (Simplify 2 functions in rustc_mir/dataflow)
 - #52642 (Replace a few expect+format combos with unwrap_or_else+panic)

Failed merges:

r? @ghost

5 years agoAllow by default, fix tests
mark [Sat, 14 Jul 2018 04:48:15 +0000 (23:48 -0500)]
Allow by default, fix tests

5 years agodump lints _after_ parsing macros
mark [Sat, 14 Jul 2018 04:40:29 +0000 (23:40 -0500)]
dump lints _after_ parsing macros

5 years agomake it a migration lint
mark [Fri, 13 Jul 2018 02:25:02 +0000 (21:25 -0500)]
make it a migration lint

5 years agoFix test and errors
mark [Tue, 3 Jul 2018 00:44:01 +0000 (19:44 -0500)]
Fix test and errors

5 years agoupdate nightly book
mark [Wed, 27 Jun 2018 04:59:01 +0000 (23:59 -0500)]
update nightly book

5 years agoImplement 2015 vs 2018 `?` kleene op + test
mark [Sat, 16 Jun 2018 02:49:00 +0000 (21:49 -0500)]
Implement 2015 vs 2018 `?` kleene op + test

5 years agoExtend ParseSess to support buffering lints
mark [Thu, 12 Jul 2018 01:54:12 +0000 (20:54 -0500)]
Extend ParseSess to support buffering lints

5 years agoFix ui test
csmoe [Tue, 24 Jul 2018 02:09:45 +0000 (10:09 +0800)]
Fix ui test

5 years agoMark the suggestion applicable
csmoe [Mon, 23 Jul 2018 14:45:37 +0000 (22:45 +0800)]
Mark the suggestion applicable

5 years agoRollup merge of #52642 - ljedrz:expect_fun_call, r=Mark-Simulacrum
kennytm [Tue, 24 Jul 2018 01:50:00 +0000 (09:50 +0800)]
Rollup merge of #52642 - ljedrz:expect_fun_call, r=Mark-Simulacrum

Replace a few expect+format combos with unwrap_or_else+panic

That way the error strings won't be created if the related errors are not triggered.

5 years agoRollup merge of #52641 - ljedrz:mir_dataflow_misc, r=cramertj
kennytm [Tue, 24 Jul 2018 01:49:59 +0000 (09:49 +0800)]
Rollup merge of #52641 - ljedrz:mir_dataflow_misc, r=cramertj

Simplify 2 functions in rustc_mir/dataflow

- `graphviz::outgoing`: the `enumerate` only provides indices; use a range instead
- `DataflowState::interpret_set`: change a push loop to an iterator and remove the `each_bit` helper function

5 years agoRollup merge of #52640 - Thomasdezeeuw:fix-localwaker-clone, r=cramertj
kennytm [Tue, 24 Jul 2018 01:49:58 +0000 (09:49 +0800)]
Rollup merge of #52640 - Thomasdezeeuw:fix-localwaker-clone, r=cramertj

Forget Waker when cloning LocalWaker

Since NonNull is Copy the inner field of the cloned Waker was copied for
use in the new LocalWaker, however this left Waker to be dropped. Which
means that when cloning LocalWaker would also erroneously call drop_raw.

This change forgets the Waker, rather then dropping it, leaving the
inner field to be used by the returned LocalWaker.

Closes #52629.

5 years agoRollup merge of #52637 - RalfJung:rc, r=joshtriplett
kennytm [Tue, 24 Jul 2018 01:49:56 +0000 (09:49 +0800)]
Rollup merge of #52637 - RalfJung:rc, r=joshtriplett

Don't use NonNull::dangling as sentinel value in Rc, Arc

Instead, rely on alignment and use usize::MAX as sentinel.

Cc #52508

r? @joshtriplett

5 years agoRollup merge of #52627 - Mark-Simulacrum:rustdoc-test-correct, r=alexcrichton
kennytm [Tue, 24 Jul 2018 01:49:55 +0000 (09:49 +0800)]
Rollup merge of #52627 - Mark-Simulacrum:rustdoc-test-correct, r=alexcrichton

Compile rustc before building tests for rustdoc

r? @alexcrichton

5 years agoRollup merge of #52622 - estebank:lifetime-multispan, r=nikomatsakis
kennytm [Tue, 24 Jul 2018 01:49:54 +0000 (09:49 +0800)]
Rollup merge of #52622 - estebank:lifetime-multispan, r=nikomatsakis

Use MultiSpan in E0707 and E709

5 years agoRollup merge of #52621 - ehuss:atty-fix, r=alexcrichton
kennytm [Tue, 24 Jul 2018 01:49:53 +0000 (09:49 +0800)]
Rollup merge of #52621 - ehuss:atty-fix, r=alexcrichton

Fix color detection for Windows msys terminals.

Updates atty to pull in the fix softprops/atty#28.  Closes rust-lang/cargo#5724.

5 years agoRollup merge of #52605 - estebank:str-plus-eq, r=oli-obk
kennytm [Tue, 24 Jul 2018 01:49:52 +0000 (09:49 +0800)]
Rollup merge of #52605 - estebank:str-plus-eq, r=oli-obk

Do not suggest using `to_owned()` on `&str += &str`

 - Don't provide incorrect suggestion for `&str += &str` (fix #52410)
 - On `&str + String` suggest `&str.to_owned() + &String` as a single suggestion

5 years agoRollup merge of #52548 - tko:cursor-doc, r=sfackler
kennytm [Tue, 24 Jul 2018 01:49:50 +0000 (09:49 +0800)]
Rollup merge of #52548 - tko:cursor-doc, r=sfackler

Cursor: update docs to clarify Cursor only works with in-memory buffers

Reduce misconceptions about Cursor being more general than it really is.

Fixes: #52470
5 years agoRollup merge of #52538 - ljedrz:old_musl_i586_flags, r=kennytm
kennytm [Tue, 24 Jul 2018 01:49:49 +0000 (09:49 +0800)]
Rollup merge of #52538 - ljedrz:old_musl_i586_flags, r=kennytm

Remove obsolete flags in the i586_musl Dockerfile

Resolves an [outdated FIXME](https://github.com/rust-lang/rust/blob/ab8b961677ac5c74762dcea955aa0ff4d7fe4915/src/ci/docker/dist-i586-gnu-i586-i686-musl/Dockerfile#L45) in the Dockerfile for dist-i586-gnu-i586-i686-musl.

5 years agoUpdate compile-fail tests to be ui tests
Wesley Wiser [Fri, 20 Jul 2018 03:30:42 +0000 (23:30 -0400)]
Update compile-fail tests to be ui tests

5 years agoAdd compile-fail test for #43196
Wesley Wiser [Fri, 20 Jul 2018 03:15:49 +0000 (23:15 -0400)]
Add compile-fail test for #43196

Closes #43196

5 years agoAdd compile-fail test for #42060
Wesley Wiser [Fri, 20 Jul 2018 03:09:45 +0000 (23:09 -0400)]
Add compile-fail test for #42060

Closes #42060

5 years agoAdd run-pass test for #44005
Wesley Wiser [Fri, 20 Jul 2018 03:01:34 +0000 (23:01 -0400)]
Add run-pass test for #44005

Closes #44005

5 years agoAdd test for #33264
Wesley Wiser [Tue, 24 Jul 2018 01:24:18 +0000 (21:24 -0400)]
Add test for #33264

Closes #33264

5 years agobreak --subsystem=x into 2 args; closer to former presumably known-good incantation
alecmocatta [Tue, 24 Jul 2018 01:11:57 +0000 (02:11 +0100)]
break --subsystem=x into 2 args; closer to former presumably known-good incantation

5 years agoAdd tests for #34784
Wesley Wiser [Fri, 20 Jul 2018 02:41:09 +0000 (22:41 -0400)]
Add tests for #34784

Closes #34784

5 years agoAuto merge of #52618 - alexcrichton:capture-more, r=petrochenkov
bors [Tue, 24 Jul 2018 00:50:15 +0000 (00:50 +0000)]
Auto merge of #52618 - alexcrichton:capture-more, r=petrochenkov

rustc: Implement tokenization of nested items

Ever plagued by #43081 the compiler can return surprising spans in situations
related to procedural macros. This is exhibited by #47983 where whenever a
procedural macro is invoked in a nested item context it would fail to have
correct span information.

While #43230 provided a "hack" to cache the token stream used for each item in
the compiler it's not a full-blown solution. This commit continues to extend
this "hack" a bit more to work for nested items.

Previously in the parser the `parse_item` method would collect the tokens for an
item into a cache on the item itself. It turned out, however, that nested items
were parsed through the `parse_item_` method, so they didn't receive similar
treatment. To remedy this situation the hook for collecting tokens was moved
into `parse_item_` instead of `parse_item`.

Afterwards the token collection scheme was updated to support nested collection
of tokens. This is implemented by tracking `TokenStream` tokens instead of
`TokenTree` to allow for collecting items into streams at intermediate layers
and having them interleaved in the upper layers.

All in all, this...

Closes #47983

5 years agoPass multiple linker arguments rather than concatenate with commas; -l library -...
alecmocatta [Mon, 23 Jul 2018 23:47:34 +0000 (00:47 +0100)]
Pass multiple linker arguments rather than concatenate with commas; -l library -> -llibrary to work with apple's ld

5 years agoAdd test for raw string
Esteban Küber [Mon, 23 Jul 2018 22:43:34 +0000 (15:43 -0700)]
Add test for raw string

5 years agoOnly point at inside of string literals if they're actually string literals
Esteban Küber [Mon, 23 Jul 2018 22:33:36 +0000 (15:33 -0700)]
Only point at inside of string literals if they're actually string literals

5 years agoPoint only at invalid positional arguments
Esteban Küber [Mon, 23 Jul 2018 22:09:00 +0000 (15:09 -0700)]
Point only at invalid positional arguments