]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoImplement Unpin for FutureObj and LocalFutureObj
Taylor Cramer [Mon, 30 Jul 2018 16:13:30 +0000 (09:13 -0700)]
Implement Unpin for FutureObj and LocalFutureObj

5 years agoAuto merge of #52697 - ljedrz:misc_data_structures, r=Mark-Simulacrum
bors [Mon, 30 Jul 2018 12:20:58 +0000 (12:20 +0000)]
Auto merge of #52697 - ljedrz:misc_data_structures, r=Mark-Simulacrum

Simplify a few functions in rustc_data_structures

- drop `try!()` where it's superfluous
- change `try!()` to `?`
- squash a `push` with `push_str`
- refactor a push loop into an iterator

5 years agoAuto merge of #52830 - matthewjasper:bootstrap-prep, r=matthewjasper
bors [Mon, 30 Jul 2018 10:19:38 +0000 (10:19 +0000)]
Auto merge of #52830 - matthewjasper:bootstrap-prep, r=matthewjasper

[NLL] Fix some things for bootstrap

Some changes that are required when bootstrapping rustc with NLL enabled.

* Remove a bunch of unused `mut`s that aren't needed, but the existing lint doesn't catch.
* Rewrite a function call to satisfy NLL borrowck. Note that the borrow is two-phase, but gets activated immediately by an unsizing coercion.

cc #51823

5 years agoAuto merge of #52722 - alexcrichton:more-identifier-lints, r=oli-obk
bors [Mon, 30 Jul 2018 08:25:36 +0000 (08:25 +0000)]
Auto merge of #52722 - alexcrichton:more-identifier-lints, r=oli-obk

Tweak the raw_identifiers lints in 2018

* Enable the `raw_identifiers` feature automatically in the 2018 preview
* Only emit lint warnings if the `raw_identifiers` feature is activated

cc rust-lang/cargo#5783

5 years agoAuto merge of #52805 - ljedrz:format_str_literal, r=petrochenkov
bors [Mon, 30 Jul 2018 06:29:39 +0000 (06:29 +0000)]
Auto merge of #52805 - ljedrz:format_str_literal, r=petrochenkov

Don't format!() string literals

Prefer `to_string()` to `format!()` take 2, this time targetting string literals. In some cases (`&format!("...")` -> `"..."`) also removes allocations. Occurences of `format!("")` are changed to `String::new()`.

5 years agoAuto merge of #52823 - RalfJung:test, r=eddyb
bors [Mon, 30 Jul 2018 04:34:19 +0000 (04:34 +0000)]
Auto merge of #52823 - RalfJung:test, r=eddyb

invalid_const_promotion: check if we get the right signal

r? @eddyb

5 years agoAuto merge of #52828 - Mark-Simulacrum:clear-rustdoc-check, r=alexcrichton
bors [Mon, 30 Jul 2018 01:08:13 +0000 (01:08 +0000)]
Auto merge of #52828 - Mark-Simulacrum:clear-rustdoc-check, r=alexcrichton

Clear out rustdoc check builds if dependencies change

r? @alexcrichton

5 years agoAuto merge of #52738 - ljedrz:push_to_extend, r=eddyb
bors [Sun, 29 Jul 2018 21:37:47 +0000 (21:37 +0000)]
Auto merge of #52738 - ljedrz:push_to_extend, r=eddyb

Replace push loops with extend() where possible

Or set the vector capacity where I couldn't do it.

