]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoSkip checking for unused mutable locals that have no name
Keith Yeung [Mon, 30 Apr 2018 22:31:37 +0000 (15:31 -0700)]
Skip checking for unused mutable locals that have no name

6 years agoAuto merge of #50345 - kennytm:rollup, r=kennytm
bors [Mon, 30 Apr 2018 17:30:55 +0000 (17:30 +0000)]
Auto merge of #50345 - kennytm:rollup, r=kennytm

Rollup of 7 pull requests

Successful merges:

 - #50233 (Make `Vec::new` a `const fn`)
 - #50312 (Add more links in panic docs)
 - #50316 (Fix some broken links in docs.)
 - #50325 (Add a few more tests for proc macro feature gating)
 - #50327 (Display correct unused field suggestion for nested struct patterns)
 - #50330 (check that #[used] is used only on statics)
 - #50344 (Update Cargo to 2018-04-28 122fd5be5201913d42e219e132d6569493583bca)

Failed merges:

6 years agoRollup merge of #50344 - SimonSapin:cargo, r=alexcrichton
kennytm [Mon, 30 Apr 2018 17:18:43 +0000 (01:18 +0800)]
Rollup merge of #50344 - SimonSapin:cargo, r=alexcrichton

Update Cargo to 2018-04-28 122fd5be5201913d42e219e132d6569493583bca

6 years agoRollup merge of #50330 - japaric:used, r=nagisa
kennytm [Mon, 30 Apr 2018 17:18:41 +0000 (01:18 +0800)]
Rollup merge of #50330 - japaric:used, r=nagisa

check that #[used] is used only on statics

this attribute has no effect on other items. This makes the implementation match what's described in the RFC.

cc #40289

r? @nagisa

6 years agoRollup merge of #50327 - varkor:match-unused-struct-field, r=estebank
kennytm [Mon, 30 Apr 2018 17:18:40 +0000 (01:18 +0800)]
Rollup merge of #50327 - varkor:match-unused-struct-field, r=estebank

Display correct unused field suggestion for nested struct patterns

Extends https://github.com/rust-lang/rust/pull/47922 by checking more sophisticated patterns (e.g. references, slices, etc.).
Before:
```
warning: unused variable: `bar`
  --> src/main.rs:37:21
   |
37 |         &Foo::Bar { bar } => true,
   |                     ^^^ help: consider using `_bar` instead
   |
   = note: #[warn(unused_variables)] on by default
```
After:
```
warning: unused variable: `bar`
  --> src/main.rs:37:21
   |
37 |         &Foo::Bar { bar } => true,
   |                     ^^^ help: try ignoring the field: `bar: _`
   |
   = note: #[warn(unused_variables)] on by default
```

Fixes #50303.

r? @estebank

6 years agoRollup merge of #50325 - petrochenkov:pmgate, r=alexcrichton
kennytm [Mon, 30 Apr 2018 17:18:39 +0000 (01:18 +0800)]
Rollup merge of #50325 - petrochenkov:pmgate, r=alexcrichton

Add a few more tests for proc macro feature gating

6 years agoRollup merge of #50316 - ehuss:fix-doc-links, r=frewsxcv
kennytm [Mon, 30 Apr 2018 17:18:38 +0000 (01:18 +0800)]
Rollup merge of #50316 - ehuss:fix-doc-links, r=frewsxcv

Fix some broken links in docs.

6 years agoRollup merge of #50312 - Pazzaz:master, r=GuillaumeGomez
kennytm [Mon, 30 Apr 2018 17:18:37 +0000 (01:18 +0800)]
Rollup merge of #50312 - Pazzaz:master, r=GuillaumeGomez

Add more links in panic docs

Fixes #48695 by adding a link to `AssertUnwindSafe`. Also added some other links in the module's docs to make things clearer.

6 years agoRollup merge of #50233 - mark-i-m:const_vec, r=kennytm
kennytm [Mon, 30 Apr 2018 17:18:36 +0000 (01:18 +0800)]
Rollup merge of #50233 - mark-i-m:const_vec, r=kennytm

Make `Vec::new` a `const fn`

`RawVec::empty/_in` are a hack. They're there because `if size_of::<T> == 0 { !0 } else { 0 }` is not allowed in `const` yet. However, because `RawVec` is unstable, the `empty/empty_in` constructors can be removed when #49146 is done...

6 years agoAuto merge of #50163 - kornelski:error, r=Kimundi
bors [Mon, 30 Apr 2018 15:17:01 +0000 (15:17 +0000)]
Auto merge of #50163 - kornelski:error, r=Kimundi

