]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoImproved test output for liballoc/str
sntdevco [Fri, 15 Mar 2019 11:07:53 +0000 (16:37 +0530)]
Improved test output for liballoc/str

5 years agoAuto merge of #58575 - mati865:musl_toolchain, r=alexcrichton
bors [Fri, 15 Mar 2019 11:00:13 +0000 (11:00 +0000)]
Auto merge of #58575 - mati865:musl_toolchain, r=alexcrichton

Musl host toolchain

Based on https://github.com/rust-lang/rust/pull/55163 and https://github.com/rust-lang/rust/pull/57359
Depends on https://github.com/rust-lang/rust/pull/55566

CC https://github.com/rust-lang/rust/issues/57439

### How it works

Tested compiler made by `dist` on glibc and musl based distributions and verified binaries it produces:
* Ubuntu (glibc) - installed it as a target for host toolchain and observed no regressions for static (default) linking, dynamic linking apparently requires musl build libgcc so I didn't test it.
* Alpine (musl) - installed as the host toolchain, by default it links statically (executables are portable and work on glibc distributions) but with `-C target-feature=-crt-static` Rust flag it links dynamically (executables require musl built libraries).

### What's debatable

It should be decided whether this toolchain should link dynamically or statically when using it on musl distribution. I believe the distributions would prefer dynamic linking but it'd be misleading because `$ARCH-unknown-linux-musl` target links statically on the other hosts.
Another problem is using `RUSTFLAGS='-C target-feature=-crt-static'` for dynamic builds which is really uncomfortable.

To address both issues I suggest leaving `$ARCH-unknown-linux-musl` static for both host and cross target and introducing "alias triple" `$ARCH-unknown-linux-dynmusl`. It'd be the same as `$ARCH-unknown-linux-musl` (and use the same libraries to avoid duplication) but it'd link dynamically.

<del>
### Why it's still WIP (help wanted)

I'm having a hard time getting all tests to pass and I'd appreciate help.

Non-verbose error:
<details>

```
Testing proc_macro stage1 (x86_64-unknown-linux-musl -> x86_64-unknown-linux-musl)
   Compiling proc_macro v0.0.0 (/checkout/src/libproc_macro)
error[E0463]: can't find crate for `std`

error[E0463]: can't find crate for `std`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
[RUSTC-TIMING] proc_macro test:true 0.529
[RUSTC-TIMING] proc_macro test:false 0.530
error: Could not compile `proc_macro`.
warning: build failed, waiting for other jobs to finish...
error: Could not compile `proc_macro`.

To learn more, run the command again with --verbose.

command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "x86_64-unknown-linux-musl" "-j" "16" "--release" "--locked" "--manifest-path" "/checkout/src/libtest/Cargo.toml" "-p" "proc_macro" "--"
expected success, got: exit code: 101

failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --host x86_64-unknown-linux-musl --target x86_64-unknown-linux-musl
```
</details>

Verbose error:
<details>

```
Testing proc_macro stage1 (x86_64-unknown-linux-musl -> x86_64-unknown-linux-musl)
   Compiling proc_macro v0.0.0 (/checkout/src/libproc_macro)
     Running `/checkout/obj/build/bootstrap/debug/rustc --edition=2018 --crate-name proc_macro src/libproc_macro/lib.rs --color never --crate-type lib --emit=dep-info,link -C opt-level=2 -C metadata=09ddd3ecc930ab63 -C extra-filename=-09ddd3ecc930ab63 --out-dir /checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/x86_64-unknown-linux-musl/release/deps --target x86_64-unknown-linux-musl -L dependency=/checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/x86_64-unknown-linux-musl/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/release/deps -C target-feature=-crt-static`
     Running `/checkout/obj/build/bootstrap/debug/rustc --edition=2018 --crate-name proc_macro src/libproc_macro/lib.rs --color never --emit=dep-info,link -C opt-level=2 --test -C metadata=a564d363930469c8 -C extra-filename=-a564d363930469c8 --out-dir /checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/x86_64-unknown-linux-musl/release/deps --target x86_64-unknown-linux-musl -L dependency=/checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/x86_64-unknown-linux-musl/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/release/deps -C target-feature=-crt-static`
error[E0463]: can't find crate for `std`
error[E0463]: can't find crate for `std`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
[RUSTC-TIMING] proc_macro test:false 0.248
error: Could not compile `proc_macro`.

Caused by:
  process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --edition=2018 --crate-name proc_macro src/libproc_macro/lib.rs --color never --crate-type lib --emit=dep-info,link -C opt-level=2 -C metadata=09ddd3ecc930ab63 -C extra-filename=-09ddd3ecc930ab63 --out-dir /checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/x86_64-unknown-linux-musl/release/deps --target x86_64-unknown-linux-musl -L dependency=/checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/x86_64-unknown-linux-musl/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/release/deps -C target-feature=-crt-static` (exit code: 1)
warning: build failed, waiting for other jobs to finish...
[RUSTC-TIMING] proc_macro test:true 0.248
error: Could not compile `proc_macro`.