According to my [simple benchmark](https://gist.github.com/ljedrz/568e97621b749849684c1da71c27dceb) `extend`ing a vector can be over **10 times** faster than `push`ing to it in a loop:

10 elements (6.1 times faster):
```
test bench_extension ... bench:          75 ns/iter (+/- 23)
test bench_push_loop ... bench:         458 ns/iter (+/- 142)
```

100 elements (11.12 times faster):
```
test bench_extension ... bench:          87 ns/iter (+/- 26)
test bench_push_loop ... bench:         968 ns/iter (+/- 3,528)
```

1000 elements (11.04 times faster):
```
test bench_extension ... bench:         311 ns/iter (+/- 9)
test bench_push_loop ... bench:       3,436 ns/iter (+/- 233)
```

Seems like a good idea to use `extend` as much as possible.

5 years agoAuto merge of #51361 - oli-obk:sanity_check_consts, r=nikomatsakis
bors [Sun, 29 Jul 2018 19:37:28 +0000 (19:37 +0000)]
Auto merge of #51361 - oli-obk:sanity_check_consts, r=nikomatsakis

Do a basic sanity check for all constant values

## Motivation and high level overview

There has been some back and forth in this PR between @RalfJung and me in here about the motivation for this change and the stance it takes on unsafe coding guidelines.

The initial implementation ran its checks on every value read (so `*x`, `y = x`, ...). In unsafe code that isn't reasonable, because we might be invalidating invariants for a short time in order to build up a proper value.

The current implementation is a lint that runs its checks statics and constants. There is no need to check array lengths and enum variants, because it's a hard error to end up with anything but a number, and that one even has to have the required bits to be defined.

## What checks are done?

* Some type related checks
    * `char` needs to be a correct unicode character as defined by `char::from_u32`
    * A reference to a ZST must have the correct alignment (and be nonzero)
    * A reference to anything is dereferenced and its value is checked
* Layout checks use the information from `ty::Layout` to check
    * all fields of structs
    * all elements of arrays
    * enum discriminants
    * the fields of an enum variant (the variant is decided by the discriminant)
    * whether any union field succeeds in being checked (if none match the memory pattern, the check fails)
    * if the value is in the range described by the layout (e.g. for `NonZero*` types)

Changing the layout of a type will thus automatically cause the checks to check for the new layout.

fixes #51330
fixes #51471

cc @RalfJung

r? @eddyb

5 years agodont hardcode vtable size in codegen test
Ralf Jung [Sun, 29 Jul 2018 10:34:19 +0000 (12:34 +0200)]
dont hardcode vtable size in codegen test

5 years agoupdate codegen tests
Ralf Jung [Sun, 29 Jul 2018 10:14:51 +0000 (12:14 +0200)]
update codegen tests

5 years agoMove a test that depends on the arch bitwidth to compile-fail
Oliver Schneider [Thu, 26 Jul 2018 15:46:09 +0000 (17:46 +0200)]
Move a test that depends on the arch bitwidth to compile-fail

5 years agoUpdate miri submodule
Oliver Schneider [Thu, 26 Jul 2018 12:38:41 +0000 (14:38 +0200)]
Update miri submodule

5 years agoSanity-check all constants
Oliver Schneider [Mon, 4 Jun 2018 16:32:06 +0000 (18:32 +0200)]
Sanity-check all constants

5 years agoChange order of copy and borrow to avoid conflict
Matthew Jasper [Sun, 29 Jul 2018 17:02:13 +0000 (18:02 +0100)]
Change order of copy and borrow to avoid conflict

Note that the first argument is `self as &mut dyn Delegate`, so this
isn't allowed with two-phase borrows.

5 years agoRemove unused `mut`s
Matthew Jasper [Sun, 29 Jul 2018 16:40:36 +0000 (17:40 +0100)]
Remove unused `mut`s

5 years agoReplace push loops with collect() and extend() where possible
ljedrz [Thu, 26 Jul 2018 15:11:10 +0000 (17:11 +0200)]
Replace push loops with collect() and extend() where possible

5 years agoClear out rustdoc check builds if dependencies change
Mark Rousskov [Sun, 29 Jul 2018 15:03:37 +0000 (09:03 -0600)]
Clear out rustdoc check builds if dependencies change

5 years agoAuto merge of #52620 - mikhail-m1:51351, r=nikomatsakis
bors [Sun, 29 Jul 2018 13:23:01 +0000 (13:23 +0000)]
Auto merge of #52620 - mikhail-m1:51351, r=nikomatsakis

fix simple case of issue #51351 and #52133

r? @nikomatsakis

5 years agoAuto merge of #52755 - kennytm:update-rustfmt, r=nrc
bors [Sun, 29 Jul 2018 11:27:48 +0000 (11:27 +0000)]
Auto merge of #52755 - kennytm:update-rustfmt, r=nrc

Update rustfmt and RLS

5 years agoinvalid_const_promotion: check if we get the right signal
Ralf Jung [Sun, 29 Jul 2018 11:11:01 +0000 (13:11 +0200)]
invalid_const_promotion: check if we get the right signal

5 years agoUpdate RLS and rustfmt.
kennytm [Thu, 26 Jul 2018 21:58:55 +0000 (05:58 +0800)]
Update RLS and rustfmt.

5 years agoTest clippy first to workaround the derive-new conflict.
kennytm [Sun, 29 Jul 2018 11:05:29 +0000 (19:05 +0800)]
Test clippy first to workaround the derive-new conflict.

5 years agofix issues #51351 and #52133
Mikhail Modin [Fri, 27 Jul 2018 21:46:16 +0000 (22:46 +0100)]
fix issues #51351 and #52133

5 years agoAuto merge of #52767 - ljedrz:avoid_format, r=petrochenkov
bors [Sun, 29 Jul 2018 09:33:37 +0000 (09:33 +0000)]
Auto merge of #52767 - ljedrz:avoid_format, r=petrochenkov

Prefer to_string() to format!()

Simple benchmarks suggest in some cases it can be faster by even 37%:
```
test converting_f64_long  ... bench:         339 ns/iter (+/- 199)
test converting_f64_short ... bench:         136 ns/iter (+/- 34)
test converting_i32_long  ... bench:          87 ns/iter (+/- 16)
test converting_i32_short ... bench:          87 ns/iter (+/- 49)
test converting_str       ... bench:          54 ns/iter (+/- 15)
test formatting_f64_long  ... bench:         349 ns/iter (+/- 176)
test formatting_f64_short ... bench:         145 ns/iter (+/- 14)
test formatting_i32_long  ... bench:          98 ns/iter (+/- 14)
test formatting_i32_short ... bench:          93 ns/iter (+/- 15)
test formatting_str       ... bench:          86 ns/iter (+/- 23)
```

5 years agoExempt cloudabi from license check.
kennytm [Sun, 29 Jul 2018 03:54:27 +0000 (11:54 +0800)]
Exempt cloudabi from license check.

5 years agoCopy the test_data/ RLS tests into a writable directory.
kennytm [Sat, 28 Jul 2018 19:36:18 +0000 (03:36 +0800)]
Copy the test_data/ RLS tests into a writable directory.

See rust-lang-nursery/rls#966 for details.

5 years agoAuto merge of #52764 - sinkuu:cleanup, r=nikomatsakis
bors [Sun, 29 Jul 2018 06:32:24 +0000 (06:32 +0000)]
Auto merge of #52764 - sinkuu:cleanup, r=nikomatsakis

Misc cleanups

5 years agoAuto merge of #52751 - QuietMisdreavus:you-shall-not-pass, r=GuillaumeGomez
bors [Sun, 29 Jul 2018 03:20:54 +0000 (03:20 +0000)]
Auto merge of #52751 - QuietMisdreavus:you-shall-not-pass, r=GuillaumeGomez

rustdoc: rework how default passes are chosen

This is a refactor that changes how we select default passes, and changes the set of passes used for `--document-private-items`. It's groundwork for a bigger refactor i want to do.

The major changes:

* There are now two sets of "default passes": one set for "no flags given" and one for "document private items".
* These sets can be selected by a new `DefaultPassOption` enum, which is selected from based on the presence of `--no-defaults` or `--document-private-items` CLI flags, or their associated crate attributes.
* When printing the list of passes, we also print the list of passes for `--document-private-items` in addition to the "default defaults".
* I added `propagate-doc-cfg` and `strip-priv-imports` to the "document private items" set. The former is to ensure items are properly tagged with the full set of cfg flags even when "document private items" is active. The latter is based on feedback and personal experience navigating the `rustc` docs, which use that flag. `strip-priv-imports` only removes non-pub `use` statements, so it should be harmless from a documentation standpoint to remove those items from "private items" documentation.

5 years agoAuto merge of #52720 - alexcrichton:update-cargo-and-rustfix, r=nikomatsakis
bors [Sun, 29 Jul 2018 01:14:39 +0000 (01:14 +0000)]
Auto merge of #52720 - alexcrichton:update-cargo-and-rustfix, r=nikomatsakis

Update the Cargo submodule and rustfix

Should hopefully bring in a few more `cargo fix`-related fixes.

5 years agoAuto merge of #52355 - pietroalbini:zfeature, r=eddyb
bors [Sat, 28 Jul 2018 23:10:10 +0000 (23:10 +0000)]
Auto merge of #52355 - pietroalbini:zfeature, r=eddyb

Add the -Zcrate-attr=foo unstable rustc option

This PR adds a new unstable option to `rustc`: `-Zcrate-attr=foo`. The option can be used to inject crate-level attributes from the CLI, and it's meant to be used by tools like Crater that needs to add their own attributes to a crate without changing the source code.

The exact reason I need this is to implement "edition runs" in Crater: we need to add the preview feature flag to every crate, and editing the crates' source code on the fly might produce unexpected results, while a compiler flag is more reliable.

cc https://github.com/rust-lang-nursery/crater/issues/282 @Mark-Simulacrum

5 years agoAuto merge of #52585 - GuillaumeGomez:generic-impls, r=QuietMisdreavus
bors [Sat, 28 Jul 2018 20:44:17 +0000 (20:44 +0000)]
Auto merge of #52585 - GuillaumeGomez:generic-impls, r=QuietMisdreavus

[rustdoc] Generic impls

Fixes #33772.

r? @QuietMisdreavus

5 years agoAuto merge of #52546 - nikomatsakis:issue-52050, r=pnkfelix
bors [Sat, 28 Jul 2018 18:41:40 +0000 (18:41 +0000)]
Auto merge of #52546 - nikomatsakis:issue-52050, r=pnkfelix

do not overwrite child def-id in place but rather remove/insert

When inserting a node N into the tree of impls, we sometimes find than an existing node C should be replaced with N. We used to overwrite C in place with the new def-id N -- but since the lists of def-ids are separated by simplified type, that could lead to N being inserted in the wrong place. This meant we might miss conflicts. We are now not trying to be so smart -- we remove C and then add N later.

Fixes #52050

r? @aturon -- do you still remember this code at all? :)

