Commit Graph

82811 Commits

Author SHA1 Message Date
Isaac van Bakel
6ff4f7946f Corrected type variable output T -> U in Result::map_or_else 2018-08-29 22:55:21 +01:00
Isaac van Bakel
3eda9058cf Corrected feature status of Result::map_or_else
map_or_else is now correctly labelled unstable and points to the
tracking issue on rust-lang/rust
2018-08-29 22:51:54 +01:00
Isaac van Bakel
71b16d8350 Corrected bad typing in Result::map_or_else doc
The error value now includes the type of the success.
The success value now includes the type of the error.
2018-08-29 22:15:17 +01:00
Isaac van Bakel
5eb679105f Corrected feature name for map_or_else 2018-08-29 13:08:52 +01:00
Isaac van Bakel
b8c60302e7 Implemented map_or_else for Result<T, E> 2018-08-29 02:37:57 +01:00
bors
ec4a752202 Auto merge of #53493 - matthewjasper:hair-spans, r=nikomatsakis
Use smaller span for adjustments on block expressions

When returning a mutable reference don't use the entire body of the function as the span for the adjustments at the end.

The error [in this case](https://github.com/rust-lang/rust/compare/master...matthewjasper:hair-spans?expand=1#diff-ecef8b1f15622fb48a803c9b61605c78) is worse, but neither error message is really what we want. I have some ideas on how to get a better error message that will have to wait for a future PR.
2018-08-28 13:12:16 +00:00
bors
83ddc33347 Auto merge of #53314 - nikomatsakis:nll-invert-liveness, r=pnkfelix
NLL: experiment with inverting liveness

I got inspired to see what would happen here.

Fixes #52460

r? @pnkfelix
2018-08-28 10:58:10 +00:00
Felix S. Klock II
8d231ec872 Fix definition of LocalUseMapBuild so that it can build under stage0,
which does not have as many feature gates enabled.
2018-08-28 10:59:15 +02:00
bors
59e52b1b96 Auto merge of #53616 - varkor:hir-map-rename, r=nikomatsakis
Restructure hir::map::Node and hir::map::Entry

- Moves `hir::map::Node` to `hir::Node` and removes the `Node*` prefix from its variants.
- Changes `hir::map::Entry` to a struct `hir::map::Entry`.
- Removes the `Node*` prefix from each of `AnnNode`s variants.

r? @eddyb
2018-08-28 06:44:12 +00:00
bors
ca63a4e438 Auto merge of #53404 - oconnor663:current_dir_behavior, r=alexcrichton
document the platform-specific behavior of Command::current_dir

See also https://github.com/rust-lang/rust/issues/37868.

Here's my initial wording:

> Note that if the program path is relative (e.g. `"./script.sh"`), the interaction between that path and `current_dir` varies across platforms. Windows currently ignores `current_dir` when locating the program, but Unix-like systems interpret the program path relative to `current_dir`. These implementation details aren't considered stable, and it's recommended to call `canonicalize` to get an absolute program path instead of using relative paths and `current_dir` together.

I'd like to get feedback on:

- _Should_ we consider those details stable? It might be disruptive to change them, regardless of what I can get away with claiming in docs :)
- Is `canonicalize` an appropriate recommendation? As discussed in #37868 above, there are reasons it's not called automatically in the `Command` implementation.
2018-08-28 03:22:21 +00:00
bors
f33921ba58 Auto merge of #53272 - mark-i-m:anon_param_error_now, r=nikomatsakis
Warn on anon params in 2015 edition

cc #41686 https://github.com/rust-lang/rfcs/pull/2522
cc  @Centril @nikomatsakis

TODO:
- [x] Make sure the tests pass.
- [x] Make sure there is rustfix-able suggestion. Current plan is to just suggest `_ : Foo`
- [x] Add a rustfix ui test.

