]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoadd section in book
toidiu [Fri, 27 Jul 2018 14:18:06 +0000 (10:18 -0400)]
add section in book

6 years agofix tidy
toidiu [Fri, 27 Jul 2018 04:02:58 +0000 (00:02 -0400)]
fix tidy

6 years agofix test and add feature gate test
toidiu [Fri, 27 Jul 2018 02:58:03 +0000 (22:58 -0400)]
fix test and add feature gate test

6 years agosome comment about not infering static lifetimes test
toidiu [Fri, 27 Jul 2018 00:32:01 +0000 (20:32 -0400)]
some comment about not infering static lifetimes test

6 years agofeature gate for inferring 'static lifetimes
toidiu [Fri, 27 Jul 2018 00:25:27 +0000 (20:25 -0400)]
feature gate for inferring 'static lifetimes

6 years agoAuto merge of #52735 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
bors [Thu, 26 Jul 2018 17:42:59 +0000 (17:42 +0000)]
Auto merge of #52735 - Mark-Simulacrum:rollup, r=Mark-Simulacrum

Rollup of 16 pull requests

Successful merges:

 - #52558 (Add tests for ICEs which no longer repro)
 - #52610 (Clarify what a task is)
 - #52617 (Don't match on region kinds when reporting NLL errors)
 - #52635 (Fix #[linkage] propagation though generic functions)
 - #52647 (Suggest to take and ignore args while closure args count mismatching)
 - #52649 (Point spans to inner elements of format strings)
 - #52654 (Format linker args in a way that works for gcc and ld)
 - #52667 (update the stdsimd submodule)
 - #52674 (Impl Executor for Box<E: Executor>)
 - #52690 (ARM: expose `rclass` and `dsp` target features)
 - #52692 (Improve readability in a few sorts)
 - #52695 (Hide some lints which are not quite right the way they are reported to the user)
 - #52718 (State default capacity for BufReader/BufWriter)
 - #52721 (std::ops::Try impl for std::task::Poll)
 - #52723 (rustc: Register crates under their real names)
 - #52734 (sparc ABI issue - structure returning from function is returned in 64bit registers (with tests))

Failed merges:

 - #52678 ([NLL] Use better spans in some errors)

r? @ghost

6 years agoAuto merge of #52488 - nikomatsakis:nll-issue-48071-universe-and-sub, r=pnkfelix
bors [Thu, 26 Jul 2018 15:23:50 +0000 (15:23 +0000)]
Auto merge of #52488 - nikomatsakis:nll-issue-48071-universe-and-sub, r=pnkfelix

introduce universes to NLL type check

This branch aims to fix #48071 and also advance chalk integration a bit at the same time. It re-implements the subtyping/type-equating check so that NLL doesn't "piggy back" on the subtyping code of the old type checker.

This new code uses the "universe-based" approach to handling higher-ranked lifetimes, which sidesteps some of the limitations of the current "leak-based" scheme. This avoids the ICE in #48071.

At the same time, I aim for this to potentially be a kind of optimization. This NLL code is (currently) not cached, but it also generates constraints without doing as much instantiation, substitution, and folding. Right now, though, it still piggy backs on the `relate_tys` trait, which is a bit unfortunate -- it means we are doing more hashing and things than we have to. I want to measure the see the perf. Refactoring that trait is something I'd prefer to leave for follow-up work.

r? @pnkfelix -- but I want to measure perf etc first

6 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

6 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

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

6 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

6 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

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

6 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

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

6 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

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

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

6 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

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

6 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

6 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

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

6 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

6 years agofix `sparse_matrix_iter` unit test
Niko Matsakis [Thu, 26 Jul 2018 13:33:52 +0000 (16:33 +0300)]
fix `sparse_matrix_iter` unit test

6 years agoadd type parameters to `BitMatrix` and `SparseBitMatrix` unit tests
Niko Matsakis [Thu, 26 Jul 2018 13:33:15 +0000 (16:33 +0300)]
add type parameters to `BitMatrix` and `SparseBitMatrix` unit tests

6 years agoconvert tests of `BitVector` to use `BitVector<usize>`
Niko Matsakis [Thu, 26 Jul 2018 13:32:13 +0000 (16:32 +0300)]
convert tests of `BitVector` to use `BitVector<usize>`

6 years agopatch up mir-opt tests
Niko Matsakis [Thu, 26 Jul 2018 12:12:04 +0000 (15:12 +0300)]
patch up mir-opt tests

6 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
6 years agomove mir_check_* to ui tests, add adjusted references
Niko Matsakis [Thu, 26 Jul 2018 05:21:35 +0000 (08:21 +0300)]
move mir_check_* to ui tests, add adjusted references

6 years agofix reference file
Niko Matsakis [Thu, 26 Jul 2018 03:21:44 +0000 (06:21 +0300)]
fix reference file

6 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

6 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

6 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

6 years agoignore code example in comment
Niko Matsakis [Wed, 25 Jul 2018 19:34:33 +0000 (22:34 +0300)]
ignore code example in comment

6 years agoNit: improve comment in hr-fn-aau-eq-abu.rs
Niko Matsakis [Wed, 25 Jul 2018 13:40:43 +0000 (16:40 +0300)]
Nit: improve comment in hr-fn-aau-eq-abu.rs

