]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoAuto merge of #50378 - varkor:repr-align-max-29, r=eddyb
bors [Thu, 3 May 2018 05:38:11 +0000 (05:38 +0000)]
Auto merge of #50378 - varkor:repr-align-max-29, r=eddyb

Reduce maximum repr(align(N)) to 2^29

The current maximum `repr(align(N))` alignment is larger than the maximum alignment accepted by LLVM, which can cause issues for huge values of `N`, as seen in #49492. Fixes #49492.

r? @rkruppe

6 years agoAuto merge of #50369 - pftbest:unicode, r=SimonSapin
bors [Thu, 3 May 2018 02:01:04 +0000 (02:01 +0000)]
Auto merge of #50369 - pftbest:unicode, r=SimonSapin

Fix a warning in libcore on 16bit targets.

This code is assuming that usize >= 32bits, but it is not the case on
16bit targets. It is producing a warning that can fail the compilation
on MSP430 if deny(warnings) is enabled.
It is very unlikely that someone would actually use this code on
a microcontroller, but since unicode was merged into libcore we
have to compile it on 16bit targets.

I've tried to make sure that the code stays the same on x86,
here is an assembly comparison: https://godbolt.org/g/wFw7dZ

r? @SimonSapin

6 years agoAuto merge of #50355 - petrochenkov:50187, r=oli-obk
bors [Wed, 2 May 2018 20:33:31 +0000 (20:33 +0000)]
Auto merge of #50355 - petrochenkov:50187, r=oli-obk

Fix an unresolved import issue with enabled `use_extern_macros`

This is a kinda ugly special-purpose solution that will break if we suddenly add a fourth namespace, but I hope to come up with something more general if I get to import resolution refactoring this summer.

Fixes https://github.com/rust-lang/rust/issues/50187 thus removing a blocker for stabilization of `use_extern_macros`

6 years agoAuto merge of #50354 - varkor:initial-field-alignment-c-int, r=eddyb
bors [Wed, 2 May 2018 17:02:25 +0000 (17:02 +0000)]
Auto merge of #50354 - varkor:initial-field-alignment-c-int, r=eddyb

Correct initial field alignment for repr(C)/repr(int)

Fixes #50098 following https://github.com/rust-lang/rust/issues/50098#issuecomment-385497333.

(I wasn't sure which kind of test was best suited here — I picked run-pass simply because that was convenient, but if codegen is more appropriate, let me know and I'll change it.)

r? @eddyb

6 years agoAuto merge of #49943 - pnkfelix:fix-issue-49918, r=nikomatsakis
bors [Wed, 2 May 2018 12:20:31 +0000 (12:20 +0000)]
Auto merge of #49943 - pnkfelix:fix-issue-49918, r=nikomatsakis

Treat generators as if they have an arbitrary destructor

Conservatively assume dropping a generator touches its upvars, via locals' destructors.

Fix #49918

6 years agoAuto merge of #50339 - nnethercote:lazy-Printer-buf, r=michaelwoerister
bors [Wed, 2 May 2018 10:13:11 +0000 (10:13 +0000)]
Auto merge of #50339 - nnethercote:lazy-Printer-buf, r=michaelwoerister

Extend Printer::buf on demand.

So that 55 entries (at 48 bytes each) don't need to be eagerly
initialized on creation.

This speeds up numerous rust-perf benchmark runs, by up to 3%.
```
crates.io-check
        avg: -2.4%      min: -3.7%      max: -1.1%
encoding-check
        avg: -2.1%      min: -2.9%      max: -1.2%
crates.io-opt
        avg: -1.3%      min: -2.7%      max: -0.1%
crates.io
        avg: -1.4%      min: -2.7%      max: -0.3%
encoding-opt
        avg: -1.1%      min: -2.5%      max: 0.1%
encoding
        avg: -1.3%      min: -2.4%      max: -0.3%
hyper-check
        avg: -1.7%      min: -2.3%      max: -0.9%
regex-check
        avg: -1.5%      min: -1.9%      max: -0.7%
piston-image-check
        avg: -0.9%      min: -1.8%      max: -0.5%
hyper
        avg: -1.0%      min: -1.7%      max: -0.3%
hyper-opt
        avg: -0.9%      min: -1.7%      max: -0.1%
syn-check
        avg: -1.0%      min: -1.5%      max: -0.6%
clap-rs
        avg: -0.3%      min: -1.5%      max: 0.2%
regex-opt
        avg: -0.6%      min: -1.5%      max: -0.0%
regression-31157-check
        avg: -1.1%      min: -1.4%      max: -0.7%
regex
        avg: -0.7%      min: -1.3%      max: -0.1%
clap-rs-check
        avg: -0.5%      min: -1.2%      max: 0.1%
syn-opt
        avg: -0.5%      min: -1.1%      max: -0.1%
syn
        avg: -0.5%      min: -1.1%      max: -0.2%
serde-opt
        avg: -0.3%      min: -1.1%      max: 0.1%
piston-image-opt
        avg: -0.4%      min: -1.1%      max: -0.0%
piston-image
        avg: -0.4%      min: -1.0%      max: -0.0%
```