Bury Error::description()

Second attempt of #49536 https://github.com/rust-lang/rfcs/pull/2230

The exact wording of the default implementation is still up in the air, but I think it's a detail that can be amended later.

6 years agoUpdate Cargo to 2018-04-28 122fd5be5201913d42e219e132d6569493583bca
Simon Sapin [Mon, 30 Apr 2018 15:04:42 +0000 (17:04 +0200)]
Update Cargo to 2018-04-28 122fd5be5201913d42e219e132d6569493583bca

6 years agoAuto merge of #50326 - ollie27:rustdoc_cross_crate_const_link, r=GuillaumeGomez
bors [Mon, 30 Apr 2018 10:30:14 +0000 (10:30 +0000)]
Auto merge of #50326 - ollie27:rustdoc_cross_crate_const_link, r=GuillaumeGomez

rustdoc: Fix links to constants in external crates

r? @GuillaumeGomez

6 years agoAuto merge of #50272 - scottmcm:termination-test-error, r=nikomatsakis
bors [Mon, 30 Apr 2018 07:48:50 +0000 (07:48 +0000)]
Auto merge of #50272 - scottmcm:termination-test-error, r=nikomatsakis

Add a ui test for an incorrect Result success type in a #[test]

cc https://github.com/rust-lang/rust/issues/48854#issuecomment-384730601
r? @nikomatsakis

6 years agocheck that #[used] is used only on statics
Jorge Aparicio [Mon, 30 Apr 2018 05:43:22 +0000 (07:43 +0200)]
check that #[used] is used only on statics

6 years agoAuto merge of #50204 - Manishearth:approx-enum, r=estebank
bors [Mon, 30 Apr 2018 05:38:06 +0000 (05:38 +0000)]
Auto merge of #50204 - Manishearth:approx-enum, r=estebank

Use enum for approximate suggestions

r? @nrc @killercup

6 years agoAuto merge of #50261 - nrc:update, r=kennytm
bors [Mon, 30 Apr 2018 02:32:52 +0000 (02:32 +0000)]
Auto merge of #50261 - nrc:update, r=kennytm

Update Rustfmt

r? @kennytm

Updates rustfmt, should fix the broken tests, but I can't reproduce locally, so who knows?

6 years agoUpdate Rustfmt
Nick Cameron [Thu, 26 Apr 2018 23:45:34 +0000 (11:45 +1200)]
Update Rustfmt

6 years agoCorrect unused field warning on struct match container patterns
varkor [Mon, 30 Apr 2018 00:27:37 +0000 (01:27 +0100)]
Correct unused field warning on struct match container patterns

6 years agoAuto merge of #50092 - abonander:issue-49934, r=petrochenkov
bors [Mon, 30 Apr 2018 00:18:49 +0000 (00:18 +0000)]
Auto merge of #50092 - abonander:issue-49934, r=petrochenkov

Warn on pointless #[derive] in more places

This fixes the regression in #49934 and ensures that unused `#[derive]` invocations on statements, expressions and generic type parameters survive to trip the `unused_attributes` lint. There is a separate warning hardcoded for `#[derive]` on macro invocations since linting (even the early-lint pass) occurs after expansion. This also adds regression tests for some nodes that were already warning properly.

closes #49934

6 years agoCorrect unused field warning on box struct match
varkor [Sun, 29 Apr 2018 23:51:02 +0000 (00:51 +0100)]
Correct unused field warning on box struct match

6 years agoCorrect unused field warning on &struct match
varkor [Sun, 29 Apr 2018 23:40:11 +0000 (00:40 +0100)]
Correct unused field warning on &struct match

6 years agoWarn on pointless `#[derive]` in more places
Austin Bonander [Wed, 18 Apr 2018 06:19:21 +0000 (23:19 -0700)]
Warn on pointless `#[derive]` in more places

This fixes the regression in #49934 and ensures that unused `#[derive]`s on statements, expressions and generic type parameters survive to trip the `unused_attributes` lint. For `#[derive]` on macro invocations it has a hardcoded warning since linting occurs after expansion. This also adds regression testing for some nodes that were already warning properly.

closes #49934

6 years agorustdoc: Fix links to constants in external crates
Oliver Middleton [Sun, 29 Apr 2018 22:28:39 +0000 (23:28 +0100)]
rustdoc: Fix links to constants in external crates

6 years agoheh, logic is hard
Mark Mansi [Sun, 29 Apr 2018 22:27:17 +0000 (17:27 -0500)]
heh, logic is hard