5 years agoMove blanket implementations generation into its own function
Guillaume Gomez [Sat, 28 Jul 2018 18:27:10 +0000 (20:27 +0200)]
Move blanket implementations generation into its own function

5 years agoRemove core exclusion condition
Guillaume Gomez [Sat, 28 Jul 2018 17:06:25 +0000 (19:06 +0200)]
Remove core exclusion condition

5 years agoUpdate the Cargo submodule and rustfix
Alex Crichton [Thu, 26 Jul 2018 00:25:12 +0000 (17:25 -0700)]
Update the Cargo submodule and rustfix

Should hopefully bring in a few more `cargo fix`-related fixes.

5 years agoAuto merge of #52744 - RalfJung:align_offset, r=Kimundi
bors [Sat, 28 Jul 2018 16:44:21 +0000 (16:44 +0000)]
Auto merge of #52744 - RalfJung:align_offset, r=Kimundi

make memrchr use align_offset

I hope I did not screw that up...

Cc @oli-obk who authored the original https://github.com/rust-lang/rust/pull/44537

Fixes #50567 (thanks @bjorn3)

5 years agoDon't format!() string literals
ljedrz [Sat, 28 Jul 2018 12:40:32 +0000 (14:40 +0200)]
Don't format!() string literals

5 years agoAuto merge of #52711 - eddyb:unsized-manuallydrop, r=nikomatsakis
bors [Sat, 28 Jul 2018 14:26:16 +0000 (14:26 +0000)]
Auto merge of #52711 - eddyb:unsized-manuallydrop, r=nikomatsakis