Caused by:
  process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --edition=2018 --crate-name proc_macro src/libproc_macro/lib.rs --color never --emit=dep-info,link -C opt-level=2 --test -C metadata=a564d363930469c8 -C extra-filename=-a564d363930469c8 --out-dir /checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/x86_64-unknown-linux-musl/release/deps --target x86_64-unknown-linux-musl -L dependency=/checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/x86_64-unknown-linux-musl/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-musl/stage1-test/release/deps -C target-feature=-crt-static` (exit code: 1)

command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "x86_64-unknown-linux-musl" "-j" "16" "--release" "--locked" "--manifest-path" "/checkout/src/libtest/Cargo.toml" "--verbose" "-p" "proc_macro" "--"
expected success, got: exit code: 101

failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --host x86_64-unknown-linux-musl --target x86_64-unknown-linux-musl
```

</details>

Whole tests non-verbose output: [rust-tests.log](https://github.com/rust-lang/rust/files/2879945/rust-tests.log)

I think the error is because build system (correctly?) tries to use `obj/build/x86_64-unknown-linux-musl/stage1-test/x86_64-unknown-linux-musl/release/deps` which is empty but `obj/build/x86_64-unknown-linux-gnu/stage1-test/x86_64-unknown-linux-musl/release/deps` contains required libs.
</del>

5 years agorustc: move the FORCE_IMPL_FILENAME_LINE handling into LocalPathPrinter.
Eduard-Mihai Burtescu [Wed, 12 Dec 2018 16:28:29 +0000 (18:28 +0200)]
rustc: move the FORCE_IMPL_FILENAME_LINE handling into LocalPathPrinter.

5 years agorustc: explicitly pass the namespace to PrintCx::parameterized.
Eduard-Mihai Burtescu [Wed, 12 Dec 2018 13:12:48 +0000 (15:12 +0200)]
rustc: explicitly pass the namespace to PrintCx::parameterized.

5 years agorustc: move the formatter into ty::print::PrintCx.
Eduard-Mihai Burtescu [Mon, 10 Dec 2018 14:10:22 +0000 (16:10 +0200)]
rustc: move the formatter into ty::print::PrintCx.

5 years agorustc: add a ty::RegionKind::display_outputs_anything method to avoid printing to...
Eduard-Mihai Burtescu [Wed, 12 Dec 2018 07:47:45 +0000 (09:47 +0200)]
rustc: add a ty::RegionKind::display_outputs_anything method to avoid printing to a string.

5 years agorustc: always rely on '_ to be not printed by ty::Region itself.
Eduard-Mihai Burtescu [Mon, 10 Dec 2018 15:36:24 +0000 (17:36 +0200)]
rustc: always rely on '_ to be not printed by ty::Region itself.

5 years agorustc: remove ty::item_path::RootMode by moving local logic into the printer.
Eduard-Mihai Burtescu [Mon, 10 Dec 2018 10:59:08 +0000 (12:59 +0200)]
rustc: remove ty::item_path::RootMode by moving local logic into the printer.

5 years agorustc: rewrite ty::item_path to be more functional than mutation-oriented.
Eduard-Mihai Burtescu [Sun, 9 Dec 2018 19:05:22 +0000 (21:05 +0200)]
rustc: rewrite ty::item_path to be more functional than mutation-oriented.

5 years agorustc_codegen_utils: revert some symbol_names refactors (while keeping the functional...
Eduard-Mihai Burtescu [Sun, 3 Feb 2019 10:24:29 +0000 (12:24 +0200)]
rustc_codegen_utils: revert some symbol_names refactors (while keeping the functional changes).

5 years agorustc: support impl's in PrintCx::parameterized.
Eduard-Mihai Burtescu [Sun, 9 Dec 2018 15:54:18 +0000 (17:54 +0200)]
rustc: support impl's in PrintCx::parameterized.

5 years agorustc: rewrite PrintCx::parameterized to be much simpler and more general.
Eduard-Mihai Burtescu [Sat, 8 Dec 2018 09:26:34 +0000 (11:26 +0200)]
rustc: rewrite PrintCx::parameterized to be much simpler and more general.

5 years agorustc: use define_print! to implement fmt::{Display,Debug} for Kind.
Eduard-Mihai Burtescu [Fri, 7 Dec 2018 23:13:23 +0000 (01:13 +0200)]
rustc: use define_print! to implement fmt::{Display,Debug} for Kind.

5 years agorustc: tie the 'tcx between Print and PrintCx in ty::print.
Eduard-Mihai Burtescu [Fri, 7 Dec 2018 15:40:23 +0000 (17:40 +0200)]
rustc: tie the 'tcx between Print and PrintCx in ty::print.

5 years agorustc: implement fmt::{Debug,Display} on Ty instead of TyS.
Eduard-Mihai Burtescu [Fri, 7 Dec 2018 18:10:47 +0000 (20:10 +0200)]
rustc: implement fmt::{Debug,Display} on Ty instead of TyS.

5 years agorustc: remove fmt::{Debug,Display} from ty::TyKind.
Eduard-Mihai Burtescu [Fri, 7 Dec 2018 17:14:30 +0000 (19:14 +0200)]
rustc: remove fmt::{Debug,Display} from ty::TyKind.

5 years agorustc: keep a TyCtxt in PrintCx and use it instead of ty::tls.
Eduard-Mihai Burtescu [Fri, 7 Dec 2018 13:22:50 +0000 (15:22 +0200)]
rustc: keep a TyCtxt in PrintCx and use it instead of ty::tls.

5 years agorustc: rename PrintContext to PrintCx.
Eduard-Mihai Burtescu [Fri, 7 Dec 2018 14:17:44 +0000 (16:17 +0200)]
rustc: rename PrintContext to PrintCx.

5 years agorustc: don't support missing TLS TyCtxt in ty::print.
Eduard-Mihai Burtescu [Tue, 4 Dec 2018 18:04:21 +0000 (20:04 +0200)]
rustc: don't support missing TLS TyCtxt in ty::print.

5 years agorustc: don't support `tcx.lift` returning `None` in ppaux.
Eduard-Mihai Burtescu [Tue, 4 Dec 2018 17:35:48 +0000 (19:35 +0200)]
rustc: don't support `tcx.lift` returning `None` in ppaux.

5 years agorustc: uniformize all lift expect messages to "could not lift for printing".
Eduard-Mihai Burtescu [Tue, 4 Dec 2018 17:25:17 +0000 (19:25 +0200)]
rustc: uniformize all lift expect messages to "could not lift for printing".

5 years agorustc: add a 'tcx parameter to Print.
Eduard-Mihai Burtescu [Tue, 4 Dec 2018 17:13:55 +0000 (19:13 +0200)]
rustc: add a 'tcx parameter to Print.

5 years agorustc: start moving util::ppaux to ty::print.
Eduard-Mihai Burtescu [Tue, 4 Dec 2018 17:13:37 +0000 (19:13 +0200)]
rustc: start moving util::ppaux to ty::print.

5 years agorustc: remove unnecessary extern_prelude logic from ty::item_path.
Eduard-Mihai Burtescu [Sun, 9 Dec 2018 20:42:08 +0000 (22:42 +0200)]
rustc: remove unnecessary extern_prelude logic from ty::item_path.

5 years agoAuto merge of #58710 - EdorianDark:master, r=sfackler
bors [Fri, 15 Mar 2019 06:23:21 +0000 (06:23 +0000)]
Auto merge of #58710 - EdorianDark:master, r=sfackler

Add clamp for ranges. Implements #44095

Ready for merge

5 years agoOutput diagnostic information for rustdoc.
O01eg [Fri, 15 Mar 2019 05:50:08 +0000 (08:50 +0300)]
Output diagnostic information for rustdoc.

Use the information same as rustc.

5 years agoFix TARGET variable in musl-toolchain.sh
Mateusz Mikuła [Fri, 15 Mar 2019 00:19:54 +0000 (01:19 +0100)]
Fix TARGET variable in musl-toolchain.sh

5 years agoAdd `-Z allow_features=...` flag
Tyler Mandry [Wed, 13 Mar 2019 23:29:24 +0000 (16:29 -0700)]
Add `-Z allow_features=...` flag

5 years agoAdd support for comma-separated option lists
Tyler Mandry [Thu, 14 Mar 2019 22:05:49 +0000 (15:05 -0700)]
Add support for comma-separated option lists

5 years agoUpdate sources.rs
lukaslueg [Thu, 14 Mar 2019 16:06:46 +0000 (17:06 +0100)]
Update sources.rs

The current language may be amusing, yet is just imprecise and most especially difficult to understand for someone who speaks English as a foreign language.

5 years agoAddress final review
Mateusz Mikuła [Thu, 14 Mar 2019 15:55:47 +0000 (16:55 +0100)]
Address final review

5 years agoAuto merge of #59181 - RalfJung:miri, r=oli-obk
bors [Thu, 14 Mar 2019 15:37:26 +0000 (15:37 +0000)]
Auto merge of #59181 - RalfJung:miri, r=oli-obk

update miri

Fixes https://github.com/rust-lang/rust/issues/59059

r? @oli-obk

5 years agoupdate miri
Ralf Jung [Thu, 14 Mar 2019 14:25:23 +0000 (15:25 +0100)]
update miri

5 years agoUse try blocks in rustc_codegen_ssa
Taiki Endo [Thu, 14 Mar 2019 14:12:56 +0000 (23:12 +0900)]
Use try blocks in rustc_codegen_ssa

5 years agoAuto merge of #58176 - Zoxc:lint-levels, r=oli-obk
bors [Thu, 14 Mar 2019 12:09:13 +0000 (12:09 +0000)]
Auto merge of #58176 - Zoxc:lint-levels, r=oli-obk

Only insert nodes which changes lint levels in the LintLevelMap

r? @eddyb

5 years agoAuto merge of #58488 - wesleywiser:llvm_prof, r=michaelwoerister
bors [Thu, 14 Mar 2019 08:38:56 +0000 (08:38 +0000)]
Auto merge of #58488 - wesleywiser:llvm_prof, r=michaelwoerister

Replace TimeLine LLVM profiling with the self profiler

5 years agoRun RustdocUi earlier
John Kåre Alsaker [Thu, 14 Mar 2019 05:35:48 +0000 (06:35 +0100)]
Run RustdocUi earlier

5 years agoDon't run test launching `echo` since that doesn't exist on Windows
John Kåre Alsaker [Thu, 14 Mar 2019 04:53:44 +0000 (05:53 +0100)]
Don't run test launching `echo` since that doesn't exist on Windows

5 years agobootstrap: Default to a sensible llvm-suffix.
Emilio Cobos Álvarez [Thu, 14 Mar 2019 01:23:08 +0000 (02:23 +0100)]
bootstrap: Default to a sensible llvm-suffix.

I used version-channel-sha, hopefully that should work.

I checked that bootstrap builds, but I cannot check anything else since the llvm
build process is started from cargo, and thus calls clang, and thus I hit the
same bug I hope to fix with this change.

Hopefully fixes #59034.

5 years agoAuto merge of #59120 - alexreg:move-issue-tests-1, r=varkor
bors [Thu, 14 Mar 2019 01:28:18 +0000 (01:28 +0000)]
Auto merge of #59120 - alexreg:move-issue-tests-1, r=varkor

Moved issue tests to subdirs and normalised names

Consistency, decluttering, ease of navigation :-)

r? @Centril

5 years agoMoved issue tests to subdirs and normalised names.
Alexander Regueiro [Tue, 12 Mar 2019 00:49:17 +0000 (00:49 +0000)]
Moved issue tests to subdirs and normalised names.

5 years agoFinal cleanups
Mateusz Mikuła [Wed, 13 Mar 2019 21:18:13 +0000 (22:18 +0100)]
Final cleanups

5 years agoMove testing to test-various
Mateusz Mikuła [Tue, 12 Mar 2019 16:15:03 +0000 (17:15 +0100)]
Move testing to test-various

5 years agoDisable relax relocations again
Mateusz Mikuła [Mon, 4 Mar 2019 13:00:05 +0000 (14:00 +0100)]
Disable relax relocations again

5 years agoDrop copyright notice from musl-toolchain
Mateusz Mikuła [Sat, 10 Feb 2018 13:03:13 +0000 (14:03 +0100)]
Drop copyright notice from musl-toolchain

5 years agomusl: update LLVM to 7
Mateusz Mikuła [Fri, 11 Jan 2019 17:45:37 +0000 (18:45 +0100)]
musl: update LLVM to 7

5 years agoAddress review comments
Martell Malone [Sat, 5 Jan 2019 20:59:46 +0000 (12:59 -0800)]
Address review comments

5 years agomusl-toolchain: fix global lib paths (dont create /lib/libc.so)
Jonathan Sieber [Tue, 27 Nov 2018 19:56:34 +0000 (20:56 +0100)]
musl-toolchain: fix global lib paths (dont create /lib/libc.so)

5 years agoMake the musl dynamic loader known to the system, so it can execute target binaries
Jonathan Sieber [Fri, 19 Oct 2018 20:28:34 +0000 (20:28 +0000)]
Make the musl dynamic loader known to the system, so it can execute target binaries

5 years agobuild a proper c++-enabled musl toolchain with musl-cross-make
Jonathan Sieber [Fri, 19 Oct 2018 19:04:33 +0000 (19:04 +0000)]
build a proper c++-enabled musl toolchain with musl-cross-make

5 years agoSet RUSTFLAGS env to make dylib work
Jonathan Sieber [Thu, 18 Oct 2018 19:47:26 +0000 (21:47 +0200)]
Set RUSTFLAGS env to make dylib work

The musl-target doesn't automatically disable static linking of musl when building a dylib, and then complains it can't build a dylib.
As a workaround, disable static linking via RUSTFLAGS, to see how far the build gets.
The proper fix is to have rustc figure that out automagically.

5 years agoEnable dist-x86_64-musl as a host architexture
JonathanS [Wed, 17 Oct 2018 20:13:21 +0000 (22:13 +0200)]
Enable dist-x86_64-musl as a host architexture

5 years agoadd suggestions to invalid macro item error
Andy Russell [Mon, 11 Mar 2019 01:01:53 +0000 (21:01 -0400)]
add suggestions to invalid macro item error

5 years agoAuto merge of #59143 - ehuss:update-cargo, r=ehuss
bors [Wed, 13 Mar 2019 18:26:45 +0000 (18:26 +0000)]
Auto merge of #59143 - ehuss:update-cargo, r=ehuss

Update cargo

6 commits in 95b45eca19ac785263fed98ecefe540bb47337ac..0e35bd8af0ec72d3225c4819b330b94628f0e9d0
2019-03-06 19:24:30 +0000 to 2019-03-13 06:52:51 +0000
- Make `hg` optional for tests. (rust-lang/cargo#6739)
- Fingerprint build script deps only for path packages. (rust-lang/cargo#6734)
- Add --quiet option for `cargo test` (rust-lang/cargo#6358)
- .gitignore should end with a newline. (rust-lang/cargo#6732)
- Emit warning on misspelled environment variables (rust-lang/cargo#6694)
- Update glob requirement from 0.2.11 to 0.3.0 (rust-lang/cargo#6724)

5 years agoUpdate cargo
Eric Huss [Tue, 12 Mar 2019 20:34:47 +0000 (13:34 -0700)]
Update cargo

5 years agoAuto merge of #58349 - petrochenkov:uni201x, r=pnkfelix
bors [Wed, 13 Mar 2019 14:59:05 +0000 (14:59 +0000)]
Auto merge of #58349 - petrochenkov:uni201x, r=pnkfelix

resolve: Simplify import resolution for mixed 2015/2018 edition mode

Non-controversial part of https://github.com/rust-lang/rust/pull/57745.

Before:

| Local edition (per-span) | Global edition (--edition) | Imports (`use foo;`)                                 | Absolute paths (`::foo`)                                 |
| ------------- |----------------|-----------------------------------------|------------------------------------------------|
| 2018          | Any            | Uniform                                 | Extern prelude                                 |
| 2015          | 2015           | Crate-relative                          | Crate-relative                                 |
| 2015          | 2018           | Crate-relative with fallback to Uniform (future-proofed to error if the result is not Crate-relative or from Extern prelude) | Crate-relative with fallback to Extern prelude |

After:

| Local edition (per-span) | Global edition (--edition) | Imports (`use foo;`)                                 | Absolute paths (`::foo`)                                 |
| ------------- |----------------|-----------------------------------------|------------------------------------------------|
| 2018          | Any            | Uniform                                 | Extern prelude                                 |
| 2015          | 2015           | Crate-relative                          | Crate-relative                                 |
| 2015          | 2018           | Crate-relative with fallback to Extern prelude | Crate-relative with fallback to Extern prelude |

I.e. only the behavior of the mixed local-2015-global-2018 mode is changed.
This mixed mode has two goals:
- Address regressions from https://github.com/rust-lang/rust/pull/56053#issuecomment-440826397.
Both "before" and "after" variants address those regressions.
- Be retrofit-able to "full 2015" edition (https://github.com/rust-lang/rust/pull/57745).
Any more complex fallback scheme (with more candidates) than "Crate-relative with fallback to Extern prelude" will give more regressions than https://github.com/rust-lang/rust/pull/57745#issuecomment-455855089 and is therefore less retrofit-able while also being, well, more complex.
So, we can settle on "Crate-relative with fallback to Extern prelude".

(I'll hopefully proceed with https://github.com/rust-lang/rust/pull/57745 after mid-February.)

r? @Centril

5 years agoRevert "Don't generate minification variable if minification disabled"
Manish Goregaokar [Wed, 13 Mar 2019 14:39:07 +0000 (07:39 -0700)]
Revert "Don't generate minification variable if minification disabled"

Fixes #59157

This reverts commit b5ae4d58883151a977487de86856d9529df9d948.

5 years agoFix generic argument lookup for Self
Angelos Oikonomopoulos [Thu, 7 Mar 2019 17:30:26 +0000 (18:30 +0100)]
Fix generic argument lookup for Self

Rewrite the SelfCtor early and use the replacement Def when
calculating the path_segs.

Note that this also changes which def is seen by the code that
computes user_self_ty and is_alias_variant_ctor; I don't see a
immediate issue with that, but I'm not 100% clear on the
implications.

Fixes #57924

5 years agoAdd test for #55809.
David Wood [Wed, 13 Mar 2019 11:38:10 +0000 (12:38 +0100)]
Add test for #55809.

This commit adds a regression test for #55809 which checks that a
overflow does not occur when evaluating a requirement for async
functions and `&mut` arguments in some specific circumstances.

5 years agoAuto merge of #56864 - Zoxc:stable-hash-macro, r=michaelwoerister
bors [Wed, 13 Mar 2019 11:36:46 +0000 (11:36 +0000)]
Auto merge of #56864 - Zoxc:stable-hash-macro, r=michaelwoerister

Use derive macro for HashStable

Blocked on https://github.com/rust-lang/rust/pull/56795

5 years agoStabilize Range*::contains.
Steven Malis [Wed, 13 Mar 2019 04:00:37 +0000 (21:00 -0700)]
Stabilize Range*::contains.

5 years agoAuto merge of #59151 - Centril:rollup, r=Centril
bors [Wed, 13 Mar 2019 03:30:20 +0000 (03:30 +0000)]
Auto merge of #59151 - Centril:rollup, r=Centril

Rollup of 16 pull requests

Successful merges:

 - #58829 (librustc_interface: Update scoped-tls to 1.0)
 - #58876 (Parse lifetimes that start with a number and give specific error)
 - #58908 (Update rand version)
 - #58998 (Fix documentation of from_ne_bytes and from_le_bytes)
 - #59056 (Use lifetime contravariance to elide more lifetimes in core+alloc+std)
 - #59057 (Standardize `Range*` documentation)
 - #59080 (Fix incorrect links in librustc_codegen_llvm documentation)
 - #59083 (Fix #54822 and associated faulty tests)
 - #59093 (Remove precompute_in_scope_traits_hashes)
 - #59101 (Reduces Code Repetitions like `!n >> amt`)
 - #59121 (impl FromIterator for Result: Use assert_eq! instead of assert!)
 - #59124 (Replace assert with assert_eq)
 - #59129 (Visit impl Trait for dead_code lint)
 - #59130 (Note that NonNull does not launder shared references for mutation)
 - #59132 (ignore higher-ranked object bound conditions created by WF)
 - #59138 (Simplify Iterator::{min, max})

Failed merges:

r? @ghost

5 years agoRollup merge of #59138 - timvermeulen:simplify_select_fold1, r=sfackler
Mazdak Farrokhzad [Wed, 13 Mar 2019 02:33:57 +0000 (03:33 +0100)]
Rollup merge of #59138 - timvermeulen:simplify_select_fold1, r=sfackler

Simplify Iterator::{min, max}

This PR simplifies the `select_fold1` helper method used to implmement `Iterator::{min, min_by, min_by_key, max, max_by, max_by_key}` by removing the projection argument, which was only used by the implementations of `min_by_key` and `max_by_key`.

I also added tests to ensure that the stability as mentioned in the comments of `min` and `max` is preserved, and fixed the `iter::{bench_max, bench_max_by_key}` benchmarks which the compiler presumably was able to collapse into closed-form expressions. None of the benchmark results were impacted, I suspect their generated assembly didn't change.

5 years agoRollup merge of #59132 - nikomatsakis:issue-53548-generator-bound, r=pnkfelix
Mazdak Farrokhzad [Wed, 13 Mar 2019 02:33:56 +0000 (03:33 +0100)]
Rollup merge of #59132 - nikomatsakis:issue-53548-generator-bound, r=pnkfelix

ignore higher-ranked object bound conditions created by WF

In the `issue-53548` test added in this PR, the `Box<dyn Trait>` type is expanded to `Box<dyn Trait + 'static>`, but the generator "witness" that results is `for<'r> { Box<dyn Trait + 'r> }`. The WF code was encountering an ICE (when debug-assertions were enabled) and an unexpected compilation error (without debug-asserions) when trying to process this `'r` region bound. In particular, to be WF, the region bound must meet the requirements of the trait, and hence we got `for<'r> { 'r: 'static }`. This would ICE because the `Binder` constructor we were using was assering that no higher-ranked regions were involved (because the WF code is supposed to skip those). The error (if debug-asserions were disabled) came because we obviously cannot prove that `'r: 'static` for any region `'r`.  Pursuant with
our "lazy WF" strategy for higher-ranked regions, the fix is not to require that `for<'r> { 'r: 'static }` holds (this is also analogous to what we would do for higher-ranked regions appearing within the trait in other positions).

Fixes #53548

r? @pnkfelix

5 years agoRollup merge of #59130 - RalfJung:non-null, r=rkruppe
Mazdak Farrokhzad [Wed, 13 Mar 2019 02:33:54 +0000 (03:33 +0100)]
Rollup merge of #59130 - RalfJung:non-null, r=rkruppe

Note that NonNull does not launder shared references for mutation

See https://users.rust-lang.org/t/relative-pointer-an-abstraction-to-build-movable-self-referential-types/26186/6

5 years agoRollup merge of #59129 - sanxiyn:visit-impl-trait, r=varkor
Mazdak Farrokhzad [Wed, 13 Mar 2019 02:33:53 +0000 (03:33 +0100)]
Rollup merge of #59129 - sanxiyn:visit-impl-trait, r=varkor

Visit impl Trait for dead_code lint

Fix #59085.

5 years agoRollup merge of #59124 - sntdevco:master, r=Centril
Mazdak Farrokhzad [Wed, 13 Mar 2019 02:33:51 +0000 (03:33 +0100)]
Rollup merge of #59124 - sntdevco:master, r=Centril

Replace assert with assert_eq

Use `assert_eq!` instead of `assert!` for the tests

5 years agoRollup merge of #59121 - czipperz:fix_assert_result_fromiterater, r=Centril
Mazdak Farrokhzad [Wed, 13 Mar 2019 02:33:50 +0000 (03:33 +0100)]
Rollup merge of #59121 - czipperz:fix_assert_result_fromiterater, r=Centril

impl FromIterator for Result: Use assert_eq! instead of assert!

5 years agoRollup merge of #59101 - kenta7777:reduce-code-repetition, r=oli-obk
Mazdak Farrokhzad [Wed, 13 Mar 2019 02:33:49 +0000 (03:33 +0100)]
Rollup merge of #59101 - kenta7777:reduce-code-repetition, r=oli-obk

Reduces Code Repetitions like `!n >> amt`

Fixes #49937 .
This PR contains defining a function which operates bit inversion and reducing bit operation like `!0u128 >> (128 - size.bits())`.

5 years agoRollup merge of #59093 - Zoxc:no-prealloc, r=michaelwoerister
Mazdak Farrokhzad [Wed, 13 Mar 2019 02:33:47 +0000 (03:33 +0100)]
Rollup merge of #59093 - Zoxc:no-prealloc, r=michaelwoerister

Remove precompute_in_scope_traits_hashes

r? @michaelwoerister

5 years agoRollup merge of #59083 - kyren:master, r=varkor
Mazdak Farrokhzad [Wed, 13 Mar 2019 02:33:46 +0000 (03:33 +0100)]
Rollup merge of #59083 - kyren:master, r=varkor

Fix #54822 and associated faulty tests

Type checking associated constants can require trait bounds, but an empty
parameter environment was provided to the trait solver.  Providing an
appropriate parameter environment seems to fix #54822 and also make one of the
cases in src/test/ui/nll/trait-associated-constant.rs that should compile
successfully do so.  It also (slightly) improves the error message in
src/test/ui/associated-const/associated-const-generic-obligations.rs

5 years agoRollup merge of #59080 - nbaksalyar:fix-llvm-codegen-doc, r=frewsxcv
Mazdak Farrokhzad [Wed, 13 Mar 2019 02:33:44 +0000 (03:33 +0100)]
Rollup merge of #59080 - nbaksalyar:fix-llvm-codegen-doc, r=frewsxcv

Fix incorrect links in librustc_codegen_llvm documentation

5 years agoRollup merge of #59057 - czipperz:standardize_range_documentation, r=shepmaster
Mazdak Farrokhzad [Wed, 13 Mar 2019 02:33:43 +0000 (03:33 +0100)]
Rollup merge of #59057 - czipperz:standardize_range_documentation, r=shepmaster

Standardize `Range*` documentation

This updates the final example in the documentation for the types
`Range`, `RangeFrom`, `RangeFull`, `RangeInclusive`, `RangeTo`,
`RangeToInclusive`.

5 years agoRollup merge of #59056 - scottmcm:even-fewer-lifetimes, r=sfackler
Mazdak Farrokhzad [Wed, 13 Mar 2019 02:33:41 +0000 (03:33 +0100)]
Rollup merge of #59056 - scottmcm:even-fewer-lifetimes, r=sfackler

Use lifetime contravariance to elide more lifetimes in core+alloc+std

Sample:
```diff
-    impl<'a, 'b, A: ?Sized, B: ?Sized> PartialEq<&'b mut B> for &'a mut A where A: PartialEq<B> {
+    impl<A: ?Sized, B: ?Sized> PartialEq<&mut B> for &mut A where A: PartialEq<B> {
         #[inline]
-        fn eq(&self, other: &&'b mut B) -> bool { PartialEq::eq(*self, *other) }
+        fn eq(&self, other: &&mut B) -> bool { PartialEq::eq(*self, *other) }
         #[inline]
-        fn ne(&self, other: &&'b mut B) -> bool { PartialEq::ne(*self, *other) }
+        fn ne(&self, other: &&mut B) -> bool { PartialEq::ne(*self, *other) }
     }
```

[I didn't know this worked](https://internals.rust-lang.org/t/why-can-you-use-different-unconstrained-lifetimes-to-implement-traits/9544/2?u=scottmcm) until recently, but since defining methods contravariantly in their lifetimes this way has worked back to Rust 1.0, we might as well take advantage of combining it with IHLE.

5 years agoRollup merge of #58998 - xTibor:doc_from_bytes, r=scottmcm
Mazdak Farrokhzad [Wed, 13 Mar 2019 02:33:39 +0000 (03:33 +0100)]
Rollup merge of #58998 - xTibor:doc_from_bytes, r=scottmcm

Fix documentation of from_ne_bytes and from_le_bytes

Copypasta mistake, the documentation of `from_ne_bytes` and `from_le_bytes` used the big-endian variant in the example snippets.

5 years agoRollup merge of #58908 - JohnTitor:improve-rand, r=scottmcm
Mazdak Farrokhzad [Wed, 13 Mar 2019 02:33:37 +0000 (03:33 +0100)]
Rollup merge of #58908 - JohnTitor:improve-rand, r=scottmcm

Update rand version

cc: #57724

r? @scottmcm

5 years agoRollup merge of #58876 - estebank:numeric-lifetime, r=petrochenkov
Mazdak Farrokhzad [Wed, 13 Mar 2019 02:33:36 +0000 (03:33 +0100)]
Rollup merge of #58876 - estebank:numeric-lifetime, r=petrochenkov

Parse lifetimes that start with a number and give specific error

Fix #58786.

5 years agoRollup merge of #58829 - Xanewok:scoped-tls, r=Zoxc
Mazdak Farrokhzad [Wed, 13 Mar 2019 02:33:34 +0000 (03:33 +0100)]
Rollup merge of #58829 - Xanewok:scoped-tls, r=Zoxc

librustc_interface: Update scoped-tls to 1.0

Done previously as a part of https://github.com/rust-lang/rust/pull/58748.

r? @Zoxc

5 years agoSuggest adding lifetime to struct field
Esteban Küber [Wed, 13 Mar 2019 01:18:24 +0000 (18:18 -0700)]
Suggest adding lifetime to struct field

5 years agoMake std time tests more robust for platform differences
Jethro Beekman [Tue, 12 Mar 2019 23:09:20 +0000 (16:09 -0700)]
Make std time tests more robust for platform differences

5 years agoAdd missing project attributes
John Kåre Alsaker [Tue, 12 Mar 2019 23:08:36 +0000 (00:08 +0100)]
Add missing project attributes

5 years agoUse derive macro for HashStable
John Kåre Alsaker [Mon, 3 Dec 2018 00:14:35 +0000 (01:14 +0100)]
Use derive macro for HashStable

5 years agoFix newtype_index
John Kåre Alsaker [Sat, 9 Mar 2019 21:04:00 +0000 (22:04 +0100)]
Fix newtype_index

5 years agoreview comments
Esteban Küber [Tue, 12 Mar 2019 22:34:16 +0000 (15:34 -0700)]
review comments

5 years agoRename test struct names to something more sensible
kyren [Tue, 12 Mar 2019 22:33:27 +0000 (18:33 -0400)]
Rename test struct names to something more sensible

5 years agoAuto merge of #58743 - varkor:bulk-needstest-1, r=alexcrichton
bors [Tue, 12 Mar 2019 22:15:07 +0000 (22:15 +0000)]
Auto merge of #58743 - varkor:bulk-needstest-1, r=alexcrichton

Add tests for several E-needstest issues

This PR adds a number of tests for various `E-needstest` errors. These tend to have been left open for a long time and seem unlikely to be closed otherwise.

Closes https://github.com/rust-lang/rust/issues/10876.
Closes https://github.com/rust-lang/rust/issues/26448.
Closes https://github.com/rust-lang/rust/issues/26577.
Closes https://github.com/rust-lang/rust/issues/26619.
Closes https://github.com/rust-lang/rust/issues/27054.
Closes https://github.com/rust-lang/rust/issues/44127.
Closes https://github.com/rust-lang/rust/issues/44255.
Closes https://github.com/rust-lang/rust/issues/55731.
Closes https://github.com/rust-lang/rust/issues/57781.

5 years agoSuggest return lifetime when there's only one named lifetime
Esteban Küber [Tue, 12 Mar 2019 21:57:13 +0000 (14:57 -0700)]
Suggest return lifetime when there's only one named lifetime

5 years agorustc: fix ICE when trait alias has bare Self
Sean McArthur [Mon, 11 Mar 2019 23:39:40 +0000 (16:39 -0700)]
rustc: fix ICE when trait alias has bare Self

5 years agoForward `max` and `min` to `max_by` and `min_by` respectively
Tim Vermeulen [Tue, 12 Mar 2019 19:24:10 +0000 (20:24 +0100)]
Forward `max` and `min` to `max_by` and `min_by` respectively

5 years agoRemove compiletest comments from tests
varkor [Tue, 12 Mar 2019 19:06:13 +0000 (19:06 +0000)]
Remove compiletest comments from tests

5 years agoAuto merge of #58015 - icefoxen:tryfrom-docs, r=SimonSapin
bors [Tue, 12 Mar 2019 18:58:23 +0000 (18:58 +0000)]
Auto merge of #58015 - icefoxen:tryfrom-docs, r=SimonSapin

Expand docs for `TryFrom` and `TryInto`.

The examples are still lacking for now, both for module docs and for methods/impl's.  Will be adding those in further pushes.

Should hopefully resolve the doc concern in #33417 when finished?

5 years agoresolve: Simplify import resolution for mixed 2015/2018 edition mode
Vadim Petrochenkov [Wed, 16 Jan 2019 23:17:22 +0000 (02:17 +0300)]
resolve: Simplify import resolution for mixed 2015/2018 edition mode

5 years agoAdd NLL test error output
varkor [Mon, 11 Mar 2019 23:06:34 +0000 (23:06 +0000)]
Add NLL test error output

5 years agoRemove invalid ASM tests
varkor [Sat, 9 Mar 2019 17:02:11 +0000 (17:02 +0000)]
Remove invalid ASM tests

These still fail on some architectures.

5 years agoIgnore WASM on asm tests
varkor [Sat, 2 Mar 2019 12:47:39 +0000 (12:47 +0000)]
Ignore WASM on asm tests

5 years agoUpdate test for issue #55731
varkor [Tue, 26 Feb 2019 20:56:52 +0000 (20:56 +0000)]
Update test for issue #55731

5 years agoAdd a test for #27054
varkor [Mon, 25 Feb 2019 23:57:08 +0000 (23:57 +0000)]
Add a test for #27054

5 years agoAdd a test for #26577
varkor [Mon, 25 Feb 2019 23:56:53 +0000 (23:56 +0000)]
Add a test for #26577

5 years agoAdd a test for #28587
varkor [Mon, 25 Feb 2019 23:56:27 +0000 (23:56 +0000)]
Add a test for #28587

5 years agoAdd a test for #22892
varkor [Mon, 25 Feb 2019 23:56:10 +0000 (23:56 +0000)]
Add a test for #22892