]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agomake it compile again
flip1995 [Tue, 17 Apr 2018 13:33:39 +0000 (15:33 +0200)]
make it compile again

6 years agoFix failures in rustdoc
Seiichi Uchida [Sun, 4 Feb 2018 07:00:24 +0000 (16:00 +0900)]
Fix failures in rustdoc

6 years agoChange Attribute::name to return the last segment
Seiichi Uchida [Sun, 4 Feb 2018 06:36:26 +0000 (15:36 +0900)]
Change Attribute::name to return the last segment

And fix some typos

6 years agoAdd tool_attributes feature to unstable book
Seiichi Uchida [Tue, 30 Jan 2018 10:29:11 +0000 (19:29 +0900)]
Add tool_attributes feature to unstable book

6 years agoGate tool_attributes feature
Seiichi Uchida [Tue, 30 Jan 2018 10:28:55 +0000 (19:28 +0900)]
Gate tool_attributes feature

6 years agoRemove Option from the return type of Attribute::name()
Seiichi Uchida [Tue, 30 Jan 2018 05:53:01 +0000 (14:53 +0900)]
Remove Option from the return type of Attribute::name()

6 years agoAllow Path for name of MetaItem
Seiichi Uchida [Tue, 30 Jan 2018 05:30:39 +0000 (14:30 +0900)]
Allow Path for name of MetaItem

6 years agoAdd tests for a new feature 'tool_attributes'
Seiichi Uchida [Tue, 30 Jan 2018 04:12:37 +0000 (13:12 +0900)]
Add tests for a new feature 'tool_attributes'

6 years agoAuto merge of #50282 - fitzgen:run-more-passes-on-constant-mir, r=nikomatsakis
bors [Wed, 2 May 2018 05:22:29 +0000 (05:22 +0000)]
Auto merge of #50282 - fitzgen:run-more-passes-on-constant-mir, r=nikomatsakis

Run more passes on constant mir

Not very familiar with this code, but everything seems to be working!

r? @eddyb

6 years agoAuto merge of #50278 - eddyb:mir-succ-iter, r=nikomatsakis
bors [Wed, 2 May 2018 02:10:51 +0000 (02:10 +0000)]
Auto merge of #50278 - eddyb:mir-succ-iter, r=nikomatsakis

rustc: return iterators from Terminator(Kind)::successors(_mut).

Minor cleanup (and potentially speedup) prompted by @nnethercote's `SmallVec` experiments.
This PR assumes `.count()` and `.nth(i)` on `iter::Chain<option::IntoIter, slice::Iter(Mut)>` are `O(1)`, but otherwise all of the uses appear to immediately iterate through the successors.

r? @nikomatsakis

6 years agoAuto merge of #50379 - nrc:update, r=alexcrichton
bors [Tue, 1 May 2018 23:43:32 +0000 (23:43 +0000)]
Auto merge of #50379 - nrc:update, r=alexcrichton

Update RLS

r? @alexcrichton

Fixes RLS tests (broken by Cargo update) and enables nightly release

6 years agoUpdate RLS and Rustfmt
Nick Cameron [Tue, 1 May 2018 19:50:58 +0000 (07:50 +1200)]
Update RLS and Rustfmt

6 years agoAuto merge of #49982 - petrochenkov:noreex, r=alexcrichton
bors [Tue, 1 May 2018 21:22:49 +0000 (21:22 +0000)]
Auto merge of #49982 - petrochenkov:noreex, r=alexcrichton

Remove unstable `macro_reexport`

It's subsumed by `feature(use_extern_macros)` and `pub use`

cc https://github.com/rust-lang/rust/issues/35896
closes https://github.com/rust-lang/rust/issues/29638
closes https://github.com/rust-lang/rust/issues/38951

6 years agoAuto merge of #50374 - petrochenkov:pypath, r=Mark-Simulacrum
bors [Tue, 1 May 2018 19:14:34 +0000 (19:14 +0000)]
Auto merge of #50374 - petrochenkov:pypath, r=Mark-Simulacrum

rustbuild: Normalize paths coming from Python slightly