Change ManuallyDrop<T> to a lang item.

This PR implements the approach @RalfJung proposes in https://internals.rust-lang.org/t/pre-rfc-unions-drop-types-and-manuallydrop/8025 (lang item `struct` instead of `union`).

A followup PR can easily solve #47034 as well, by just adding a few `?Sized` to `libcore/mem.rs`.

r? @nikomatsakis

5 years agoDon't display full blanket implementation and put it into its own section
Guillaume Gomez [Fri, 27 Jul 2018 20:59:16 +0000 (22:59 +0200)]
Don't display full blanket implementation and put it into its own section

5 years agoAuto merge of #52761 - toidiu:ak-static-infer-fg, r=nikomatsakis
bors [Sat, 28 Jul 2018 11:37:41 +0000 (11:37 +0000)]
Auto merge of #52761 - toidiu:ak-static-infer-fg, r=nikomatsakis

static infer feature gate

https://github.com/rust-lang/rust/issues/44493

r? @nikomatsakis

5 years agoAuto merge of #52802 - kennytm:rollup, r=kennytm
bors [Sat, 28 Jul 2018 09:40:05 +0000 (09:40 +0000)]
Auto merge of #52802 - kennytm:rollup, r=kennytm

Rollup of 11 pull requests

Successful merges:

 - #52702 (Suggest fix when encountering different mutability from impl to trait)
 - #52703 (Improve a few vectors - calculate capacity or build from iterators)
 - #52740 (Suggest underscore when using dashes in crate namet push fork)
 - #52759 (Impl Send & Sync for JoinHandle)
 - #52760 (rustc_metadata: test loading atoi instead of cos)
 - #52763 (Omit the vendor component in Fuchsia triple)
 - #52765 (Remove unused "-Zenable_nonzeroing_move_hints" flag)
 - #52769 (Incorporate a stray test)
 - #52777 (Fix doc comment for 'ptr::copy_to' method)
 - #52779 (revert accidental atty downgrade)
 - #52781 (Use a slice where a vector is not necessary)

Failed merges:

r? @ghost

5 years agoRollup merge of #52781 - ljedrz:avoid_vec_arguments, r=nikomatsakis
kennytm [Sat, 28 Jul 2018 08:25:07 +0000 (16:25 +0800)]
Rollup merge of #52781 - ljedrz:avoid_vec_arguments, r=nikomatsakis