6 years agoAuto merge of #50329 - Zoxc:opt-3, r=alexcrichton
bors [Wed, 2 May 2018 07:50:23 +0000 (07:50 +0000)]
Auto merge of #50329 - Zoxc:opt-3, r=alexcrichton

Set opt-level to 3

r? @alexcrichton

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 agoReduce the maximum alignment to repr(align(1 << 29))
varkor [Tue, 1 May 2018 20:26:23 +0000 (21:26 +0100)]
Reduce the maximum alignment to repr(align(1 << 29))

This brings it into line with LLVM's maximum permitted alignment.

6 years agoAdd E0589 to the error index
varkor [Tue, 1 May 2018 20:44:37 +0000 (21:44 +0100)]
Add E0589 to the error index

6 years agoUpdate ui/generator tests to reflect changes from new generator drop rules.
Felix S. Klock II [Mon, 16 Apr 2018 10:41:32 +0000 (12:41 +0200)]
Update ui/generator tests to reflect changes from new generator drop rules.

6 years agoConservatively assume dropping a generator touches its upvars, via locals' dtors.
Felix S. Klock II [Fri, 13 Apr 2018 15:11:53 +0000 (17:11 +0200)]
Conservatively assume dropping a generator touches its upvars, via locals' dtors.

This is meant to address rust-lang/rust#49918.

Review feedback: put back comment justifying skipping interior traversal.

Review feedback: dropck generators like trait objects: all their upvars must
outlive the generator itself, so just create a DtorckConstraint saying so.

6 years agoAdd a print_types_sizes regression test
varkor [Tue, 1 May 2018 19:25:30 +0000 (20:25 +0100)]
Add a print_types_sizes regression test

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 agoAdd repr(u8) to the test
varkor [Tue, 1 May 2018 17:52:27 +0000 (18:52 +0100)]
Add repr(u8) to the test

6 years agoCorrect initial field alignment for repr(C)/repr(int)
varkor [Mon, 30 Apr 2018 23:13:14 +0000 (00:13 +0100)]
Correct initial field alignment for repr(C)/repr(int)

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 a warning in libcore on 16bit targets.
Vadzim Dambrouski [Tue, 1 May 2018 14:48:31 +0000 (17:48 +0300)]
Fix a warning in libcore on 16bit targets.

This code is assuming that usize >= 32bits, but it is not the case on
16bit targets. It is producing a warning that will fail the compilation
on MSP430 if deny(warnings) is enabled.
It is very unlikely that someone would actually use this code on
a microcontroller, but since unicode was merged into libcore we
have compile it on 16bit targets.

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 agoSet opt-level to 3
John Kåre Alsaker [Tue, 20 Mar 2018 00:18:08 +0000 (01:18 +0100)]
Set opt-level to 3

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 agoBetter support for import resolution in 3 namespaces
Vadim Petrochenkov [Tue, 1 May 2018 00:12:36 +0000 (03:12 +0300)]
Better support for import resolution in 3 namespaces

6 years agoresolve (cleanup): Get rid of `Option` in `PerNS`
Vadim Petrochenkov [Sun, 29 Apr 2018 23:20:14 +0000 (02:20 +0300)]
resolve (cleanup): Get rid of `Option` in `PerNS`

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 agoExtend Printer::buf on demand.
Nicholas Nethercote [Fri, 27 Apr 2018 21:33:34 +0000 (07:33 +1000)]
Extend Printer::buf on demand.

So that 55 entries (at 48 bytes each) don't need to be eagerly
initialized on creation.

This speeds up numerous rust-perf benchmark runs, by up to 3%.

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.