Commit Graph

86452 Commits

Author SHA1 Message Date
Pietro Albini
989d06a76d
Rollup merge of #55953 - blitzerr:master, r=nikomatsakis
#53488 Refactoring UpvarId
2018-11-19 22:06:20 +08:00
Pietro Albini
32e4eb9cb9
Rollup merge of #55952 - michaelwoerister:newer-clang, r=alexcrichton
Update to Clang 7 on CI.

Handles Linux and macOS. Windows seems to already have been updated.

r? @Mark-Simulacrum
cc @rust-lang/infra
2018-11-19 22:06:18 +08:00
Pietro Albini
fc30ab4da6
Rollup merge of #55949 - ljedrz:return_impl_Iterator_from_Predicate_walk_tys, r=oli-obk
ty: return impl Iterator from Predicate::walk_tys

Fixes the lazyboye `FIXME` by returning a custom `Iterator` as intended by the original author of the function.

It is indeed a bit convoluted, so I'm ok with not changing this if perf results are not favourable enough. Also happy to adjust any names if need be.
2018-11-19 22:06:14 +08:00
Oliver Scherer
8ee9711a6c Replace the ICEing on const fn loops with an error 2018-11-19 10:40:09 +01:00
0xrgb
7c9bcc5266
Update any.rs documentation using keyword dyn 2018-11-19 15:59:21 +09:00
Nick Cameron
99d1513ed3 save-analysis: fallback to using path id 2018-11-19 17:18:36 +13:00
Alex Crichton
86073253d5 Increase Duration approximate equal threshold to 1us
Previously this threshold when testing was 100ns, but the Windows
documentation states:

> which is a high resolution (<1us) time stamp

which presumably means that we could have up to 1us resolution, which
means that 100ns doesn't capture "equivalent" time intervals due to
various bits of rounding here and there.

It's hoped that this..

Closes #56034
2018-11-18 19:08:06 -08:00
bors
7e82eda000 Auto merge of #56042 - petrochenkov:nuni, r=petrochenkov
[nightly] resolve: Implement uniform paths 2.0

Forward-port of https://github.com/rust-lang/rust/pull/55884 to nightly.

r? @ghost
2018-11-19 02:59:29 +00:00
Pietro Albini
715d83fe01
Rollup merge of #55923 - Zeegomo:master, r=estebank
reword #[test] attribute error on fn items

