]> git.lizzy.rs Git - rust.git/log
rust.git
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 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 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 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 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`

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

6 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

6 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

6 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

6 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

6 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`.

6 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.

6 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

6 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

6 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

6 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

6 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

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

6 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

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

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

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

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

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

6 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

6 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

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

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

6 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.

6 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

6 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.

6 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

6 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

6 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

6 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.

6 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

6 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
6 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.

6 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

6 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

6 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

6 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

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

Closes #33264

6 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

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

Closes #34784

6 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

6 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

6 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

6 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

6 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

6 years agoAuto merge of #52175 - fpoli:testsuite-callsite-span, r=petrochenkov
bors [Mon, 23 Jul 2018 21:44:37 +0000 (21:44 +0000)]
Auto merge of #52175 - fpoli:testsuite-callsite-span, r=petrochenkov

Match errors using the callsite of macro expansions

Fix for issue #51848

6 years agoDon't match on region kinds when reporting NLL errors
Matthew Jasper [Sun, 22 Jul 2018 15:02:31 +0000 (16:02 +0100)]
Don't match on region kinds when reporting NLL errors

With NLL region kinds are always ReVar

6 years agoAuto merge of #50494 - F001:as_cell, r=alexcrichton
bors [Mon, 23 Jul 2018 19:43:36 +0000 (19:43 +0000)]
Auto merge of #50494 - F001:as_cell, r=alexcrichton

Implement rfc 1789: Conversions from `&mut T` to `&Cell<T>`

I'm surprised that RFC 1789 has not been implemented for several months. Tracking issue: https://github.com/rust-lang/rust/issues/43038

Please note: when I was writing tests for `&Cell<[i32]>`, I found it is not easy to get the length of the contained slice. So I designed a `get_with` method which might be useful for similar cases. This method is not designed in the RFC, and it certainly needs to be reviewed by core team. I think it has some connections with `Cell::update` https://github.com/rust-lang/rust/issues/50186 , which is also in design phase.

6 years agoAuto merge of #52566 - pnkfelix:buffer-nll-errors-for-z-borrowck-migrate, r=nikomatsakis
bors [Mon, 23 Jul 2018 17:45:34 +0000 (17:45 +0000)]
Auto merge of #52566 - pnkfelix:buffer-nll-errors-for-z-borrowck-migrate, r=nikomatsakis

Buffer NLL errors

Buffer the errors generated during MIR-borrowck (aka NLL).

This is the first big step towards resolving issue #46908.

6 years agoAuto merge of #52639 - oli-obk:clippyup, r=kennytm
bors [Mon, 23 Jul 2018 15:38:46 +0000 (15:38 +0000)]
Auto merge of #52639 - oli-obk:clippyup, r=kennytm

Update the clippy submodule

r? @kennytm

cc @nrc @Manishearth

6 years agoPoint at incorrect named arg in format string
Esteban Küber [Mon, 23 Jul 2018 07:01:17 +0000 (00:01 -0700)]
Point at incorrect named arg in format string

6 years agoSuggest to take and ignore args while closure args count mismatching
csmoe [Mon, 23 Jul 2018 14:16:53 +0000 (22:16 +0800)]
Suggest to take and ignore args while closure args count mismatching

6 years agoAuto merge of #52506 - alexcrichton:dont-duplicate-wasm-sections, r=michaelwoerister
bors [Mon, 23 Jul 2018 13:42:23 +0000 (13:42 +0000)]
Auto merge of #52506 - alexcrichton:dont-duplicate-wasm-sections, r=michaelwoerister

rustc: Work around an upstream wasm ThinLTO bug

This commit implements a workaround for an [upstream LLVM bug][1] where custom
sections were accidentally duplicated amongst codegen units when ThinLTO passes
were performed. This is due to the fact that custom sections for wasm are stored
as metadata nodes which are automatically imported into modules when ThinLTO
happens. The fix here is to forcibly delete the metadata node from imported
modules before LLVM has a chance to try to copy it over.

[1]: https://bugs.llvm.org/show_bug.cgi?id=38184

6 years agoChange single char str patterns to chars
ljedrz [Mon, 23 Jul 2018 13:32:57 +0000 (15:32 +0200)]
Change single char str patterns to chars

6 years agouse inherent method instead
F001 [Mon, 23 Jul 2018 11:20:50 +0000 (19:20 +0800)]
use inherent method instead

6 years agoReplace a few expect+format combos with unwrap_or_else+panic
ljedrz [Mon, 23 Jul 2018 12:47:13 +0000 (14:47 +0200)]
Replace a few expect+format combos with unwrap_or_else+panic

6 years agoMatch errors using the callsite of macro expansions
Federico Poli [Thu, 19 Jul 2018 12:15:43 +0000 (14:15 +0200)]
Match errors using the callsite of macro expansions

6 years agoThread the `errors_buffer` down through the NLL region_infer code.
Felix S. Klock II [Wed, 18 Jul 2018 21:23:21 +0000 (23:23 +0200)]
Thread the `errors_buffer` down through the NLL region_infer code.

6 years agoSeparate the construction of a generic bound failure from its emission.
Felix S. Klock II [Wed, 18 Jul 2018 21:17:22 +0000 (23:17 +0200)]
Separate the construction of a generic bound failure from its emission.

6 years agothread the `errors_buffer` down into `nll::type_check`.
Felix S. Klock II [Wed, 18 Jul 2018 20:34:01 +0000 (22:34 +0200)]
thread the `errors_buffer` down into `nll::type_check`.

Right now its solely used for `check_local`, which ... I guess is not surprising?

6 years agoBuffer errors in MIR borrow check
Santiago Pastorino [Wed, 18 Jul 2018 21:10:08 +0000 (18:10 -0300)]
Buffer errors in MIR borrow check

(pnkfelix updated to address tidy, and to change the buffer from
`Vec<DiagnosticBuilder<'errs>>` to a `Vec<Diagnostic>` in order to
avoid painful lifetime maintenance.)

6 years agoSimplify 2 functions in rustc_mir/dataflow
ljedrz [Mon, 23 Jul 2018 12:10:31 +0000 (14:10 +0200)]
Simplify 2 functions in rustc_mir/dataflow