Use a slice where a vector is not necessary

5 years agoRollup merge of #52779 - RalfJung:atty, r=Mark-Simulacrum
kennytm [Sat, 28 Jul 2018 08:25:06 +0000 (16:25 +0800)]
Rollup merge of #52779 - RalfJung:atty, r=Mark-Simulacrum

revert accidental atty downgrade

This got accidentally downgraded by https://github.com/rust-lang/rust/pull/52488

Cc @nikomatsakis @pnkfelix

5 years agoRollup merge of #52777 - omni-viral:master, r=TimNN
kennytm [Sat, 28 Jul 2018 08:25:05 +0000 (16:25 +0800)]
Rollup merge of #52777 - omni-viral:master, r=TimNN

Fix doc comment for 'ptr::copy_to' method

Fix error in doc comment for `ptr::copy_to` method.

5 years agoRollup merge of #52769 - sinkuu:stray_test, r=alexcrichton
kennytm [Sat, 28 Jul 2018 08:25:04 +0000 (16:25 +0800)]
Rollup merge of #52769 - sinkuu:stray_test, r=alexcrichton

Incorporate a stray test

`liballoc/repeat-generic-slice.rs` doesn't seem to be tested (I think it was intended to be placed in `run-pass`). This PR incorporates the test into `liballoc/tests`.

5 years agoRollup merge of #52765 - sinkuu:remove_nonzeroing_move_opt, r=pnkfelix
kennytm [Sat, 28 Jul 2018 08:25:03 +0000 (16:25 +0800)]
Rollup merge of #52765 - sinkuu:remove_nonzeroing_move_opt, r=pnkfelix

Remove unused "-Zenable_nonzeroing_move_hints" flag

Removing a dead option which seems to be a remnant of the old drop-flag system.

5 years agoRollup merge of #52763 - petrhosek:fuchsia-triple, r=alexcrichton
kennytm [Sat, 28 Jul 2018 08:25:02 +0000 (16:25 +0800)]
Rollup merge of #52763 - petrhosek:fuchsia-triple, r=alexcrichton

Omit the vendor component in Fuchsia triple

Previously, using unknown as the vendor value would lead to the same
result, but with the multiarch runtimes support in Clang, the target is
now used to locate the runtime libraries and so the format is important.
The denormalized format with omitted vendor component is the format we
use with Clang and should be using for Rust as well.

5 years agoRollup merge of #52760 - cuviper:test_loading_atoi, r=alexcrichton
kennytm [Sat, 28 Jul 2018 08:25:01 +0000 (16:25 +0800)]
Rollup merge of #52760 - cuviper:test_loading_atoi, r=alexcrichton

rustc_metadata: test loading atoi instead of cos

Some platforms don't actually have `libm` already linked in the test
infrastructure, and then `dynamic_lib::tests::test_loading_cosine` would
fail to find the "cos" symbol.  Every platform running this test should
have `libc` and "atoi" though, so try to use that symbol instead.

Fixes #45410.

5 years agoRollup merge of #52759 - stjepang:impl-send-sync-for-joinhandle, r=TimNN
kennytm [Sat, 28 Jul 2018 08:24:59 +0000 (16:24 +0800)]
Rollup merge of #52759 - stjepang:impl-send-sync-for-joinhandle, r=TimNN

Impl Send & Sync for JoinHandle

This is just a cosmetic change - it slightly relaxes and clarifies the public API without effectively promising any new guarantees.

