]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoAuto merge of #50217 - z4v1er:patch-1, r=aturon
bors [Sun, 29 Apr 2018 14:08:59 +0000 (14:08 +0000)]
Auto merge of #50217 - z4v1er:patch-1, r=aturon

Fix typo

6 years agoAuto merge of #50300 - phansch:update_clippy, r=oli-obk
bors [Sun, 29 Apr 2018 11:58:45 +0000 (11:58 +0000)]
Auto merge of #50300 - phansch:update_clippy, r=oli-obk

Update clippy

First time doing this. Not sure if this is enough as the docs mention that the Cargo.lock should be updated, however running `cargo update -p clippy` and `./x.py` doesn't change anything.

Closes https://github.com/rust-lang-nursery/rust-clippy/issues/2700

r? @oli-obk

6 years agoAuto merge of #50306 - alexcrichton:inline-policy, r=sfackler
bors [Sun, 29 Apr 2018 09:22:10 +0000 (09:22 +0000)]
Auto merge of #50306 - alexcrichton:inline-policy, r=sfackler

std: Inline `DefaultResizePolicy::new`

This should allow us to tighten up the [codegen][example] a bit more, avoiding a
function call across object boundaries in the default optimized case.

[example]: https://play.rust-lang.org/?gist=c1179088b0f8a4dcd93a9906463f993d&version=stable&mode=release

6 years agoAuto merge of #50271 - sinkuu:fix_ice, r=eddyb
bors [Sun, 29 Apr 2018 03:01:09 +0000 (03:01 +0000)]
Auto merge of #50271 - sinkuu:fix_ice, r=eddyb

Fix ICE #48984

* ~~fbf6423  The tail type was not normalized.~~
* https://github.com/rust-lang/rust/commit/d0839d5680d2a51785eeb0811cf3e2beba90eacb  The method had a wrong assumption that something whose parent is a trait is an associated item. Fixes #48984.

6 years agoAuto merge of #50188 - alexcrichton:feature-all-the-things, r=eddyb
bors [Sat, 28 Apr 2018 23:49:28 +0000 (23:49 +0000)]
Auto merge of #50188 - alexcrichton:feature-all-the-things, r=eddyb

Add `-C target-feature` to all functions

Previously the features specified to LLVM via `-C target-feature` were only
reflected in the `TargetMachine` but this change *also* reflects these and the
base features inside each function itself. This change matches clang and...

Closes rust-lang-nursery/stdsimd#427

6 years agoAdd `-C target-feature` to all functions
Alex Crichton [Mon, 23 Apr 2018 22:17:07 +0000 (15:17 -0700)]
Add `-C target-feature` to all functions

Previously the features specified to LLVM via `-C target-feature` were only
reflected in the `TargetMachine` but this change *also* reflects these and the
base features inside each function itself. This change matches clang and...

Closes rust-lang-nursery/stdsimd#427

6 years agoAuto merge of #50240 - nnethercote:LazyBTreeMap, r=cramertj
bors [Sat, 28 Apr 2018 21:19:33 +0000 (21:19 +0000)]
Auto merge of #50240 - nnethercote:LazyBTreeMap, r=cramertj

Implement LazyBTreeMap and use it in a few places.

This is a thin wrapper around BTreeMap that avoids allocating upon creation.