fix of [#55787](https://github.com/rust-lang/rust/issues/55787)
Reworded error message from "#[test] attribute is only allowed on fn items" to "#[test] attribute is only allowed on non associated functions"
2018-11-18 23:24:43 +01:00
Pietro Albini
5e2ff63e29
Rollup merge of #55919 - Turbo87:num-tests, r=dtolnay
core/tests/num: Simplify `test_int_from_str_overflow()` test code

This commit changes the test code to compare against easier-to-read, static values instead of relying on the result of `wrapping_add()` which may or may not result in the value that we expect.
2018-11-18 23:24:42 +01:00
Pietro Albini
c87c31b111
Rollup merge of #55916 - RalfJung:mut-visitor, r=oli-obk
Make miri value visitor usfeful for mutation

~~This is based on top of https://github.com/rust-lang/rust/pull/55716, [click here](https://github.com/RalfJung/rust/compare/escape-to-raw...RalfJung:mut-visitor) for just the new commits.~~

r? @oli-obk
2018-11-18 23:24:41 +01:00
Pietro Albini
131a7553e1
Rollup merge of #55894 - RalfJung:validation-enums, r=oli-obk
miri enum discriminant handling: Fix treatment of pointers, better error when it is undef

r? @oli-obk
2018-11-18 23:24:39 +01:00
Pietro Albini
3aeac24048
Rollup merge of #55867 - RalfJung:dont-panic, r=Mark-Simulacrum
do not panic just because cargo failed

Currently, a rustc ICE during bootstrap shows *two* backtraces with `RUST_BACKTRACE`. Fix that by making bootstrap just exit when cargo fails. This matches what we do [when building a tool fails](https://github.com/rust-lang/rust/blob/master/src/bootstrap/tool.rs#L189) and [when other stuff (not called through `stream_cargo`, like `cargo test`) fails](https://github.com/rust-lang/rust/blob/master/src/build_helper/lib.rs#L43).

Fixes https://github.com/rust-lang/rust/issues/53379
2018-11-18 23:24:38 +01:00
Pietro Albini
9577734ff3
Rollup merge of #55862 - zackmdavis:but_will_they_come_when_you_call_them, r=estebank
in which the E0618 "expected function" diagnostic gets a makeover

A woman of wisdom once told me, "Better late than never." (Can't reopen the previously-closed pull request from six months ago [due to GitHub limitations](https://github.com/rust-lang/rust/pull/51098#issuecomment-437647157).)

Now the main span focuses on the erroneous not-a-function callee, while showing the entire call expression is relegated to a secondary span. In the case where the erroneous callee is itself a call, we
point out the definition, and, if the call expression spans multiple lines, tentatively suggest a semicolon (because we suspect that the "outer" call is actually supposed to be a tuple).

![not_a_fn_1](https://user-images.githubusercontent.com/1076988/48309935-96755000-e538-11e8-9390-02a048abb0c2.png)

![not_a_fn_2](https://user-images.githubusercontent.com/1076988/48309936-98d7aa00-e538-11e8-8b9b-257bc77d6261.png)

The new `bug!` assertion is, in fact, safe (`confirm_builtin_call` is only called by `check_call`, which is only called with a first arg of kind `ExprKind::Call` in `check_expr_kind`).

Resolves #51055.

r? @estebank
2018-11-18 23:24:37 +01:00
Pietro Albini
7130947918
Rollup merge of #55857 - andjo403:rmdep, r=Mark-Simulacrum
remove unused dependency
2018-11-18 23:24:36 +01:00
Pietro Albini
4a52c5625c
Rollup merge of #55834 - ogoffart:union-abi, r=eddyb
Forward the ABI of the non-zero sized fields of an union if they have the same ABI

This is supposed to fix the performence regression of using MaybeUninit in
https://github.com/rust-lang/rust/pull/54668
2018-11-18 23:24:34 +01:00
Pietro Albini
9c3e8d340f
Rollup merge of #55827 - ljedrz:various_stashed, r=alexcrichton
A few tweaks to iterations/collecting

- simplify and speed up `dot::GraphWalk::nodes` for `cfg::CFG`
- `reserve` the capacity for `edges` in `DepGraph::query`
- collect directly to a `HirVec` in `LoweringContext::lower_attrs`
- fix overallocation in `OnDiskCache::serialize`
- preallocate the `new_partitioning` vector in `merge_codegen_units`
- simplify `impl FromHex for str`
- improve the creation of `self_arg_names` in `impl MethodDef`
2018-11-18 23:24:33 +01:00
Pietro Albini
21ff709954
Rollup merge of #55564 - smaeul:test-fixes-2, r=alexcrichton
test/linkage-visibility: Ignore on musl targets

DynamicLibrary uses libc's dlsym() function internally to find symbols.
Some implementations of dlsym(), like musl's, only look at dynamically-
exported symbols, as found in shared libraries. To also export symbols
from the main executable, pass --export-dynamic to the linker.

(Plus see [here](https://stackoverflow.com/questions/4184017) and [here](https://stackoverflow.com/questions/6121838) for examples of where this is necessary on glibc as well.)
2018-11-18 23:24:32 +01:00
Pietro Albini
36e1d9f3ed
Rollup merge of #55562 - smaeul:powerpc-linux-musl, r=alexcrichton
Add powerpc- and powerpc64-unknown-linux-musl targets

Add targets for musl on 32-bit and 64-bit powerpc. This requires some ABI fixes, as musl [uses the ELFv2 ABI on regardless of endianness](http://git.musl-libc.org/cgit/musl/tree/configure?id=8084d6ab57cdb0b8f328d3cdbad3b9d09eaaee04#n638). At the moment, powerpc64 support requires [an LLVM patch](https://reviews.llvm.org/D52013) to select the correct ABI; or I can add [a patch to Rust's LLVM backend](e8eaa2afd5) to always choose the right ABI.

Both architectures are able to run an extended bootstrap, and with some test fixes (e.g. #55561), there are no architecture-dependent test failures on powerpc64 (most failures in `src/test` are existing musl-host-related issues).
2018-11-18 23:24:31 +01:00
bors
a9b791b3c0 Auto merge of #55672 - RalfJung:miri-extern-types, r=eddyb
miri: accept extern types in structs if they are the only field

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

Cc @oli-obk @eddyb https://github.com/rust-lang/rust/issues/43467
2018-11-18 22:19:53 +00:00
Артём Павлов [Artyom Pavlov]
6357021294
fix test 2018-11-19 01:01:06 +03:00
Артём Павлов [Artyom Pavlov]
6ad61b9c3b
tests 2018-11-18 23:14:52 +03:00
Niko Matsakis
a5b4cb2991 remove "approx env bounds" if we already know from trait 2018-11-18 15:00:34 -05:00
Артём Павлов [Artyom Pavlov]
126b71f690
revert 2018-11-18 21:39:23 +03:00
bors
13c9439925 Auto merge of #56017 - alexcrichton:debug-test, r=alexcrichton
std: Add debugging for a failing test on appveyor

I'm not sure why this is failing, so let's hopefully get some more
information to help investigation!
2018-11-18 17:27:45 +00:00
bors
d1c2cbf90a Auto merge of #55999 - alexcrichton:update-cargo, r=nrc
Update Cargo submodule

Brings in some fixes and stabilizations!
2018-11-18 14:33:03 +00:00
Matthew Jasper
1d7fc0ca50 Simplify MIR drop generation
Now that EndRegion is gone, we don't need to create as many gotos.
2018-11-18 12:29:44 +00:00
Vadim Petrochenkov
38025e0dca Fix rebase 2018-11-18 14:41:06 +03:00
Matthew Jasper
6027e0810f Only handle ReVar regions in NLL borrowck
Now that lexical MIR borrowck is gone, there's no need to store Regions
unnecessarily.
2018-11-18 11:05:19 +00:00
Matthew Jasper
b16985a354 Remove mir::StatementKind::EndRegion
Since lexical MIR borrow check is gone, and validation no longer uses
these, they can be removed.
2018-11-18 11:05:19 +00:00
Vadim Petrochenkov
139d109241 Add a couple more tests + address review comments 2018-11-18 13:58:40 +03:00
Vadim Petrochenkov
59464709f7 resolve: Refactor away DeterminacyExt 2018-11-18 13:58:39 +03:00
Vadim Petrochenkov
a5f9bd02b1 resolve: Future-proof against imports referring to local variables and generic parameters 2018-11-18 13:58:39 +03:00
Vadim Petrochenkov
4fc3c13e32 resolve: Avoid sentence breaks in diagnostics 2018-11-18 13:58:36 +03:00
Vadim Petrochenkov
f492e9421f resolve: Support resolving macros without leaving traces 2018-11-18 13:57:37 +03:00
Vadim Petrochenkov
0e8a97f8e7 resolve: Avoid marking extern crate items as used in certain cases 2018-11-18 13:57:04 +03:00
Vadim Petrochenkov
8e88c3470a resolve: Reintroduce feature gate for uniform paths in imports 2018-11-18 13:57:04 +03:00
Vadim Petrochenkov
a38f903114 Fix ICEs from imports of items not defined in modules 2018-11-18 13:57:03 +03:00
Vadim Petrochenkov
cfd762954b resolve: Tweak some articles in ambiguity diagnostics 2018-11-18 13:57:03 +03:00
Vadim Petrochenkov
cfe81559ee resolve: Recover "did you mean" suggestions in imports 2018-11-18 13:57:01 +03:00
Vadim Petrochenkov
4c5d822a8b resolve: Check resolution consistency for import paths and multi-segment macro paths 2018-11-18 13:55:58 +03:00
Vadim Petrochenkov
07af4ec7a2 resolve: Resolve single-segment imports using in-scope resolution on 2018 edition 2018-11-18 13:51:43 +03:00
Vadim Petrochenkov
1cfd08c0c4 resolve: More precise determinacy tracking during import/macro resolution 2018-11-18 13:51:42 +03:00
Vadim Petrochenkov
f0ea1c6f1e resolve: Improve diagnostics for resolution ambiguities 2018-11-18 13:51:40 +03:00
Vadim Petrochenkov
9d7d9ada6d resolve: Simplify ambiguity checking for built-in attributes 2018-11-18 13:51:17 +03:00
Vadim Petrochenkov
e6739fe274 resolve: Resolve multi-segment imports using in-scope resolution on 2018 edition 2018-11-18 13:51:13 +03:00
Vadim Petrochenkov
67feeebfad resolve: Stop generating uniform path canaries 2018-11-18 13:49:31 +03:00
Scott McMurray
cdb1a799f8 Add VecDeque::resize_with 2018-11-17 22:48:29 -08:00
Alex Crichton
7a99b6db15 std: Add debugging for a failing test on appveyor
I'm not sure why this is failing, so let's hopefully get some more
information to help investigation!
2018-11-17 19:38:53 -08:00
Oliver Scherer
eb18ddd8f4 Don't auto-inline const fn 2018-11-17 17:50:37 +01:00