Currently we have [these auto trait implementations](https://doc.rust-lang.org/nightly/std/thread/struct.JoinHandle.html#synthetic-implementations):

```rust
impl<T: Send> Send for JoinHandle<T> {}
impl<T: Sync> Sync for JoinHandle<T> {}
```

Bound `T: Send` doesn't make much sense because `JoinHandle<T>` can be created only when `T: Send`. Note that [`JoinHandle::<T>::join`](https://doc.rust-lang.org/nightly/std/thread/struct.JoinHandle.html#method.join) doesn't require `T: Send` so why should the `Send` impl?

And the `Sync` impl doesn't need `T: Sync` because `JoinHandle<T>` cannot even share `T` - it can only send it to the thread that calls `join`.

5 years agoRollup merge of #52740 - estebank:crate-name, r=petrochenkov
kennytm [Sat, 28 Jul 2018 08:24:58 +0000 (16:24 +0800)]
Rollup merge of #52740 - estebank:crate-name, r=petrochenkov

Suggest underscore when using dashes in crate namet push fork

Fix #48437.

5 years agoRollup merge of #52703 - ljedrz:vec_improvements, r=nikomatsakis
kennytm [Sat, 28 Jul 2018 08:24:57 +0000 (16:24 +0800)]
Rollup merge of #52703 - ljedrz:vec_improvements, r=nikomatsakis

Improve a few vectors - calculate capacity or build from iterators

Collecting from iterators improves readability and tailoring vector capacities should be beneficial in terms of performance.

5 years agoRollup merge of #52702 - csmoe:mut_diff, r=estebank
kennytm [Sat, 28 Jul 2018 08:24:55 +0000 (16:24 +0800)]
Rollup merge of #52702 - csmoe:mut_diff, r=estebank

Suggest fix when encountering different mutability from impl to trait

Closes https://github.com/rust-lang/rust/issues/52412
r? @estebank

5 years agoAuto merge of #52678 - matthewjasper:better-spans, r=nikomatsakis
bors [Sat, 28 Jul 2018 07:42:13 +0000 (07:42 +0000)]
Auto merge of #52678 - matthewjasper:better-spans, r=nikomatsakis

[NLL] Use better spans in some errors

* Use the span of the discriminant and patterns for "fake" statements created to properly check matches. I plan to special case these soon, but this felt like a good first step
* Use the span of the statement, rather than the initialization, when reporting move errors for `let x = ...`, which avoids giving an unhelpful suggestion to use `&{ }`.

r? @nikomatsakis cc @pnkfelix

5 years agoreview comments
Esteban Küber [Fri, 27 Jul 2018 20:11:48 +0000 (13:11 -0700)]
review comments

5 years agoAuto merge of #52336 - ishitatsuyuki:dyn-rollup, r=Mark-Simulacrum
bors [Fri, 27 Jul 2018 20:27:40 +0000 (20:27 +0000)]
Auto merge of #52336 - ishitatsuyuki:dyn-rollup, r=Mark-Simulacrum

Rollup of bare_trait_objects PRs

All deny attributes were moved into bootstrap so they can be disabled with a line of config.

Warnings for external tools are allowed and it's up to the tool's maintainer to keep it warnings free.

r? @Mark-Simulacrum
cc @ljedrz @kennytm

5 years agoAdd the -Zcrate-attr=foo nightly rustc flag to inject crate attributes
Pietro Albini [Wed, 18 Jul 2018 18:34:08 +0000 (20:34 +0200)]
Add the -Zcrate-attr=foo nightly rustc flag to inject crate attributes

5 years agouodate reference again to hopefully fix all link issues
Ralf Jung [Fri, 27 Jul 2018 16:40:47 +0000 (18:40 +0200)]
uodate reference again to hopefully fix all link issues

5 years agoAuto merge of #52770 - pietroalbini:bump-bootstrap, r=Mark-Simulacrum
bors [Fri, 27 Jul 2018 15:03:33 +0000 (15:03 +0000)]
Auto merge of #52770 - pietroalbini:bump-bootstrap, r=Mark-Simulacrum

Bump bootstrap compiler

This PR bumps the bootstrap compiler to the latest beta, `beta-2017-07-27`. That should be the latest beta with relevant changes (the only nominated PR at the moment is a docs change).

r? @Mark-Simulacrum

5 years agoUse slices where a vector is not necessary
ljedrz [Fri, 27 Jul 2018 14:50:28 +0000 (16:50 +0200)]
Use slices where a vector is not necessary

5 years agoBetter Option handling
Shotaro Yamada [Mon, 2 Apr 2018 23:45:06 +0000 (08:45 +0900)]
Better Option handling

5 years agoSimplify
Shotaro Yamada [Sun, 1 Apr 2018 04:52:45 +0000 (13:52 +0900)]
Simplify

5 years agoUnnecessary `to_string`
Shotaro Yamada [Sat, 17 Mar 2018 00:46:32 +0000 (09:46 +0900)]
Unnecessary `to_string`

5 years agoRemove unnecessary `.collect()`
Shotaro Yamada [Fri, 16 Mar 2018 13:35:26 +0000 (22:35 +0900)]
Remove unnecessary `.collect()`

5 years agoUse str::repeat
Shotaro Yamada [Sun, 1 Apr 2018 04:48:15 +0000 (13:48 +0900)]
Use str::repeat

5 years agoadd section in book
toidiu [Fri, 27 Jul 2018 14:18:06 +0000 (10:18 -0400)]
add section in book

5 years agorevert accidental atty downgrade
Ralf Jung [Fri, 27 Jul 2018 13:10:52 +0000 (15:10 +0200)]
revert accidental atty downgrade

5 years agoAuto merge of #52648 - davidtwco:issue-52533, r=nikomatsakis
bors [Fri, 27 Jul 2018 13:01:48 +0000 (13:01 +0000)]
Auto merge of #52648 - davidtwco:issue-52533, r=nikomatsakis

[nll] improve the "fully elaborated type" case in region errors

Fixes #52533.

r? @nikomatsakis

5 years agoFix doc comment for 'ptr::copy_to' method
Zakarum [Fri, 27 Jul 2018 12:26:57 +0000 (15:26 +0300)]
Fix doc comment for 'ptr::copy_to' method

5 years agoupdate reference to fix links
Ralf Jung [Fri, 27 Jul 2018 11:38:20 +0000 (13:38 +0200)]
update reference to fix links

5 years agoRegion inference error messages no longer start with 'free region'
David Wood [Thu, 26 Jul 2018 13:36:41 +0000 (15:36 +0200)]
Region inference error messages no longer start with 'free region'

5 years agoAuto merge of #52733 - pnkfelix:issue-51348-make-temp-for-each-candidate-in-arm,...
bors [Fri, 27 Jul 2018 11:02:27 +0000 (11:02 +0000)]
Auto merge of #52733 - pnkfelix:issue-51348-make-temp-for-each-candidate-in-arm, r=nikomatsakis

[NLL] make temp for each candidate in `match` arm

In NLL, `ref mut` patterns leverage the two-phase borrow infrastructure to allow the shared borrows within a guard before the "activation" of the mutable borrow when we begin execution of the match arm's body. (There is further discussion of this on PR #50783.)

To accommodate the restrictions we impose on two-phase borrows (namely that there is a one-to-one mapping between each activation and the original initialization), this PR is making separate temps for each candidate pattern. So in an arm like this:
```rust
PatA(_, ref mut ident) |
PatB(ref mut ident) |
PatC(_, _, ref mut ident) |
PatD(ref mut ident) if guard_stuff(ident) => ...
```

instead of 3 temps (two for the guard and one for the arm body), we now have 4 + 2 temps associated with `ident`: one for each candidate plus the actual temp that the guard uses directly, and then the sixth is the temp used in the arm body.

Fix #51348

5 years agoImproved mechanism for naming regions in non-annotated types.
David Wood [Thu, 26 Jul 2018 10:29:58 +0000 (12:29 +0200)]
Improved mechanism for naming regions in non-annotated types.

5 years agoChange label from closure to function where appropriate.
David Wood [Tue, 24 Jul 2018 14:22:41 +0000 (16:22 +0200)]
Change label from closure to function where appropriate.

5 years agobump bootstrap compiler to beta-2018-07-27
Pietro Albini [Fri, 27 Jul 2018 10:24:17 +0000 (12:24 +0200)]
bump bootstrap compiler to beta-2018-07-27

5 years agoadd smoke test for ManuallyDrop
Ralf Jung [Fri, 27 Jul 2018 10:12:55 +0000 (12:12 +0200)]
add smoke test for ManuallyDrop

5 years agoFixed missing whitespace on some elaborated types.
David Wood [Mon, 23 Jul 2018 15:41:18 +0000 (17:41 +0200)]
Fixed missing whitespace on some elaborated types.

5 years agoUpdate affected tests.
David Wood [Mon, 23 Jul 2018 14:27:24 +0000 (16:27 +0200)]
Update affected tests.

5 years agouse slice::align_to
Ralf Jung [Fri, 27 Jul 2018 09:54:38 +0000 (11:54 +0200)]
use slice::align_to

5 years agoImproved fully elaborated type generation to replace `'_#2r`-style regions.
David Wood [Mon, 23 Jul 2018 14:26:33 +0000 (16:26 +0200)]
Improved fully elaborated type generation to replace `'_#2r`-style regions.

5 years agoAdded fully elaborated type label for inferred arguments.
David Wood [Mon, 23 Jul 2018 11:09:30 +0000 (13:09 +0200)]
Added fully elaborated type label for inferred arguments.

5 years agoSimplified closure handling to need no new cosntraint categories.
David Wood [Mon, 23 Jul 2018 11:07:11 +0000 (13:07 +0200)]
Simplified closure handling to need no new cosntraint categories.

5 years agoPrefer to_string() to format!()
ljedrz [Fri, 27 Jul 2018 09:11:18 +0000 (11:11 +0200)]
Prefer to_string() to format!()

5 years agoAuto merge of #52681 - pnkfelix:z-borrowck-migrate, r=nikomatsakis
bors [Fri, 27 Jul 2018 09:10:07 +0000 (09:10 +0000)]
Auto merge of #52681 - pnkfelix:z-borrowck-migrate, r=nikomatsakis

Add `-Z borrowck=migrate`

This adds `-Z borrowck=migrate`, which represents the way we want to migrate to NLL under Rust versions to come. It also hooks this new mode into `--edition 2018`, which means we're officially turning NLL on in the 2018 edition.

The basic idea of `-Z borrowck=migrate` that there are cases where NLL is fixing old soundness bugs in the borrow-checker, but in order to avoid just breaking code by immediately rejecting the programs that hit those soundness bugs, we instead use the following strategy:

If your code is accepted by NLL, then we accept it.
If your code is rejected by both NLL and the old AST-borrowck, then we reject it.
If your code is rejected by NLL but accepted by the old AST-borrowck, then we emit the new NLL errors as **warnings**.

These warnings will be turned into hard errors in the future, and they say so in these diagnostics.

Fix #46908

5 years agoIncorporate a stray test
Shotaro Yamada [Sat, 28 Apr 2018 16:19:06 +0000 (01:19 +0900)]
Incorporate a stray test

5 years agoRemove unused option flag
Shotaro Yamada [Fri, 20 Apr 2018 10:53:55 +0000 (19:53 +0900)]
Remove unused option flag

5 years agoAdd stability attributes
Stjepan Glavina [Fri, 27 Jul 2018 08:08:02 +0000 (10:08 +0200)]
Add stability attributes

5 years agoAuto merge of #52650 - oli-obk:associated_existential_types, r=nikomatsakis
bors [Fri, 27 Jul 2018 07:16:12 +0000 (07:16 +0000)]
Auto merge of #52650 - oli-obk:associated_existential_types, r=nikomatsakis

Implement associated existential types

r? @nikomatsakis

no idea if these work with generic traits. I'm going home for the day :rofl:

5 years agoOmit the vendor component in Fuchsia triple
Petr Hosek [Fri, 27 Jul 2018 00:57:20 +0000 (17:57 -0700)]
Omit the vendor component in Fuchsia triple

Previously, using unknown as the vendor value would lead to the same
result, but with the multiarch runtimes support in Clang, the target is
now used to locate the runtime libraries and so the format is important.
The denormalized format with omitted vendor component is the format we
use with Clang and should be using for Rust as well.

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

5 years agoAuto merge of #52724 - alexcrichton:update-compiler-builtins, r=alexcrichton
bors [Fri, 27 Jul 2018 03:24:16 +0000 (03:24 +0000)]
Auto merge of #52724 - alexcrichton:update-compiler-builtins, r=alexcrichton

Update the compiler-builtins submodule

Pull in a fix for japaric/libm#129

5 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

5 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

5 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

5 years agorustc_metadata: test loading atoi instead of cos
Josh Stone [Fri, 27 Jul 2018 00:20:02 +0000 (17:20 -0700)]
rustc_metadata: test loading atoi instead of cos

Some platforms don't actually have `libm` already linked in the test
infrastructure, and then `dynamic_lib::tests::test_loading_cosine` would
fail to find the "cos" symbol.  Every platform running this test should
have `libc` and "atoi" though, so try to use that symbol instead.

Fixes #45410.

5 years agoImpl Send & Sync for JoinHandle
Stjepan Glavina [Thu, 26 Jul 2018 23:08:13 +0000 (01:08 +0200)]
Impl Send & Sync for JoinHandle

5 years agoAuto merge of #52673 - oli-obk:mutable_promoted, r=nagisa,cramertj,estebank
bors [Thu, 26 Jul 2018 22:20:17 +0000 (22:20 +0000)]
Auto merge of #52673 - oli-obk:mutable_promoted, r=nagisa,cramertj,estebank

Try to fix an ICE

might fix #52671

5 years agoTweak the raw_identifiers lints in 2018
Alex Crichton [Thu, 26 Jul 2018 00:26:58 +0000 (17:26 -0700)]
Tweak the raw_identifiers lints in 2018

* Enable the `raw_identifiers` feature automatically in the 2018 preview
* Only emit lint warnings if the `raw_identifiers` feature is activated

cc rust-lang/cargo#5783

5 years agoUse better spans for cannot-move errors
Matthew Jasper [Sun, 22 Jul 2018 20:38:31 +0000 (21:38 +0100)]
Use better spans for cannot-move errors

5 years agoUse better spans for dummy accesses used in matches
Matthew Jasper [Sun, 22 Jul 2018 20:13:18 +0000 (21:13 +0100)]
Use better spans for dummy accesses used in matches