6 years agoNit: improve Binders comment in `relate_tys`
Niko Matsakis [Wed, 25 Jul 2018 13:38:50 +0000 (16:38 +0300)]
Nit: improve Binders comment in `relate_tys`

6 years agoNit: fix Debug impl of `PlaceholderIndex`
Niko Matsakis [Wed, 25 Jul 2018 13:37:05 +0000 (16:37 +0300)]
Nit: fix Debug impl of `PlaceholderIndex`

6 years ago[nit] remove outdated comment
Niko Matsakis [Wed, 25 Jul 2018 13:36:40 +0000 (16:36 +0300)]
[nit] remove outdated comment

6 years agoimprove heuristics for what makes an interesting constraint
Niko Matsakis [Wed, 25 Jul 2018 13:36:03 +0000 (16:36 +0300)]
improve heuristics for what makes an interesting constraint

6 years ago[WIP] debug logs in error-reporting
Niko Matsakis [Wed, 25 Jul 2018 13:19:16 +0000 (16:19 +0300)]
[WIP] debug logs in error-reporting

6 years ago[3f0fb4f7] improve comment on `to_location`
Niko Matsakis [Wed, 25 Jul 2018 13:18:37 +0000 (16:18 +0300)]
[3f0fb4f7] improve comment on `to_location`

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

6 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

6 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

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

6 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

6 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

6 years agoadd regression test for #48071
Niko Matsakis [Tue, 24 Jul 2018 21:27:01 +0000 (00:27 +0300)]
add regression test for #48071

Fixes #48071

6 years agointroduce new subtyping
Niko Matsakis [Mon, 23 Jul 2018 14:30:59 +0000 (17:30 +0300)]
introduce new subtyping

6 years agoremove `num_universal_regions` etc from RegionValueElements
Niko Matsakis [Mon, 23 Jul 2018 19:32:12 +0000 (22:32 +0300)]
remove `num_universal_regions` etc from RegionValueElements

6 years agorepresent `LivenessValues` with a specialized type
Niko Matsakis [Mon, 23 Jul 2018 19:28:28 +0000 (22:28 +0300)]
represent `LivenessValues` with a specialized type

6 years agoextract `region_value_str` helper
Niko Matsakis [Mon, 23 Jul 2018 19:14:56 +0000 (22:14 +0300)]
extract `region_value_str` helper

6 years agogenerate extra liveness constraints before regioncx is created
Niko Matsakis [Mon, 23 Jul 2018 19:10:18 +0000 (22:10 +0300)]
generate extra liveness constraints before regioncx is created

6 years agoconsolidate and use `find_sub_region_live_at` for everything
Niko Matsakis [Mon, 23 Jul 2018 19:03:08 +0000 (22:03 +0300)]
consolidate and use `find_sub_region_live_at` for everything

remove the old blame system

6 years agoextract a `best_blame_constraint` helper
Niko Matsakis [Mon, 23 Jul 2018 18:27:49 +0000 (21:27 +0300)]
extract a `best_blame_constraint` helper

6 years agorewrite the "constraint graph search" to use a BFS instead of a DFS
Niko Matsakis [Mon, 23 Jul 2018 18:06:04 +0000 (21:06 +0300)]
rewrite the "constraint graph search" to use a BFS instead of a DFS

This way we find the shortest path without having to sort etc

6 years agoremove unnecessary `blame_span` from `report_region_errors`
Niko Matsakis [Mon, 23 Jul 2018 16:46:42 +0000 (19:46 +0300)]
remove unnecessary `blame_span` from `report_region_errors`

6 years agoremove inefficiency for adding all points
Niko Matsakis [Mon, 23 Jul 2018 15:14:16 +0000 (18:14 +0300)]
remove inefficiency for adding all points

6 years agoSparseBitMatrix: add `insert_all` and `add_all` methods
Niko Matsakis [Mon, 23 Jul 2018 15:13:54 +0000 (18:13 +0300)]
SparseBitMatrix: add `insert_all` and `add_all` methods

6 years agoSparseBitMatrix: add `ensure_row` helper fn
Niko Matsakis [Mon, 23 Jul 2018 15:13:35 +0000 (18:13 +0300)]
SparseBitMatrix: add `ensure_row` helper fn

6 years agosplit into two matrices
Niko Matsakis [Sun, 22 Jul 2018 16:46:48 +0000 (19:46 +0300)]
split into two matrices

6 years agosimplify `NLLRegionVariableOrigin`
Niko Matsakis [Sun, 22 Jul 2018 16:42:40 +0000 (19:42 +0300)]
simplify `NLLRegionVariableOrigin`

6 years agoparameterize `BitVector` and `BitMatrix` by their index types
Niko Matsakis [Sun, 22 Jul 2018 16:23:39 +0000 (19:23 +0300)]
parameterize `BitVector` and `BitMatrix` by their index types

6 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

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

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

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

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

6 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

6 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>
6 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>
6 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>
6 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>
6 years agoSuggest in separate line
csmoe [Wed, 25 Jul 2018 00:06:45 +0000 (08:06 +0800)]
Suggest in separate line

6 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

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

6 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

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

6 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 :^)

6 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

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

6 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

6 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

6 years agoimplement `Step` for `Idx` types
Niko Matsakis [Sun, 22 Jul 2018 14:20:48 +0000 (17:20 +0300)]
implement `Step` for `Idx` types

This way, we can iterate over a `Range<T>` where `T: Idx`

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

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

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

6 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

6 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

6 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

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