Fixes #49785

6 years agorustbuild: Normalize paths coming from Python slightly
Vadim Petrochenkov [Tue, 1 May 2018 18:25:38 +0000 (21:25 +0300)]
rustbuild: Normalize paths coming from Python slightly

Fixes #49785

6 years agoAuto merge of #49789 - petrochenkov:prelext, r=nikomatsakis
bors [Tue, 1 May 2018 16:58:26 +0000 (16:58 +0000)]
Auto merge of #49789 - petrochenkov:prelext, r=nikomatsakis

Module experiments: Add one more prelude layer for extern crate names passed with `--extern`

Implements one item from https://internals.rust-lang.org/t/the-great-module-adventure-continues/6678/183

When some name is looked up in lexical scope (`name`, i.e. not module-relative scope `some_mod::name` or `::name`), it's searched roughly in the next order:
- local variables
- items in unnamed blocks
- items in the current module
- :sparkles: NEW! :sparkles: crate names passed with `--extern` ("extern prelude")
- standard library prelude (`Vec`, `drop`)
- language prelude (built-in types like `u8`, `str`, etc)

The last two layers contain a limited set of names controlled by us and not arbitrary user-defined names like upper layers. We want to be able to add new names into these two layers without breaking user code, so "extern prelude" names have higher priority than std prelude and built-in types.
This is a one-time breaking change, that's why it would be nice to run this through crater.
Practical impact is expected to be minimal though due to stylistic reasons (there are not many `Uppercase` crates) and due to the way how primitive types are resolved (https://github.com/rust-lang/rust/pull/32131).

6 years agoFix an error from "unused" lint + Fix rebase
Vadim Petrochenkov [Mon, 30 Apr 2018 11:06:24 +0000 (14:06 +0300)]
Fix an error from "unused" lint + Fix rebase

6 years agoGive removal reasons to removed features
Vadim Petrochenkov [Sun, 29 Apr 2018 14:58:51 +0000 (17:58 +0300)]
Give removal reasons to removed features

6 years agoRemove `macro_reexport`
Vadim Petrochenkov [Sun, 15 Apr 2018 13:59:00 +0000 (16:59 +0300)]
Remove `macro_reexport`

It's subsumed by `feature(use_extern_macros)` and `pub use`

6 years agoAuto merge of #50198 - oli-obk:const_prop, r=eddyb
bors [Tue, 1 May 2018 12:16:14 +0000 (12:16 +0000)]
Auto merge of #50198 - oli-obk:const_prop, r=eddyb

Remove some unused code

6 years agoMerge adjacent write! invocations
Oliver Schneider [Tue, 1 May 2018 10:26:58 +0000 (12:26 +0200)]
Merge adjacent write! invocations

6 years agorustc: return impl Iterator from Terminator(Kind)::successors(_mut).
Eduard-Mihai Burtescu [Fri, 27 Apr 2018 11:02:09 +0000 (14:02 +0300)]
rustc: return impl Iterator from Terminator(Kind)::successors(_mut).

6 years agoAuto merge of #49724 - kennytm:range-inc-start-end-methods, r=Kimundi
bors [Tue, 1 May 2018 10:10:46 +0000 (10:10 +0000)]
Auto merge of #49724 - kennytm:range-inc-start-end-methods, r=Kimundi

Introduce RangeInclusive::{new, start, end} methods and make the fields private.

cc #49022

6 years agoAuto merge of #48786 - nagisa:fp, r=nikomatsakis
bors [Tue, 1 May 2018 08:05:51 +0000 (08:05 +0000)]
Auto merge of #48786 - nagisa:fp, r=nikomatsakis

Add force-frame-pointer flag to allow control of frame pointer ommision

Rebase of #47152 plus some changes suggested by https://github.com/rust-lang/rust/issues/48785.

Fixes #11906

r? @nikomatsakis

6 years agoForce frame pointers for the backtrace test
Simonas Kazlauskas [Wed, 18 Apr 2018 17:48:34 +0000 (20:48 +0300)]
Force frame pointers for the backtrace test

6 years agoDon’t eliminate frame pointers on apple by default
Simonas Kazlauskas [Sat, 24 Mar 2018 19:54:21 +0000 (21:54 +0200)]
Don’t eliminate frame pointers on apple by default

6 years agoRework force-frame-pointer
Simonas Kazlauskas [Tue, 6 Mar 2018 18:27:19 +0000 (20:27 +0200)]
Rework force-frame-pointer

This reworks the force-frame-pointer PR to explicitly only consider the
value of the flag if it is provided, and use a target default otherwise.

Something that was tried but not kept was renaming the flag to
`frame-pointer`, because for flag `frame-pointer=no`, there is no
guarante, that LLVM will elide *all* the frame pointers; oposite of what
the literal reading of the flag would suggest.

6 years agoDon't force-enable frame pointers when generating debug info
Björn Steinbrink [Wed, 3 Jan 2018 09:29:27 +0000 (10:29 +0100)]
Don't force-enable frame pointers when generating debug info

We apparently used to generate bad/incomplete debug info causing
debuggers not to find symbols of stack allocated variables. This was
somehow worked around by having frame pointers.

With the current codegen, this seems no longer necessary, so we can
remove the code that force-enables frame pointers whenever debug info
is requested.

Since certain situations, like profiling code profit from having frame
pointers, we add a -Cforce-frame-pointers flag to always enable frame
pointers.

Fixes #11906

6 years agoAuto merge of #50304 - nox:uninhabited-output, r=eddyb
bors [Tue, 1 May 2018 05:52:12 +0000 (05:52 +0000)]
Auto merge of #50304 - nox:uninhabited-output, r=eddyb

Mark functions returning uninhabited types as noreturn

6 years agoAuto merge of #50197 - nikomatsakis:skolemize-out-of-tcx, r=eddyb
bors [Tue, 1 May 2018 00:16:16 +0000 (00:16 +0000)]
Auto merge of #50197 - nikomatsakis:skolemize-out-of-tcx, r=eddyb

move skolemized regions into global tcx

Experimental branch to move skolemized regions into global tcx. This is probably not what we want long term but may be convenient to unblock @sgrif in the short term.

I'd like to do a perf run, though the main concern I guess would be memory usage.

r? @eddyb

6 years agoAuto merge of #48925 - zackmdavis:fn_must_stabilize, r=nikomatsakis
bors [Mon, 30 Apr 2018 22:02:33 +0000 (22:02 +0000)]
Auto merge of #48925 - zackmdavis:fn_must_stabilize, r=nikomatsakis

stabilize `#[must_use]` for functions and must-use comparison operators (RFC 1940)

r? @nikomatsakis

6 years agoput ReSkolemized into the global tcx
Niko Matsakis [Wed, 4 Apr 2018 22:24:17 +0000 (18:24 -0400)]
put ReSkolemized into the global tcx

6 years agomake needs_infer specific to inference variables
Niko Matsakis [Wed, 4 Apr 2018 21:21:50 +0000 (17:21 -0400)]
make needs_infer specific to inference variables

Notably, excluding ReSkolemized

6 years agonew() should be const; start()/end() after iteration is unspecified.
kennytm [Sat, 7 Apr 2018 06:19:34 +0000 (14:19 +0800)]
new() should be const; start()/end() after iteration is unspecified.

6 years agoRemoved direct field usage of RangeInclusive in rustc itself.
kennytm [Thu, 5 Apr 2018 21:21:47 +0000 (05:21 +0800)]
Removed direct field usage of RangeInclusive in rustc itself.

6 years agoremove some (apparently) dead code
Niko Matsakis [Wed, 4 Apr 2018 21:17:23 +0000 (17:17 -0400)]
remove some (apparently) dead code

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 agoImprove div by zero const eval errors
Oliver Schneider [Sat, 28 Apr 2018 11:35:35 +0000 (13:35 +0200)]
Improve div by zero const eval errors

6 years agoUpdate Cargo.lock
Oliver Schneider [Fri, 27 Apr 2018 13:21:42 +0000 (15:21 +0200)]
Update Cargo.lock

6 years agoUnify MIR assert messages and const eval errors
Oliver Schneider [Fri, 27 Apr 2018 13:21:31 +0000 (15:21 +0200)]
Unify MIR assert messages and const eval errors

6 years agoUpdate ui test output
Oliver Schneider [Thu, 26 Apr 2018 13:02:54 +0000 (15:02 +0200)]
Update ui test output

6 years agoMerge ConstMathError into EvalErrorKind
Oliver Schneider [Thu, 26 Apr 2018 12:52:59 +0000 (14:52 +0200)]
Merge ConstMathError into EvalErrorKind

6 years agoRemove the `rustc_const_math` crate
Oliver Schneider [Thu, 26 Apr 2018 09:37:03 +0000 (11:37 +0200)]
Remove the `rustc_const_math` crate

6 years agoReintroduce the float parsing error
Oliver Schneider [Thu, 26 Apr 2018 08:39:04 +0000 (10:39 +0200)]
Reintroduce the float parsing error

6 years agoRemove ConstFloat
Oliver Schneider [Wed, 25 Apr 2018 13:26:12 +0000 (15:26 +0200)]
Remove ConstFloat

6 years agoRemoved unused dependencies on rustc_const_math
Oliver Schneider [Tue, 24 Apr 2018 13:36:25 +0000 (15:36 +0200)]
Removed unused dependencies on rustc_const_math

6 years agoRemove unused const math ops
Oliver Schneider [Tue, 24 Apr 2018 13:35:58 +0000 (15:35 +0200)]
Remove unused const math ops

6 years agoRemove unused const error variant
Oliver Schneider [Tue, 24 Apr 2018 13:09:09 +0000 (15:09 +0200)]
Remove unused const error variant

6 years agoRemove the `UnequalTypes` error variant
Oliver Schneider [Tue, 24 Apr 2018 12:55:34 +0000 (14:55 +0200)]
Remove the `UnequalTypes` error variant

6 years agoImplement `PartialCmp` for `ConstFloat`
Oliver Schneider [Tue, 24 Apr 2018 12:42:30 +0000 (14:42 +0200)]
Implement `PartialCmp` for `ConstFloat`

6 years agoComment typo
Oliver Schneider [Tue, 24 Apr 2018 12:36:16 +0000 (14:36 +0200)]
Comment typo

6 years agoRemove unused error variants
Oliver Schneider [Tue, 24 Apr 2018 12:17:05 +0000 (14:17 +0200)]
Remove unused error variants

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 agoMake the fields of RangeInclusive private.
kennytm [Thu, 5 Apr 2018 18:03:22 +0000 (02:03 +0800)]
Make the fields of RangeInclusive private.

Added new()/start()/end() methods to RangeInclusive.

Changed the lowering of `..=` to use RangeInclusive::new().

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 agostabilize `#[must_use]` for functions and must-use operators
Zack M. Davis [Sun, 11 Mar 2018 00:23:28 +0000 (16:23 -0800)]
stabilize `#[must_use]` for functions and must-use operators

This is in the matter of RFC 1940 and tracking issue #43302.

6 years agoin which the fn-must-use codepath is prevented from panicking on closure
Zack M. Davis [Sat, 10 Mar 2018 22:26:33 +0000 (14:26 -0800)]
in which the fn-must-use codepath is prevented from panicking on closure

The must-use lint needs the DefId of called functions and method
receivers in order to look for a `#[must_use]` attribute, but this would
ICE (!) if a called function was actually a closure (with a non-unit
return value). Instead, let's be specific that we want a `Def::Fn`,
rather than blithely assuming that we can get the DefId of a qpath.

Supporting must-use closures doesn't seem like a priority, but could
conceivably be added in the future if desired (conditional on the
statement and expression attributes (#15701) story being amicable).

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 agoMark functions returning uninhabited types as noreturn
Anthony Ramine [Sat, 28 Apr 2018 18:35:26 +0000 (20:35 +0200)]
Mark functions returning uninhabited types as noreturn

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