6 years agoAdd a few more tests for proc macro feature gating
Vadim Petrochenkov [Sun, 29 Apr 2018 22:13:54 +0000 (01:13 +0300)]
Add a few more tests for proc macro feature gating

6 years agouse const trick
Mark Mansi [Sun, 29 Apr 2018 22:13:49 +0000 (17:13 -0500)]
use const trick

6 years agoAuto merge of #50317 - varkor:repr-align-assign, r=nagisa
bors [Sun, 29 Apr 2018 21:55:50 +0000 (21:55 +0000)]
Auto merge of #50317 - varkor:repr-align-assign, r=nagisa

Improve error message for #[repr(align=x)]

Before:
```
error[E0552]: unrecognized representation hint
 --> src/main.rs:1:8
  |
1 | #[repr(align="8")]
  |        ^^^^^^^^^
```
After:
```
error[E0693]: incorrect `repr(align)` attribute format
 --> src/main.rs:1:8
  |
2 | #[repr(align="8")]
  |        ^^^^^^^^^ help: use parentheses instead: `align(8)`
```

Fixes #50314.

6 years agoAdd test for repr(align=x)
varkor [Sun, 29 Apr 2018 17:46:41 +0000 (18:46 +0100)]
Add test for repr(align=x)

6 years agoAdd error when using repr(align=x) instead of repr(align(x))
varkor [Sun, 29 Apr 2018 17:42:43 +0000 (18:42 +0100)]
Add error when using repr(align=x) instead of repr(align(x))

6 years agoFix some broken links in docs.
Eric Huss [Sun, 29 Apr 2018 17:15:40 +0000 (10:15 -0700)]
Fix some broken links in docs.

6 years agoAuto merge of #48605 - KiChjang:unused-mut-warning, r=nikomatsakis
bors [Sun, 29 Apr 2018 16:25:04 +0000 (16:25 +0000)]
Auto merge of #48605 - KiChjang:unused-mut-warning, r=nikomatsakis

Allow MIR borrowck to catch unused mutable locals

Fixes #47279.

r? @nikomatsakis

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 agoAdd more links in panic docs
Pazzaz [Sun, 29 Apr 2018 11:45:33 +0000 (13:45 +0200)]
Add more links in panic docs

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 agoAdd the actual used mutable var to the set
Keith Yeung [Sun, 22 Apr 2018 06:41:44 +0000 (23:41 -0700)]
Add the actual used mutable var to the set

6 years agoReturn RootPlace in is_mutable
Niko Matsakis [Fri, 6 Apr 2018 16:35:50 +0000 (12:35 -0400)]
Return RootPlace in is_mutable

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 agofeature on test
Mark Mansi [Sun, 29 Apr 2018 01:59:25 +0000 (20:59 -0500)]
feature on test

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 agoSkip implicit self argument for closures
Keith Yeung [Fri, 23 Mar 2018 08:59:56 +0000 (01:59 -0700)]
Skip implicit self argument for closures

6 years agoReturn LocalMutationIsAllowed in is_mutable
Keith Yeung [Tue, 20 Mar 2018 19:58:38 +0000 (12:58 -0700)]
Return LocalMutationIsAllowed in is_mutable

6 years agoDetermine unused mutable variables based on the 'root' place
Keith Yeung [Fri, 16 Mar 2018 09:52:07 +0000 (02:52 -0700)]
Determine unused mutable variables based on the 'root' place

6 years agoOnly check possibly initialized values and also loop over fn args
Keith Yeung [Mon, 12 Mar 2018 15:47:44 +0000 (08:47 -0700)]
Only check possibly initialized values and also loop over fn args

6 years agoTrack unused mutable variables across closures
Keith Yeung [Sat, 3 Mar 2018 04:42:37 +0000 (20:42 -0800)]
Track unused mutable variables across closures

6 years agoDisable AST unused mut check when using MIR borrowck
Keith Yeung [Fri, 2 Mar 2018 05:14:36 +0000 (21:14 -0800)]
Disable AST unused mut check when using MIR borrowck

6 years agoAllow MIR borrowck to catch unused mutable locals
Keith Yeung [Wed, 28 Feb 2018 09:09:08 +0000 (01:09 -0800)]
Allow MIR borrowck to catch unused mutable locals

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 agoAdd a ui test for an incorrect Result success type in a #[test]
Scott McMurray [Fri, 27 Apr 2018 04:33:05 +0000 (21:33 -0700)]
Add a ui test for an incorrect Result success type in a #[test]

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