Commit Graph

90739 Commits

Author SHA1 Message Date
Ralf Jung
51bbf30698 update miri 2019-03-14 15:25:23 +01:00
bors
2a8f6a7806 Auto merge of #58488 - wesleywiser:llvm_prof, r=michaelwoerister
Replace TimeLine LLVM profiling with the self profiler
2019-03-14 08:38:56 +00:00
bors
0ad3207745 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
2019-03-14 01:28:18 +00:00
Alexander Regueiro
fe30743c79 Moved issue tests to subdirs and normalised names. 2019-03-14 01:00:49 +00:00
bors
719b0d9849 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)
2019-03-13 18:26:45 +00:00
Eric Huss
4543245621 Update cargo 2019-03-13 08:00:43 -07:00
bors
8bf1f1c8f4 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
2019-03-13 14:59:05 +00:00
bors
cf6d881ac1 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
2019-03-13 11:36:46 +00:00
bors
aa97448caf 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
2019-03-13 03:30:20 +00:00
Mazdak Farrokhzad
73feddb9d4
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.
2019-03-13 03:33:57 +01:00
Mazdak Farrokhzad
c22566d96d
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
2019-03-13 03:33:56 +01:00
Mazdak Farrokhzad
3623c1ac4e
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
2019-03-13 03:33:54 +01:00
Mazdak Farrokhzad
b70a98f261
Rollup merge of #59129 - sanxiyn:visit-impl-trait, r=varkor
Visit impl Trait for dead_code lint

Fix #59085.
2019-03-13 03:33:53 +01:00
Mazdak Farrokhzad
f3dc046362
Rollup merge of #59124 - sntdevco:master, r=Centril
Replace assert with assert_eq

Use `assert_eq!` instead of `assert!` for the tests
2019-03-13 03:33:51 +01:00
Mazdak Farrokhzad
106159dd06
Rollup merge of #59121 - czipperz:fix_assert_result_fromiterater, r=Centril
impl FromIterator for Result: Use assert_eq! instead of assert!
2019-03-13 03:33:50 +01:00
Mazdak Farrokhzad
6c9bdc3410
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())`.
2019-03-13 03:33:49 +01:00
Mazdak Farrokhzad
f95bbf3da3
Rollup merge of #59093 - Zoxc:no-prealloc, r=michaelwoerister
Remove precompute_in_scope_traits_hashes

r? @michaelwoerister
2019-03-13 03:33:47 +01:00
Mazdak Farrokhzad
c0dcfedd9f
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
2019-03-13 03:33:46 +01:00
Mazdak Farrokhzad
13a894288f
Rollup merge of #59080 - nbaksalyar:fix-llvm-codegen-doc, r=frewsxcv
Fix incorrect links in librustc_codegen_llvm documentation
2019-03-13 03:33:44 +01:00
Mazdak Farrokhzad
1008150b1c
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`.
2019-03-13 03:33:43 +01:00
Mazdak Farrokhzad
68abd9a999
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.
2019-03-13 03:33:41 +01:00
Mazdak Farrokhzad
fc19f0e75b
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.
2019-03-13 03:33:39 +01:00
Mazdak Farrokhzad
2049d6f4d4
Rollup merge of #58908 - JohnTitor:improve-rand, r=scottmcm
Update rand version

cc: #57724

r? @scottmcm
2019-03-13 03:33:37 +01:00
Mazdak Farrokhzad
ad7b650815
Rollup merge of #58876 - estebank:numeric-lifetime, r=petrochenkov
Parse lifetimes that start with a number and give specific error

Fix #58786.
2019-03-13 03:33:36 +01:00
Mazdak Farrokhzad
445c4bc0f8
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
2019-03-13 03:33:34 +01:00
John Kåre Alsaker
bc3a84a7f3 Add missing project attributes 2019-03-13 00:08:36 +01:00
John Kåre Alsaker
3936aff216 Use derive macro for HashStable 2019-03-13 00:03:13 +01:00
John Kåre Alsaker
48757a70a3 Fix newtype_index 2019-03-13 00:03:10 +01:00
kyren
aa9bd68fa8 Rename test struct names to something more sensible 2019-03-12 18:33:27 -04:00
bors
f8860f217d 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.
2019-03-12 22:15:07 +00:00
Tim Vermeulen
6cc5a3d9cc Forward max and min to max_by and min_by respectively 2019-03-12 20:24:10 +01:00
varkor
5b3e1be724 Remove compiletest comments from tests 2019-03-12 19:06:13 +00:00
bors
7c19e1eed5 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?
2019-03-12 18:58:23 +00:00
Vadim Petrochenkov
1d6f4d66ad resolve: Simplify import resolution for mixed 2015/2018 edition mode 2019-03-12 21:57:02 +03:00
varkor
d17da3a17e Add NLL test error output 2019-03-12 18:34:43 +00:00
varkor
57c6a0b17b Remove invalid ASM tests
These still fail on some architectures.
2019-03-12 18:34:43 +00:00
varkor
216bee499f Ignore WASM on asm tests 2019-03-12 18:34:43 +00:00
varkor
4aa5fd0806 Update test for issue #55731 2019-03-12 18:34:43 +00:00
varkor
1dea6e00de Add a test for #27054 2019-03-12 18:34:43 +00:00
varkor
b4b8a6e0bb Add a test for #26577 2019-03-12 18:34:43 +00:00
varkor
5917d9fc62 Add a test for #28587 2019-03-12 18:34:43 +00:00
varkor
295b6fd0f7 Add a test for #22892 2019-03-12 18:34:43 +00:00
varkor
e3297e7ce3 Add a test for #57781 2019-03-12 18:34:43 +00:00
varkor
b7763af526 Add a test for #55731 2019-03-12 18:34:43 +00:00
varkor
776411bb5a Add a test for #46101 2019-03-12 18:34:43 +00:00
varkor
ec56d6e5b9 Add a test for #44255 2019-03-12 18:34:43 +00:00
varkor
3f16518c05 Add a test for #44127 2019-03-12 18:34:43 +00:00
varkor
d49f4f86d9 Add a test for #26619 2019-03-12 18:34:43 +00:00
varkor
651c1abfb7 Add tests for #26448 2019-03-12 18:34:43 +00:00
varkor
5c563f98b8 Add a test for #10876 2019-03-12 18:34:42 +00:00