I would prefer to change BTreeMap directly to make it lazy (like I did with HashSet in #36734) and I initially attempted that by making BTreeMap::root an Option<>. But then I also had to change Iter and Range to handle trees with no root, and those types have stability markers on them and I wasn't sure if that was acceptable. Also, BTreeMap has a lot of complex code and changing it all was challenging, and I didn't have high confidence about my general approach.

So I prototyped this wrapper instead and used it in the hottest locations to get some measurements about the effect. The measurements are pretty good!

- Doing a debug build of serde, it reduces the total number of heap allocations from 17,728,709 to 13,359,384, a 25% reduction. The number of bytes allocated drops from 7,474,672,966 to 5,482,308,388, a 27% reduction.

- It gives speedups of up to 3.6% on some rustc-perf benchmark jobs. crates.io, futures, and serde benefit most.
```
futures-check
        avg: -1.9%      min: -3.6%      max: -0.5%
serde-check
        avg: -2.1%      min: -3.5%      max: -0.7%
crates.io-check
        avg: -1.7%      min: -3.5%      max: -0.3%
serde
        avg: -2.0%      min: -3.0%      max: -0.9%
serde-opt
        avg: -1.8%      min: -2.9%      max: -0.3%
futures
        avg: -1.5%      min: -2.8%      max: -0.4%
tokio-webpush-simple-check
        avg: -1.1%      min: -2.2%      max: -0.1%
futures-opt
        avg: -1.2%      min: -2.1%      max: -0.4%
piston-image-check
        avg: -0.8%      min: -1.1%      max: -0.3%
crates.io
        avg: -0.6%      min: -1.0%      max: -0.3%
```
@Gankro, how do you think I should proceed here? Is leaving this as a wrapper reasonable? Or should I try to make BTreeMap itself lazy? If so, can I change the representation of Iter and Range?

Thanks!

6 years agostd: Inline `DefaultResizePolicy::new`
Alex Crichton [Sat, 28 Apr 2018 21:14:21 +0000 (14:14 -0700)]
std: Inline `DefaultResizePolicy::new`

This should allow us to tighten up the [codegen][example] a bit more, avoiding a
function call across object boundaries in the default optimized case.

[example]: https://play.rust-lang.org/?gist=c1179088b0f8a4dcd93a9906463f993d&version=stable&mode=release

6 years agoAuto merge of #50164 - nox:rval-range-metadata, r=eddyb
bors [Sat, 28 Apr 2018 17:59:25 +0000 (17:59 +0000)]
Auto merge of #50164 - nox:rval-range-metadata, r=eddyb

Emit range metadata on calls returning scalars (fixes #50157)

6 years agoAuto merge of #50295 - SergioBenitez:master, r=alexcrichton
bors [Sat, 28 Apr 2018 15:33:31 +0000 (15:33 +0000)]
Auto merge of #50295 - SergioBenitez:master, r=alexcrichton

Don't feature gate bang macros on 'proc_macro_path_invoc'.

Fixes oversight from #50120.

6 years agoUpdate clippy submodule
Philipp Hansch [Sat, 28 Apr 2018 13:10:42 +0000 (15:10 +0200)]
Update clippy submodule

6 years agoAuto merge of #50155 - est31:label_expressions, r=petrochenkov
bors [Sat, 28 Apr 2018 10:08:56 +0000 (10:08 +0000)]
Auto merge of #50155 - est31:label_expressions, r=petrochenkov

'label can start expressions

```Rust
let foo = 'label: loop { break 'label 42; };
```

is valid Rust code.

6 years agoAuto merge of #49826 - cuviper:rustc-main-ICE, r=alexcrichton
bors [Sat, 28 Apr 2018 06:26:46 +0000 (06:26 +0000)]
Auto merge of #49826 - cuviper:rustc-main-ICE, r=alexcrichton

rustc_driver: Catch ICEs on the main thread too

#48575 introduced an optimization to run rustc directly on the main thread when possible.  However, the threaded code detects panics when they `join()` to report as an ICE.  When running directly, we need to use `panic::catch_unwind` to get the same effect.

cc @ishitatsuyuki
r? @alexcrichton

6 years agoDon't feature gate bang macros on 'proc_macro_path_invoc'.
Sergio Benitez [Sat, 28 Apr 2018 04:32:00 +0000 (21:32 -0700)]
Don't feature gate bang macros on 'proc_macro_path_invoc'.

6 years agoAuto merge of #50149 - aaronaaeng:master, r=estebank
bors [Sat, 28 Apr 2018 04:14:12 +0000 (04:14 +0000)]
Auto merge of #50149 - aaronaaeng:master, r=estebank

Added warning for unused arithmetic expressions

The compiler now displays a warning when a binary arithmetic operation is evaluated but not used.  This resolves #50124  by following the instructions outlined in the issue.  The changes are as follows:

- Added new pattern matching for unused arithmetic expressions in `src/librustc_lint/unused.rs`
- Added `#[must_use]` attributes to the binary operation methods in `src/libcore/internal_macros.rs`
- Added `#[must_use]` attributes to the non-assigning binary operators in `src/libcore/ops/arith.rs`

6 years agoMake `trait_of_item` return None for non associated items
Shotaro Yamada [Mon, 23 Apr 2018 15:31:13 +0000 (00:31 +0900)]
Make `trait_of_item` return None for non associated items

It have returned `Some` for constants in a trait definition,
and `Instance::resolve` called `tcx.associated_item` for them,
causing ICE.

6 years agoAuto merge of #49822 - matthewjasper:dropck-closures, r=nikomatsakis
bors [Fri, 27 Apr 2018 23:31:43 +0000 (23:31 +0000)]
Auto merge of #49822 - matthewjasper:dropck-closures, r=nikomatsakis

Access individual fields of tuples, closures and generators on drop.

Fixes #48623, by extending the change in #47917 to closures. Also does this for tuples and generators for consistency.

Enums are unchanged because there is now way to borrow `*enum.field` without borrowing `enum.field` at the moment, so any error would be reported when the enum goes out of scope. Unions aren't changed because unions they don't automatically drop their fields.

r? @nikomatsakis

6 years agorustc_driver: Catch ICEs on the main thread too
Josh Stone [Tue, 10 Apr 2018 00:30:43 +0000 (17:30 -0700)]
rustc_driver: Catch ICEs on the main thread too

6 years agoAuto merge of #50290 - kennytm:rollup, r=kennytm
bors [Fri, 27 Apr 2018 21:01:47 +0000 (21:01 +0000)]
Auto merge of #50290 - kennytm:rollup, r=kennytm

Rollup of 9 pull requests

Successful merges:

 - #49858 (std: Mark `ptr::Unique` with `#[doc(hidden)]`)
 - #49968 (Stabilize dyn trait)
 - #50192 (Add some utilities to `libsyntax`)
 - #50251 (rustc: Disable threads in LLD for wasm)
 - #50263 (rustc: Emit `uwtable` for allocator shims)
 - #50269 (Update `parking_lot` dependencies)
 - #50273 (Allow #[inline] on closures)
 - #50284 (fix search load page failure)
 - #50257 (Don't ICE on tuple struct ctor with incorrect arg count)

Failed merges:

6 years agoRollup merge of #50257 - estebank:fix-49560, r=nikomatsakis
kennytm [Fri, 27 Apr 2018 20:51:00 +0000 (04:51 +0800)]
Rollup merge of #50257 - estebank:fix-49560, r=nikomatsakis

Don't ICE on tuple struct ctor with incorrect arg count

Fix #49560.

6 years agoAccess individual fields of tuples, closures and generators on drop.
Matthew Jasper [Fri, 27 Apr 2018 19:41:30 +0000 (20:41 +0100)]
Access individual fields of tuples, closures and generators on drop.

6 years agoRollup merge of #50284 - GuillaumeGomez:search-load-failure, r=SimonSapin
kennytm [Fri, 27 Apr 2018 19:32:20 +0000 (03:32 +0800)]
Rollup merge of #50284 - GuillaumeGomez:search-load-failure, r=SimonSapin

fix search load page failure

Fixes #50283.

r? @QuietMisdreavus

6 years agoRollup merge of #50273 - Amanieu:issue-49532, r=alexcrichton
kennytm [Fri, 27 Apr 2018 19:32:18 +0000 (03:32 +0800)]
Rollup merge of #50273 - Amanieu:issue-49532, r=alexcrichton

Allow #[inline] on closures

Fixes #49632

6 years agoRollup merge of #50269 - alexcrichton:update-parking-lot, r=Mark-Simulacrum
kennytm [Fri, 27 Apr 2018 19:32:17 +0000 (03:32 +0800)]
Rollup merge of #50269 - alexcrichton:update-parking-lot, r=Mark-Simulacrum

Update `parking_lot` dependencies

This commit updates `parking_lot` to pull in Amanieu/parking_lot#70 and...

Closes #49438

6 years agoRollup merge of #50263 - alexcrichton:uwtable-allcoators, r=eddyb
kennytm [Fri, 27 Apr 2018 19:32:16 +0000 (03:32 +0800)]
Rollup merge of #50263 - alexcrichton:uwtable-allcoators, r=eddyb

rustc: Emit `uwtable` for allocator shims

This commit emits the `uwtable` attribute to LLVM for platforms that require it
for the allocator shims that we generate to ensure that they can hopefully get
unwound past. This is a stab in the dark at helping
https://bugzilla.mozilla.org/show_bug.cgi?id=1456150 along.

6 years agoRollup merge of #50251 - alexcrichton:wasm-no-threads, r=eddyb
kennytm [Fri, 27 Apr 2018 19:32:15 +0000 (03:32 +0800)]
Rollup merge of #50251 - alexcrichton:wasm-no-threads, r=eddyb

rustc: Disable threads in LLD for wasm

Upstream bug reports (rustwasm/wasm-bindgen#119) show that this may be the
culprit of odd crashes/hangs. The linker is a tiny fraction of build time anyway
right now so let's disable it and figure out how to possibly reenable it later
if necessary.

6 years agoRollup merge of #50192 - bobtwinkles:libsyntax_extensions, r=jseyfried
kennytm [Fri, 27 Apr 2018 19:32:13 +0000 (03:32 +0800)]
Rollup merge of #50192 - bobtwinkles:libsyntax_extensions, r=jseyfried

Add some utilities to `libsyntax`

Adds a few functions to `Mark` and `Span` that I found useful in an upcoming refactor of NLL region error reporting. Also includes some new documentation based on my discussion with @jseyfried on IRC.

r? @jseyfried

6 years agoRollup merge of #49968 - christianpoveda:stabilize_dyn, r=nikomatsakis
kennytm [Fri, 27 Apr 2018 19:32:12 +0000 (03:32 +0800)]
Rollup merge of #49968 - christianpoveda:stabilize_dyn, r=nikomatsakis

Stabilize dyn trait

This PR stabilizes RFC 2113. I followed the [stabilization guide](https://forge.rust-lang.org/stabilization-guide.html).

Related issue: https://github.com/rust-lang/rust/issues/49218

6 years agoRollup merge of #49858 - dmizuk:unique-doc-hidden, r=steveklabnik
kennytm [Fri, 27 Apr 2018 19:32:11 +0000 (03:32 +0800)]
Rollup merge of #49858 - dmizuk:unique-doc-hidden, r=steveklabnik

std: Mark `ptr::Unique` with `#[doc(hidden)]`

`Unique` is now perma-unstable, so let's hide its docs.

6 years agoAuto merge of #50137 - nox:rm-bool-cmp-hack, r=eddyb
bors [Fri, 27 Apr 2018 18:53:16 +0000 (18:53 +0000)]
Auto merge of #50137 - nox:rm-bool-cmp-hack, r=eddyb

Remove hack around comparisons of i1 values (fixes #40980)

The regression test still passes without that 2 years old hack. The underlying
LLVM bug has probably been fixed upstream since then.

6 years agoAuto merge of #50102 - Zoxc:query-nomacro, r=michaelwoerister
bors [Fri, 27 Apr 2018 16:42:31 +0000 (16:42 +0000)]
Auto merge of #50102 - Zoxc:query-nomacro, r=michaelwoerister

Move query code outside macros and store query jobs separately from query results

Based on https://github.com/rust-lang/rust/pull/50067

r? @michaelwoerister

6 years agorustdoc asks for dyn_trait feature in stage0
Christian Poveda [Wed, 25 Apr 2018 17:55:21 +0000 (12:55 -0500)]
rustdoc asks for dyn_trait feature in stage0

6 years agofixed tests
Christian Poveda [Wed, 25 Apr 2018 15:38:15 +0000 (10:38 -0500)]
fixed tests

6 years agofix search load page failure
Guillaume Gomez [Fri, 27 Apr 2018 15:14:29 +0000 (17:14 +0200)]
fix search load page failure

6 years agoremoved dyn trait attribute from librustdoc
Christian Poveda [Wed, 18 Apr 2018 18:33:36 +0000 (13:33 -0500)]
removed dyn trait attribute from librustdoc

6 years agofixed rustc version for dyn_trait
Christian Poveda [Sun, 15 Apr 2018 14:41:10 +0000 (09:41 -0500)]
fixed rustc version for dyn_trait

6 years agoupdated stderr files and removed feature-gate test for dyn_trait
Christian Poveda [Sat, 14 Apr 2018 00:21:23 +0000 (19:21 -0500)]
updated stderr files and removed feature-gate test for dyn_trait

6 years agoremoved linting for dyn_trait
Christian Poveda [Fri, 13 Apr 2018 22:07:33 +0000 (17:07 -0500)]
removed linting for dyn_trait

6 years agodyn_trait feature-gate just for stage0
Christian Poveda [Thu, 12 Apr 2018 21:55:09 +0000 (16:55 -0500)]
dyn_trait feature-gate just for stage0

6 years agoremoved dyn_trait feature from tests
Christian Poveda [Thu, 12 Apr 2018 21:54:17 +0000 (16:54 -0500)]
removed dyn_trait feature from tests

6 years agostop requiring the feature-gate to use dyn_trait
Christian Poveda [Thu, 12 Apr 2018 21:53:28 +0000 (16:53 -0500)]
stop requiring the feature-gate to use dyn_trait

6 years agoAuto merge of #50097 - glandium:box_free, r=nikomatsakis
bors [Fri, 27 Apr 2018 12:24:17 +0000 (12:24 +0000)]
Auto merge of #50097 - glandium:box_free, r=nikomatsakis

Partial future-proofing for Box<T, A>

In some ways, this is similar to @eddyb's PR #47043 that went stale, but doesn't cover everything. Notably, this still leaves Box internalized as a pointer in places, so practically speaking, only ZSTs can be practically added to the Box type with the changes here (the compiler ICEs otherwise).

The Box type is not changed here, that's left for the future because I want to test that further first, but this puts things in place in a way that hopefully will make things easier.

6 years agoAllow #[inline] on closures
Amanieu d'Antras [Fri, 27 Apr 2018 05:20:46 +0000 (07:20 +0200)]
Allow #[inline] on closures

Fixes #49632

6 years agoAddress comments
John Kåre Alsaker [Fri, 27 Apr 2018 10:08:54 +0000 (12:08 +0200)]
Address comments

6 years agoStore query jobs and query results in separate maps to reduce memory usage
John Kåre Alsaker [Fri, 20 Apr 2018 07:47:26 +0000 (09:47 +0200)]
Store query jobs and query results in separate maps to reduce memory usage

6 years agoMove query functions out from the define_maps! macro
John Kåre Alsaker [Thu, 19 Apr 2018 00:33:24 +0000 (02:33 +0200)]
Move query functions out from the define_maps! macro

6 years agoCreate a job immediately when looking in the query map and start it later
John Kåre Alsaker [Wed, 18 Apr 2018 02:35:40 +0000 (04:35 +0200)]
Create a job immediately when looking in the query map and start it later

6 years agoAuto merge of #50275 - kennytm:rollup, r=kennytm
bors [Fri, 27 Apr 2018 09:59:12 +0000 (09:59 +0000)]
Auto merge of #50275 - kennytm:rollup, r=kennytm

Rollup of 7 pull requests

Successful merges:

 - #49707 (Add "the Rustc book")
 - #50222 (Bump bootstrap compiler to 2018-04-24)
 - #50227 (Fix ICE with erroneous `impl Trait` in a trait impl)
 - #50229 (Add setting to go to item if there is only one result)
 - #50231 (Add more doc aliases)
 - #50246 (Make dump_{alloc,allocs,local}() no-ops when tracing is disabled.)
 - #49894 (Rename InternedString to LocalInternedString and introduce a new thread-safe InternedString)

Failed merges:

6 years agoRollup merge of #49894 - Zoxc:sync-internedstring, r=michaelwoerister
kennytm [Fri, 27 Apr 2018 08:25:23 +0000 (16:25 +0800)]
Rollup merge of #49894 - Zoxc:sync-internedstring, r=michaelwoerister

Rename InternedString to LocalInternedString and introduce a new thread-safe InternedString

This is an allocation-free alternative to https://github.com/rust-lang/rust/pull/46972.

6 years agoRollup merge of #50246 - nnethercote:no-dump_allocs, r=Mark-Simulacrum
kennytm [Fri, 27 Apr 2018 06:16:49 +0000 (14:16 +0800)]
Rollup merge of #50246 - nnethercote:no-dump_allocs, r=Mark-Simulacrum

Make dump_{alloc,allocs,local}() no-ops when tracing is disabled.

Because they traverse data structures and build up strings, which is
wasted effort if those strings aren't printed.

The patch also removes some now-unnecessary log_enabled! tests at call
sites.

This is a big win for the Debug and Opt runs of coercions, tuple-stress, html5ever, and encoding.
```
coercions-opt
        avg: -7.8%      min: -14.8%     max: 0.1%
coercions
        avg: -8.0%      min: -12.8%     max: 0.1%
tuple-stress
        avg: -7.2%      min: -10.8%     max: -0.7%
tuple-stress-opt
        avg: -6.9%      min: -10.7%     max: 0.6%
html5ever
        avg: -4.6%      min: -7.3%      max: -0.3%
encoding
        avg: -2.4%      min: -4.5%      max: 0.1%
html5ever-opt
        avg: -2.7%      min: -4.2%      max: -0.2%
encoding-opt
        avg: -1.4%      min: -2.4%      max: 0.0%
```

6 years agoRollup merge of #50231 - GuillaumeGomez:doc-aliases, r=QuietMisdreavus
kennytm [Fri, 27 Apr 2018 06:16:48 +0000 (14:16 +0800)]
Rollup merge of #50231 - GuillaumeGomez:doc-aliases, r=QuietMisdreavus

Add more doc aliases

r? @QuietMisdreavus

6 years agoRollup merge of #50229 - GuillaumeGomez:search-one-result, r=QuietMisdreavus
kennytm [Fri, 27 Apr 2018 06:16:46 +0000 (14:16 +0800)]
Rollup merge of #50229 - GuillaumeGomez:search-one-result, r=QuietMisdreavus

Add setting to go to item if there is only one result

Fixes #50216.

r? @QuietMisdreavus

6 years agoRollup merge of #50227 - sinkuu:ice_non_local_trait, r=estebank
kennytm [Fri, 27 Apr 2018 06:16:45 +0000 (14:16 +0800)]
Rollup merge of #50227 - sinkuu:ice_non_local_trait, r=estebank

Fix ICE with erroneous `impl Trait` in a trait impl

Fixes #49841.

6 years agoRollup merge of #50222 - michaelwoerister:bump-stage0-compiler-to-2018-04-24, r=alexc...
kennytm [Fri, 27 Apr 2018 06:16:44 +0000 (14:16 +0800)]
Rollup merge of #50222 - michaelwoerister:bump-stage0-compiler-to-2018-04-24, r=alexcrichton

Bump bootstrap compiler to 2018-04-24

r? @alexcrichton

6 years agoAuto merge of #49891 - cuviper:compiletest-crash, r=alexcrichton
bors [Fri, 27 Apr 2018 07:43:46 +0000 (07:43 +0000)]
Auto merge of #49891 - cuviper:compiletest-crash, r=alexcrichton

compiletest: detect non-ICE compiler panics

Fixes #49888, but will be blocked by revealing #49889.

6 years agoRollup merge of #49707 - steveklabnik:rustc-book, r=QuietMisdreavus
kennytm [Fri, 27 Apr 2018 06:16:42 +0000 (14:16 +0800)]
Rollup merge of #49707 - steveklabnik:rustc-book, r=QuietMisdreavus

Add "the Rustc book"

This PR introduces a new book into the documentation, "The rustc book". We already have books for Cargo, and for Rustdoc, rustc should have some too. This book is focused on *users* of rustc, and provides a nice place to write documentation for users.

I haven't put content here, but plan on scaffolding it out very soon, and wanted this PR open for a few discussions first. One of those is "what exactly should said TOC be?" I plan on having a proposed one up tomorrow, but figured I'd let people know to start thinking about it now.

The big one is that we also will want to put https://github.com/rust-lang-nursery/rustc-guide in-tree as well, and the naming is... tough. I'm proposing:

* doc.rust-lang.org/rustc is "The Rustc book", to mirror the other tools' books.
* doc.rust-lang.org/rustc-contribution is "The Rustc contribution guide", and contains that book

@nikomatsakis et al, any thoughts on this? I'm not attached to it in particular, but had to put something together to get this discussion going. I think mirroring the other tools is a good idea for this work, but am not sure where exactly that leaves yours.

Fixes https://github.com/rust-docs/team/issues/11

6 years agoAuto merge of #48995 - aravind-pg:canonical-query, r=nikomatsakis
bors [Fri, 27 Apr 2018 03:53:39 +0000 (03:53 +0000)]
Auto merge of #48995 - aravind-pg:canonical-query, r=nikomatsakis

Create a canonical trait query for `evaluate_obligation`

This builds on the canonical query machinery introduced in #48411 to introduce a new canonical trait query for `evaluate_obligation` in the trait selector. Also ports most callers of the original `evaluate_obligation` to the new system (except in coherence, which requires support for intercrate mode). Closes #48537.

r? @nikomatsakis

6 years agoUpdate `parking_lot` dependencies
Alex Crichton [Fri, 27 Apr 2018 03:50:06 +0000 (20:50 -0700)]
Update `parking_lot` dependencies

This commit updates `parking_lot` to pull in Amanieu/parking_lot#70 and...

Closes #49438

6 years agoRename InternedString to LocalInternedString and introduce a new thread-safe Interned...
John Kåre Alsaker [Wed, 11 Apr 2018 21:02:41 +0000 (23:02 +0200)]
Rename InternedString to LocalInternedString and introduce a new thread-safe InternedString

6 years agoAuto merge of #49420 - nox:enum-scalarpair, r=eddyb
bors [Fri, 27 Apr 2018 01:30:10 +0000 (01:30 +0000)]
Auto merge of #49420 - nox:enum-scalarpair, r=eddyb

Use ScalarPair for tagged enums

6 years agoUpdate a compile-fail test
Aravind Gollakota [Sun, 22 Apr 2018 21:48:38 +0000 (16:48 -0500)]
Update a compile-fail test

6 years agoRetry canonical trait query in standard mode if overflow occurs
Aravind Gollakota [Thu, 19 Apr 2018 08:15:36 +0000 (03:15 -0500)]
Retry canonical trait query in standard mode if overflow occurs

This is slightly hacky and hopefully only a somewhat temporary solution.

6 years agoRemove the stored obligation in OverflowError to simplify things
Aravind Gollakota [Thu, 19 Apr 2018 07:49:21 +0000 (02:49 -0500)]
Remove the stored obligation in OverflowError to simplify things

We will shortly refactor things so that it is no longer needed

6 years agoIntroduce trait query mode and use it to set overflow error handling policy in traits...
Aravind Gollakota [Thu, 19 Apr 2018 07:28:03 +0000 (02:28 -0500)]
Introduce trait query mode and use it to set overflow error handling policy in traits::select

6 years agoSimplify trait selector's evaluation API slightly
Aravind Gollakota [Sun, 8 Apr 2018 07:04:46 +0000 (02:04 -0500)]
Simplify trait selector's evaluation API slightly

6 years agoPort existing callers of `evaluate_obligation` to the new canonical trait query
Aravind Gollakota [Sun, 8 Apr 2018 06:56:27 +0000 (01:56 -0500)]
Port existing callers of `evaluate_obligation` to the new canonical trait query

Except the one in coherence, which needs support for intercrate mode.

6 years agoCreate a canonical trait query for `evaluate_obligation`
Aravind Gollakota [Fri, 9 Mar 2018 00:30:37 +0000 (18:30 -0600)]
Create a canonical trait query for `evaluate_obligation`

6 years agoRefactor overflow handling in traits::select to propagate overflow instead of abortin...
Aravind Gollakota [Thu, 5 Apr 2018 17:29:18 +0000 (12:29 -0500)]
Refactor overflow handling in traits::select to propagate overflow instead of aborting eagerly

We store the obligation that caused the overflow as part of the OverflowError, and report it at the public API endpoints (rather than in the implementation internals).

6 years agorustc: Emit `uwtable` for allocator shims
Alex Crichton [Fri, 27 Apr 2018 00:09:08 +0000 (17:09 -0700)]
rustc: Emit `uwtable` for allocator shims

This commit emits the `uwtable` attribute to LLVM for platforms that require it
for the allocator shims that we generate to ensure that they can hopefully get
unwound past. This is a stab in the dark at helping
https://bugzilla.mozilla.org/show_bug.cgi?id=1456150 along.

6 years agoAuto merge of #50253 - nikomatsakis:regressions-2018-04-26, r=eddyb
bors [Thu, 26 Apr 2018 23:11:39 +0000 (23:11 +0000)]
Auto merge of #50253 - nikomatsakis:regressions-2018-04-26, r=eddyb

drop elaboration should reveal all

This used to happen implicitly through the normalization function; but we now keep the param-env as is, which seems less surprising.

cc #49685

r? @eddyb

6 years agoFix review nits
bobtwinkles [Thu, 26 Apr 2018 22:28:34 +0000 (18:28 -0400)]
Fix review nits

6 years agoDon't ICE on tuple struct ctor with incorrect arg count
Esteban Küber [Thu, 26 Apr 2018 21:19:21 +0000 (14:19 -0700)]
Don't ICE on tuple struct ctor with incorrect arg count

6 years agoEmit range metadata on calls returning scalars (fixes #50157)
Anthony Ramine [Sun, 22 Apr 2018 16:40:54 +0000 (18:40 +0200)]
Emit range metadata on calls returning scalars (fixes #50157)

6 years agoAuto merge of #49513 - nox:univariant-fieldless-enum-as-zst, r=eddyb
bors [Thu, 26 Apr 2018 18:26:03 +0000 (18:26 +0000)]
Auto merge of #49513 - nox:univariant-fieldless-enum-as-zst, r=eddyb

Treat repr(Rust) univariant fieldless enums as ZSTs

This makes all those enums be represented the same way:

```rust
enum A1 { B1 }
enum A2 { B2 = 0 }
enum A3 { B3, C3(!) }
```

Related to #15747.

Cc @rust-lang/wg-codegen @rust-lang/lang

6 years agoAdd setting to go to item if there is only one result
Guillaume Gomez [Wed, 25 Apr 2018 17:50:32 +0000 (19:50 +0200)]
Add setting to go to item if there is only one result

6 years agoadd regression test
Niko Matsakis [Thu, 26 Apr 2018 17:42:22 +0000 (13:42 -0400)]
add regression test

Fixes #49685

6 years agouse `reveal_all` during drop elaboration
Niko Matsakis [Thu, 26 Apr 2018 17:31:31 +0000 (13:31 -0400)]
use `reveal_all` during drop elaboration

This used to happen by default as part of the normalization routine
that was being used.

6 years agoimproved debug output
Niko Matsakis [Thu, 26 Apr 2018 17:31:24 +0000 (13:31 -0400)]
improved debug output

6 years agoAuto merge of #50228 - irinagpopa:backstory-v2, r=nikomatsakis
bors [Thu, 26 Apr 2018 16:00:48 +0000 (16:00 +0000)]
Auto merge of #50228 - irinagpopa:backstory-v2, r=nikomatsakis

Rename rustc_back to rustc_target and move ABI code to it.

Fixes #45226.

6 years agoFixed tidy errors.
Irina Popa [Thu, 26 Apr 2018 13:07:26 +0000 (16:07 +0300)]
Fixed tidy errors.

6 years agorustc_target: move in syntax::abi and flip dependency.
Irina Popa [Wed, 25 Apr 2018 16:30:39 +0000 (19:30 +0300)]
rustc_target: move in syntax::abi and flip dependency.

6 years agoMark SingleVariant as repr(u8) in c-style-enum
Anthony Ramine [Wed, 25 Apr 2018 08:33:02 +0000 (10:33 +0200)]
Mark SingleVariant as repr(u8) in c-style-enum

I should rather properly fix debuginfo but I have no clue how to do that.

6 years agoTreat repr(Rust) univariant fieldless enums as a ZST (fixes #15747)
Anthony Ramine [Fri, 30 Mar 2018 13:49:56 +0000 (15:49 +0200)]
Treat repr(Rust) univariant fieldless enums as a ZST (fixes #15747)

This makes all those enums be represented the same way:

```rust
enum A1 { B1 }
enum A2 { B2 = 0 }
enum A3 { B3, C3(!) }
```

6 years agorustc: Disable threads in LLD for wasm
Alex Crichton [Thu, 26 Apr 2018 13:56:37 +0000 (06:56 -0700)]
rustc: Disable threads in LLD for wasm

Upstream bug reports (rustwasm/wasm-bindgen#119) show that this may be the
culprit of odd crashes/hangs. The linker is a tiny fraction of build time anyway
right now so let's disable it and figure out how to possibly reenable it later
if necessary.

6 years agorustc_target: move in cabi_* from rustc_trans.
Irina Popa [Wed, 25 Apr 2018 13:45:29 +0000 (16:45 +0300)]
rustc_target: move in cabi_* from rustc_trans.

6 years agorustc_trans: generalize cabi_* to any context type.
Irina Popa [Wed, 18 Apr 2018 13:01:26 +0000 (16:01 +0300)]
rustc_trans: generalize cabi_* to any context type.

6 years agorustc_target: move for_variant and field TyLayout methods to a trait.
Irina Popa [Wed, 7 Feb 2018 17:27:43 +0000 (19:27 +0200)]
rustc_target: move for_variant and field TyLayout methods to a trait.

6 years agorustc_target: move LayoutOf's type parameter to an associated type.
Irina Popa [Mon, 5 Feb 2018 19:07:20 +0000 (21:07 +0200)]
rustc_target: move LayoutOf's type parameter to an associated type.

6 years agorustc_target: move in type definitions from rustc_trans::abi.
Irina Popa [Thu, 28 Dec 2017 17:07:02 +0000 (19:07 +0200)]
rustc_target: move in type definitions from rustc_trans::abi.

6 years agorustc_target: move in type definitions from ty::layout.
Irina Popa [Mon, 18 Dec 2017 14:18:36 +0000 (16:18 +0200)]
rustc_target: move in type definitions from ty::layout.

6 years agoRename rustc_back::target to rustc_target::spec.
Irina Popa [Fri, 8 Dec 2017 19:18:21 +0000 (21:18 +0200)]
Rename rustc_back::target to rustc_target::spec.

6 years agorustc_back: move LinkerFlavor, PanicStrategy, and RelroLevel to target.
Irina Popa [Fri, 8 Dec 2017 15:07:47 +0000 (17:07 +0200)]
rustc_back: move LinkerFlavor, PanicStrategy, and RelroLevel to target.

6 years agoAdd a test for casts of univariant C-like enums
Anthony Ramine [Thu, 12 Apr 2018 13:11:14 +0000 (15:11 +0200)]
Add a test for casts of univariant C-like enums

6 years agoProperly evaluate zst enum
Oliver Schneider [Sat, 31 Mar 2018 21:06:26 +0000 (23:06 +0200)]
Properly evaluate zst enum

6 years agoConsistently use C_uint_big for discriminants
Anthony Ramine [Wed, 11 Apr 2018 15:30:49 +0000 (17:30 +0200)]
Consistently use C_uint_big for discriminants

6 years agoProperly look for uninhabitedness when handling discriminants
Anthony Ramine [Wed, 11 Apr 2018 15:25:18 +0000 (17:25 +0200)]
Properly look for uninhabitedness when handling discriminants

6 years agoDo not ICE on generics mismatch with non-local traits
Shotaro Yamada [Mon, 23 Apr 2018 04:54:09 +0000 (13:54 +0900)]
Do not ICE on generics mismatch with non-local traits

Fixes #49841

6 years agoAuto merge of #50245 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Thu, 26 Apr 2018 11:07:14 +0000 (11:07 +0000)]
Auto merge of #50245 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 4 pull requests

Successful merges:

 - #50177 (mark std::str::replace(,n) as #[must_use])
 - #50207 (Hash EntryKind::AssociatedConst const data)
 - #50214 (Js improvements)
 - #50219 (Added missing `.` in docs.)

Failed merges:

 - #50229 (Add setting to go to item if there is only one result)

6 years agoAdd more doc aliases
Guillaume Gomez [Wed, 25 Apr 2018 18:10:58 +0000 (20:10 +0200)]
Add more doc aliases

6 years agoMake dump_{alloc,allocs,local}() no-ops when tracing is disabled.
Nicholas Nethercote [Thu, 26 Apr 2018 05:35:24 +0000 (15:35 +1000)]
Make dump_{alloc,allocs,local}() no-ops when tracing is disabled.

Because they traverse data structures and build up strings, which is
wasted effort if those strings aren't printed.

The patch also removes some now-unnecessary log_enabled! tests at call
sites.