EDIT: It seems I already did the last two in #48309
2018-08-28 01:04:05 +00:00
bors
8c2b371ebc Auto merge of #53227 - nivkner:pin_move, r=RalfJung
move the Pin API into its own module for centralized documentation

This implements the change proposed by @withoutboats in #49150, as suggested by @RalfJung in the review of #53104,
along with the documentation that was originally in it, that was deemed more appropriate in module-level documentation.

r? @RalfJung
2018-08-27 22:56:15 +00:00
varkor
a9d075e756 Revert crate root changes 2018-08-27 21:46:23 +01:00
varkor
6642462ef6 Make small modifications 2018-08-27 21:46:23 +01:00
varkor
e2a1cce9c5 Rename hir::map::NodeKind to hir::Node 2018-08-27 21:46:23 +01:00
varkor
ecbdfb4988 Convert EntryKind to a struct, Entry 2018-08-27 21:46:13 +01:00
varkor
11665ca45a Remove path prefixes from NodeKind 2018-08-27 21:46:13 +01:00
varkor
4b12f700db Remove Node* prefix from AnnNode 2018-08-27 21:45:46 +01:00
varkor
befc4b1100 Rename hir::map::Node to hir::map::NodeKind 2018-08-27 21:45:46 +01:00
varkor
a1a338faab Rename MapEntry to EntryKind 2018-08-27 21:45:46 +01:00
bors
f7202e40f4 Auto merge of #51456 - qmx:crate-in-path, r=nikomatsakis
resolve suggestions should use `crate::` when enabled

I couldn't find a way to add a specific assertion for the ui test, so the expected output is living under the `crates-in-path.stderr` ui test.

- is this the right place for the test?

fixes #51212
2018-08-27 19:51:01 +00:00
Mark Mansi
548f28e194 fix test stderrs 2018-08-27 13:06:26 -05:00
Niko Matsakis
09feec6d5c make to_location O(1) 2018-08-27 13:57:55 -04:00
Niko Matsakis
7eec37b2f9 merge PointIndexMap and RegionValueElements 2018-08-27 13:57:55 -04:00
Niko Matsakis
1ab08ef846 micro-optimize dominator code 2018-08-27 13:57:55 -04:00
Niko Matsakis
57f39ee79b kill dead code from util/liveness 2018-08-27 13:57:55 -04:00
Niko Matsakis
af3ff10c7d improve comment on LiveVar 2018-08-27 13:57:55 -04:00
Niko Matsakis
94697ba4b6 rename LocalWithRegion to LiveVar 2018-08-27 13:57:55 -04:00
Niko Matsakis
437485527e comment what trace does 2018-08-27 13:57:55 -04:00
Niko Matsakis
9394a99f8e fix comment 2018-08-27 13:57:55 -04:00
Niko Matsakis
a63ece43b3 enable feature impl_header_lifetime_elision 2018-08-27 13:57:55 -04:00
Niko Matsakis
4e3740ace0 liveness.rs: rustfmt 2018-08-27 13:57:55 -04:00
Niko Matsakis
12f50a6e75 implement liveness tracing, remove old liveness system 2018-08-27 13:57:55 -04:00
Niko Matsakis
f1a675a467 update comment in the interest of precision 2018-08-27 13:48:40 -04:00
Niko Matsakis
a13e4aea81 remove the liveness mode and simplify categorize
Less modes!
2018-08-27 13:48:40 -04:00
bors
70a21e89f1 Auto merge of #53441 - toidiu:ak-fix53419, r=nikomatsakis
fix for late-bound regions

Fix for https://github.com/rust-lang/rust/issues/53419

r? @nikomatsakis
2018-08-27 17:42:45 +00:00
Mark Mansi
6c264d764e Fix anon param + make it allow-by-def 2018-08-27 12:40:16 -05:00
Mark Mansi
15b2640e70 fix another 2018-08-27 12:40:16 -05:00
Mark Mansi
3a9cf12021 fix some anon params 2018-08-27 12:40:16 -05:00
Mark Mansi
e0d03fd524 oops 2018-08-27 12:40:16 -05:00
Mark Mansi
20723178cc warn on anon params in 015 2018-08-27 12:40:16 -05:00
bors
8785e348ba Auto merge of #53580 - nikomatsakis:nll-issue-53568, r=pnkfelix
fix NLL ICEs

Custom type-ops reuse some of the query machinery -- but while query results are canonicalized after they are constructed, custom type ops are not, and hence we have to resolve the type variables to avoid an ICE here.

Also, use the type-op machinery for implied outlives bounds.

Fixes #53568
Fixes #52992
Fixes #53680
2018-08-27 14:44:13 +00:00
Douglas Campos
d9791d6538 add test for the suggestion from prelude 2018-08-27 14:12:31 +00:00
Douglas Campos
ae853752d8 no need to special case std 2018-08-27 12:36:30 +00:00
bors
b638d8c75f Auto merge of #53656 - nnethercote:HybridIdxSet-tweaks, r=nikomatsakis
`HybridIdxSet` tweaks

A couple of tweaks to `HybridIdxSet`.

r? @nikomatsakis
2018-08-27 11:47:03 +00:00
Matthew Jasper
7f7fadaee6 Also use smaller spans for unsize adjustments 2018-08-27 12:36:49 +01:00
bors
291d958585 Auto merge of #53624 - Zoxc:ice-fix, r=oli-obk
Move with_globals setup from run_compiler to run

An alternative to https://github.com/rust-lang/rust/pull/53526

Note this breaks some miri stuff and clippy since they call `run_compiler` directly, and they now need to also call `with_globals ` cc @rust-lang/dev-tools

r? @oli-obk
2018-08-27 09:08:27 +00:00
bors
7625c03167 Auto merge of #53648 - japaric:thumb-lld, r=alexcrichton
change the default linker of the ARM Cortex-M targets

to rust-lld so users won't need an external linker to build programs

This will break nightly builds.

We discussed this within the embedded WG and with the embedded community in
rust-embedded/wg#160 and there was consensus in that this breaking change is
worthwhile and that we should do it now before it becomes impossible to do
without breaking stable builds.

We have already written an announcement (see rust-embedded/wg#196) that explains
the breakage and instructs the users how to fix their builds. The TL;DR is that
they can switch to the old behavior by passing the `-C linker` flag to rustc.
We'll post the announcement as soon as this change makes into nightly.

closes rust-embedded/wg#160

r? @alexcrichton
2018-08-27 06:30:10 +00:00
John Kåre Alsaker
0972658578 Update clippy 2018-08-27 06:48:15 +02:00
bors
3a2c603eea Auto merge of #53640 - alexcrichton:more-symbol-tweaks, r=michaelwoerister
rustc: Continue to tweak "std internal symbols"

In investigating [an issue][1] with `panic_implementation` defined in an
executable that's optimized I once again got to rethinking a bit about the
`rustc_std_internal_symbol` attribute as well as weak lang items. We've sort of
been non-stop tweaking these items ever since their inception, and this
continues to the trend.

The crux of the bug was that in the reachability we have a [different branch][2]
for non-library builds which meant that weak lang items (and std internal
symbols) weren't considered reachable, causing them to get eliminiated by
ThinLTO passes. The fix was to basically tweak that branch to consider these
symbols to ensure that they're propagated all the way to the linker.

Along the way I've attempted to erode the distinction between std internal
symbols and weak lang items by having weak lang items automatically configure
fields of `CodegenFnAttrs`. That way most code no longer even considers weak
lang items and they're simply considered normal functions with attributes about
the ABI.

In the end this fixes the final comment of #51342

[1]: https://github.com/rust-lang/rust/issues/51342#issuecomment-414368019
[2]: 35bf1ae257/src/librustc/middle/reachable.rs (L225-L238)
2018-08-27 01:28:52 +00:00