]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoAdd tests for trivial bounds
Matthew Jasper [Sun, 6 May 2018 21:54:00 +0000 (22:54 +0100)]
Add tests for trivial bounds

6 years agoAdd trivial bounds lint
Matthew Jasper [Sun, 6 May 2018 21:52:58 +0000 (22:52 +0100)]
Add trivial bounds lint

6 years agoFeature gate trivial bounds
Matthew Jasper [Sun, 6 May 2018 21:50:35 +0000 (22:50 +0100)]
Feature gate trivial bounds

6 years agoImplement RFC 2056 - trivial constraints
Matthew Jasper [Sun, 6 May 2018 21:48:56 +0000 (22:48 +0100)]
Implement RFC 2056 - trivial constraints

6 years agoAuto merge of #50748 - steveklabnik:remove-simd-note, r=alexcrichton
bors [Tue, 15 May 2018 08:19:06 +0000 (08:19 +0000)]
Auto merge of #50748 - steveklabnik:remove-simd-note, r=alexcrichton

Update stdsimd module

to include https://github.com/rust-lang-nursery/stdsimd/commit/a19ca1cd91cf97777af8268a6136bd2e4648e189

6 years agoAuto merge of #50259 - GuillaumeGomez:improve-results, r=ollie27
bors [Tue, 15 May 2018 05:39:35 +0000 (05:39 +0000)]
Auto merge of #50259 - GuillaumeGomez:improve-results, r=ollie27

Rustdoc improvements

Fixes #50658. (last commit)

A lot of small improvements.

r? @QuietMisdreavus

6 years agoAuto merge of #50011 - varkor:partialord-opt-ii, r=Manishearth
bors [Tue, 15 May 2018 03:14:46 +0000 (03:14 +0000)]
Auto merge of #50011 - varkor:partialord-opt-ii, r=Manishearth

Ensure derive(PartialOrd) is no longer accidentally exponential

Previously, two comparison operations would be generated for each field, each of which could delegate to another derived PartialOrd. Now we use ordering and optional chaining to ensure each pair of fields is only compared once, addressing https://github.com/rust-lang/rust/issues/49650#issuecomment-379467572.

Closes #49505.

r? @Manishearth (sorry for changing it again so soon!)

Close #50755

6 years agoAuto merge of #50705 - oli-obk:clippy, r=kennytm
bors [Tue, 15 May 2018 00:35:47 +0000 (00:35 +0000)]
Auto merge of #50705 - oli-obk:clippy, r=kennytm

Update clippy

r? @Manishearth

@bors p=1

6 years agoAuto merge of #50693 - dlrobertson:fix_50493, r=petrochenkov
bors [Mon, 14 May 2018 20:46:09 +0000 (20:46 +0000)]
Auto merge of #50693 - dlrobertson:fix_50493, r=petrochenkov

typeck: Save the index of private fields

Save the index of all fields regardless of their visibility. Problems
could occur later when attempting to index fields in error recovery if
they are not inserted.

Fixes: #50493
6 years agoAuto merge of #50735 - eddyb:issue-50731, r=nikomatsakis
bors [Mon, 14 May 2018 18:04:11 +0000 (18:04 +0000)]
Auto merge of #50735 - eddyb:issue-50731, r=nikomatsakis

rustc: don't trip an assertion for enums with present but uninhabited variants.

Fixes #50731.

r? @nikomatsakis

6 years agoUpdate stdsimd module to include https://github.com/rust-lang-nursery/stdsimd/commit...
steveklabnik [Mon, 14 May 2018 16:32:04 +0000 (12:32 -0400)]
Update stdsimd module to include https://github.com/rust-lang-nursery/stdsimd/commit/a19ca1cd91cf97777af8268a6136bd2e4648e189

6 years agoBump clippy
Oliver Schneider [Mon, 14 May 2018 14:11:24 +0000 (16:11 +0200)]
Bump clippy

6 years agoAuto merge of #50385 - durka:stabilize-macro-lifetime, r=petrochenkov
bors [Mon, 14 May 2018 12:24:45 +0000 (12:24 +0000)]
Auto merge of #50385 - durka:stabilize-macro-lifetime, r=petrochenkov

stabilize macro_lifetime_matcher

This stabilizes `:lifetime` which has completed FCP in #34303.

6 years agoAuto merge of #50648 - nox:volatile-store, r=eddyb
bors [Mon, 14 May 2018 10:00:41 +0000 (10:00 +0000)]
Auto merge of #50648 - nox:volatile-store, r=eddyb

Fix volatile_store and nontemporal_store

Fixes #50371.

6 years agorustc: don't trip an assertion for enums with present but uninhabited variants.
Eduard-Mihai Burtescu [Mon, 14 May 2018 09:23:12 +0000 (12:23 +0300)]
rustc: don't trip an assertion for enums with present but uninhabited variants.

6 years agoAuto merge of #50703 - semarie:openbsd-libcompiler_builtins, r=alexcrichton
bors [Mon, 14 May 2018 07:28:48 +0000 (07:28 +0000)]
Auto merge of #50703 - semarie:openbsd-libcompiler_builtins, r=alexcrichton

update libcompiler_builtins

let's OpenBSD to use libcompiler_rt.a from system library. it unbreaks
the build from source on OpenBSD.

see https://github.com/rust-lang-nursery/compiler-builtins/pull/241 for related PR

note this PR brings some other changes (on `floatdisf`/`floatundisf`) with compiler-builtins update.

r? @alexcrichton

6 years agoAuto merge of #50694 - leodasvacas:fix-impl-trait-self-substitution, r=petrochenkov
bors [Mon, 14 May 2018 04:56:56 +0000 (04:56 +0000)]
Auto merge of #50694 - leodasvacas:fix-impl-trait-self-substitution, r=petrochenkov

Fix self referential impl Trait substitutions

A high impact bug because a lot of common traits use a `Self` substitution by default. Should be backported to beta.

There was a check for this which wasn't catching all cases, it was made more robust.

Fixes #49376
Fixes #50626

r? @petrochenkov

6 years agoAuto merge of #50675 - csmoe:var_span, r=oli-obk
bors [Mon, 14 May 2018 02:24:13 +0000 (02:24 +0000)]
Auto merge of #50675 - csmoe:var_span, r=oli-obk

Reduce span highlighted code in unused_variables lint

Fixes #50472
- [X] reduce var span
- [ ] mark applicable

Before:
```
mut unused_mut_var
^^^^^^^^^^^^^^^^^^
```
After:
```
mut unused_mut_var
    ^^^^^^^^^^^^^^
```

6 years agotypeck: Save the index of private fields
Dan Robertson [Sat, 12 May 2018 19:04:44 +0000 (19:04 +0000)]
typeck: Save the index of private fields

Save the index of all fields regardless of their visibility. Problems
could occur later when attempting to index fields in error recovery if
they are not inserted.

6 years agorestore feature for stage0
Alex Burka [Thu, 10 May 2018 02:01:03 +0000 (02:01 +0000)]
restore feature for stage0

6 years agoremove stray ui stderr
Alex Burka [Wed, 2 May 2018 04:38:08 +0000 (04:38 +0000)]
remove stray ui stderr

6 years agostabilize :lifetime
Alex Burka [Wed, 2 May 2018 03:02:05 +0000 (03:02 +0000)]
stabilize :lifetime

6 years agoAuto merge of #49835 - da-x:literal-fragment-pr, r=petrochenkov
bors [Sun, 13 May 2018 17:07:38 +0000 (17:07 +0000)]
Auto merge of #49835 - da-x:literal-fragment-pr, r=petrochenkov

Macros: Add a 'literal' fragment specifier

See: https://github.com/rust-lang/rust/issues/35625

```rust

macro_rules! test_literal {
    ($l:literal) => {
        println!("literal: {}", $l);
    };
    ($e:expr) => {
        println!("expr: {}", $e);
    };
}

fn main() {
    let a = 1;
    test_literal!(a);
    test_literal!(2);
    test_literal!(-3);
}
```

Output:

```
expr: 1
literal: 2
literal: -3
```

ToDo:

* [x] Feature gate
* [x] Basic tests
* [x] Tests for range patterns
* [x] Tests for attributes
* [x] Documentation
* [x] Fix for `true`/`false`
* [x] Fix for negative number literals

6 years agoMacros: Add a 'literal' fragment specifier
Dan Aloni [Mon, 9 Apr 2018 23:08:47 +0000 (02:08 +0300)]
Macros: Add a 'literal' fragment specifier

Implements RFC 1576.

See: https://github.com/rust-lang/rfcs/blob/master/text/1576-macros-literal-matcher.md

Changes are mostly in libsyntax, docs, and tests. Feature gate is
enabled for 1.27.0.

Many thanks to Vadim Petrochenkov for following through code reviews
and suggestions.

Example:

````rust

macro_rules! test_literal {
    ($l:literal) => {
        println!("literal: {}", $l);
    };
    ($e:expr) => {
        println!("expr: {}", $e);
    };
}

fn main() {
    let a = 1;
    test_literal!(a);
    test_literal!(2);
    test_literal!(-3);
}
```

Output:

```
expr: 1
literal: 2
literal: -3
```

6 years agoRevert "mark applicability"
csmoe [Sun, 13 May 2018 14:56:37 +0000 (22:56 +0800)]
Revert "mark applicability"

This reverts commit a8809711285d2375ee98177f9e78090047514fb2.

6 years agomark applicability
csmoe [Sun, 13 May 2018 13:10:15 +0000 (21:10 +0800)]
mark applicability

6 years agoAuto merge of #50704 - kennytm:rollup, r=kennytm
bors [Sun, 13 May 2018 11:32:21 +0000 (11:32 +0000)]
Auto merge of #50704 - kennytm:rollup, r=kennytm

Rollup of 8 pull requests

Successful merges:

 - #50624 (fs::write: Add example writing a &str)
 - #50634 (Do not silently truncate offsets for `read_at`/`write_at` on emscripten)
 - #50644 (AppVeyor: Read back trace from crash dump on failure.)
 - #50661 (Ignore non .rs files for tidy libcoretest)
 - #50663 (rustc: Allow an edition's feature on that edition)
 - #50667 (rustc: Only suggest deleting `extern crate` if it works)
 - #50670 (rustc: Include semicolon when removing `extern crate`)
 - #50678 (Update openbsd targets)

Failed merges:

6 years agoRollup merge of #50678 - semarie:openbsd-targets, r=sanxiyn
kennytm [Sun, 13 May 2018 09:27:07 +0000 (17:27 +0800)]
Rollup merge of #50678 - semarie:openbsd-targets, r=sanxiyn

Update openbsd targets

- add a new target `aarch64-unknown-openbsd`
- update `i686-unknown-openbsd` to use lld with clang, in order to correctly link binaries with `i128`

6 years agoRollup merge of #50670 - alexcrichton:remove-extern-crate-correct-span, r=Manishearth
kennytm [Sun, 13 May 2018 08:15:49 +0000 (16:15 +0800)]
Rollup merge of #50670 - alexcrichton:remove-extern-crate-correct-span, r=Manishearth

rustc: Include semicolon when removing `extern crate`

Currently the lint for removing `extern crate` suggests removing `extern crate`
most of the time, but the rest of the time it suggest replacing it with `use
crate_name`. Unfortunately though when spliced into the original code you're
replacing

    extern crate foo;

with

    use foo

which is syntactically invalid! This commit ensure that the trailing semicolon
is included in rustc's suggestion to ensure that the code continues to compile
afterwards.

6 years agoRollup merge of #50667 - alexcrichton:no-remove-extern-crate-unless-works, r=Manishearth
kennytm [Sun, 13 May 2018 08:15:47 +0000 (16:15 +0800)]
Rollup merge of #50667 - alexcrichton:no-remove-extern-crate-unless-works, r=Manishearth

rustc: Only suggest deleting `extern crate` if it works

This commit updates one of the edition lints to only suggest deleting `extern
crate` if it actually works. Otherwise this can yield some confusing behavior
with rustfix specifically where if you accidentally deny the `rust_2018_idioms`
lint in the 2015 edition it's suggesting features that don't work!

6 years agoRollup merge of #50663 - alexcrichton:no-removed-error, r=Manishearth
kennytm [Sun, 13 May 2018 08:15:46 +0000 (16:15 +0800)]
Rollup merge of #50663 - alexcrichton:no-removed-error, r=Manishearth

rustc: Allow an edition's feature on that edition

This commit fixes a hard error where the `#![feature(rust_2018_preview)]`
feature was forbidden to be mentioned when the `--edition 2018` flag was passed.
This instead silently accepts that feature gate despite it not being necessary.
It's intended that this will help ease the transition into the 2018 edition as
users will, for the time being, start off with the `rust_2018_preview` feature
and no longer immediately need to remove it.

Closes #50662

6 years agoRollup merge of #50661 - varkor:libcoretest-ignore-non-rs, r=alexcrichton
kennytm [Sun, 13 May 2018 08:15:45 +0000 (16:15 +0800)]
Rollup merge of #50661 - varkor:libcoretest-ignore-non-rs, r=alexcrichton

Ignore non .rs files for tidy libcoretest

Previously, any file would be read, which is both unnecessary, and causes issues if irrelevant non-Unicode files were read (e.g. `.DS_STORE`).

6 years agoRollup merge of #50644 - kennytm:read-appveyor-dump, r=alexcrichton
kennytm [Sun, 13 May 2018 08:15:44 +0000 (16:15 +0800)]
Rollup merge of #50644 - kennytm:read-appveyor-dump, r=alexcrichton

AppVeyor: Read back trace from crash dump on failure.

This is an attempt to debug spurious access violations on Windows (#33434, #50604). Thanks to #50276, there should be minidumps to read when rustc segfault.

(The implementation is based on <https://github.com/springmeyer/travis-coredump/blob/master/test.bat>.)

6 years agoAuto merge of #50643 - dlrobertson:fix_ice, r=oli-obk
bors [Sun, 13 May 2018 09:16:11 +0000 (09:16 +0000)]
Auto merge of #50643 - dlrobertson:fix_ice, r=oli-obk

typeck: Fix ICE with struct update syntax

If check_expr_struct_fields fails, do not continue to record update.
If we continue to record update, the struct may cause us to ICE later
on indexing a field that may or may not exist.

Fixes: #50618
6 years agoIntroduce OperandValue::nontemporal_store and use it in the intrinsics
Anthony Ramine [Fri, 11 May 2018 10:26:32 +0000 (12:26 +0200)]
Introduce OperandValue::nontemporal_store and use it in the intrinsics

We use a new MemFlags bitflags type to merge some store code paths.

6 years agoIntroduce OperandValue::volatile_store and use it in the intrinsics
Anthony Ramine [Fri, 11 May 2018 09:26:51 +0000 (11:26 +0200)]
Introduce OperandValue::volatile_store and use it in the intrinsics

Fixes #50371.

6 years agoreduce variable span
csmoe [Fri, 11 May 2018 14:24:04 +0000 (22:24 +0800)]
reduce variable span

6 years agoRollup merge of #50634 - tbu-:pr_preadwrite_emscripten, r=kennytm
kennytm [Sun, 13 May 2018 08:15:42 +0000 (16:15 +0800)]
Rollup merge of #50634 - tbu-:pr_preadwrite_emscripten, r=kennytm

Do not silently truncate offsets for `read_at`/`write_at` on emscripten

Generate an IO error if the offset is out of bounds for the system call.

6 years agoRollup merge of #50624 - adevore:fs-write-str-example, r=steveklabnik
kennytm [Sun, 13 May 2018 08:15:41 +0000 (16:15 +0800)]
Rollup merge of #50624 - adevore:fs-write-str-example, r=steveklabnik

fs::write: Add example writing a &str

This adds an example to the documentation for `fs::write` that demonstrates the use of the `AsRef<[u8]>` implementation for &str. Experienced users should already recognize the possibility from the type signature, but new users may not recognize the significance.

6 years agoAuto merge of #50622 - eddyb:make-room-for-ghosts, r=nikomatsakis
bors [Sun, 13 May 2018 06:04:54 +0000 (06:04 +0000)]
Auto merge of #50622 - eddyb:make-room-for-ghosts, r=nikomatsakis

rustc: leave space for fields of uninhabited types to allow partial initialization.

Fixes #49298 by only collapsing uninhabited enum variants, and only if they only have ZST fields.
Fixes #50442 incidentally (@nox's optimization didn't take into account uninhabited variants).

6 years agoupdate libcompiler_builtins
Sébastien Marie [Sun, 13 May 2018 05:14:36 +0000 (07:14 +0200)]
update libcompiler_builtins

let's OpenBSD to use libcompiler_rt.a from system library. it unbreaks
the build from source on OpenBSD.

6 years agoAuto merge of #50573 - oli-obk:tool_sanity, r=kennytm
bors [Sun, 13 May 2018 03:44:00 +0000 (03:44 +0000)]
Auto merge of #50573 - oli-obk:tool_sanity, r=kennytm

Don't require clippy/miri for beta

r? @kennytm

cc @alexcrichton

I'm trying this out locally atm to see if it works as I think it should. Not sure how to test it for real except wait for the next beta.

fixes #50557

6 years agoAuto merge of #50235 - Zoxc:rayon, r=michaelwoerister
bors [Sun, 13 May 2018 01:18:45 +0000 (01:18 +0000)]
Auto merge of #50235 - Zoxc:rayon, r=michaelwoerister

Add a Rayon thread pool

r? @michaelwoerister

6 years agoUpdate Cargo.lock
John Kåre Alsaker [Sat, 12 May 2018 02:11:03 +0000 (04:11 +0200)]
Update Cargo.lock

6 years agoAdd parallel abstractions
John Kåre Alsaker [Wed, 25 Apr 2018 22:50:33 +0000 (00:50 +0200)]
Add parallel abstractions

6 years agoAdd a Rayon thread pool
John Kåre Alsaker [Wed, 25 Apr 2018 22:49:52 +0000 (00:49 +0200)]
Add a Rayon thread pool

6 years agoAdd Sync bounds to the crate store
John Kåre Alsaker [Sat, 3 Mar 2018 05:19:15 +0000 (06:19 +0100)]
Add Sync bounds to the crate store

6 years agoFix impl PartialOrd for InternedString
John Kåre Alsaker [Sat, 5 May 2018 10:30:14 +0000 (12:30 +0200)]
Fix impl PartialOrd for InternedString

6 years agoAuto merge of #50536 - leodasvacas:report-fullfilment-errors-in-copy-derive, r=estebank
bors [Sat, 12 May 2018 22:48:16 +0000 (22:48 +0000)]
Auto merge of #50536 - leodasvacas:report-fullfilment-errors-in-copy-derive, r=estebank

Better error reporting in Copy derive

In Copy derive, report all fulfillment erros when present and do not report errors for types tainted with `TyErr`. Also report all fields which are not Copy rather than just the first.

Also refactored `fn fully_normalize`, removing the not very useful helper function along with a FIXME to the closed issue #26721 that looks out of context now.

Fixes #50480

r? @estebank

6 years agoUse fullpath instead of recreating it
Guillaume Gomez [Sat, 12 May 2018 21:44:40 +0000 (23:44 +0200)]
Use fullpath instead of recreating it

6 years agoFix self referential impl Trait substitutions
leonardo.yvens [Sat, 12 May 2018 19:43:42 +0000 (16:43 -0300)]
Fix self referential impl Trait substitutions

A high impact bug because a lot of common traits use a `Self`
substitution by default. Should be backported to beta.

There was a check for this which wasn't catching all cases, it was made
more robust.

Fixes #49376
Fixes #50626

r? @petrochenkov

6 years agoAuto merge of #50686 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
bors [Sat, 12 May 2018 18:45:00 +0000 (18:45 +0000)]
Auto merge of #50686 - Mark-Simulacrum:rollup, r=Mark-Simulacrum

Rollup of 13 pull requests

Successful merges:

 - #50544 (Cleanup some dependencies)
 - #50545 (Made some functions in time module const)
 - #50550 (use fmt::Result where applicable)
 - #50558 (Remove all reference to DepGraph::work_products)
 - #50602 (Update canonicalize docs)
 - #50607 (Allocate Symbol strings from an arena)
 - #50613 (Migrate the toolstate update bot to rust-highfive)
 - #50624 (fs::write: Add example writing a &str)
 - #50634 (Do not silently truncate offsets for `read_at`/`write_at` on emscripten)
 - #50644 (AppVeyor: Read back trace from crash dump on failure.)
 - #50661 (Ignore non .rs files for tidy libcoretest)
 - #50663 (rustc: Allow an edition's feature on that edition)
 - #50667 (rustc: Only suggest deleting `extern crate` if it works)

Failed merges:

6 years agoFix rebase
leonardo.yvens [Sat, 12 May 2018 18:07:15 +0000 (15:07 -0300)]
Fix rebase

6 years agoMerge all "Copy not implemented" errors
leonardo.yvens [Wed, 9 May 2018 13:05:59 +0000 (10:05 -0300)]
Merge all "Copy not implemented" errors

6 years agoBetter error reporting in Copy derive
leonardo.yvens [Tue, 8 May 2018 14:38:35 +0000 (11:38 -0300)]
Better error reporting in Copy derive

In Copy derive, report all fulfillment erros when present and do not
report errors for types tainted with `TyErr`. Also report all fields
which are not Copy rather than just the first.

Also refactored `fn fully_normalize`, removing the not very useful
helper function along with a FIXME to the closed issue #26721 that's
looks out of context now.

6 years agoFix invalid deduplication
Guillaume Gomez [Sat, 12 May 2018 12:57:52 +0000 (14:57 +0200)]
Fix invalid deduplication

6 years agoFix items counts in search results
Guillaume Gomez [Sat, 12 May 2018 11:52:25 +0000 (13:52 +0200)]
Fix items counts in search results

6 years agoReduce js files size
Guillaume Gomez [Sat, 5 May 2018 15:06:08 +0000 (17:06 +0200)]
Reduce js files size

6 years agoRemove extra span tags
Guillaume Gomez [Sat, 5 May 2018 14:36:49 +0000 (16:36 +0200)]
Remove extra span tags

6 years agoHandle blur on theme buttons nicely
Guillaume Gomez [Thu, 26 Apr 2018 21:44:25 +0000 (23:44 +0200)]
Handle blur on theme buttons nicely

6 years agoAdd missing description in alias items
Guillaume Gomez [Thu, 26 Apr 2018 20:27:12 +0000 (22:27 +0200)]
Add missing description in alias items

6 years agoImprove alias rendering
Guillaume Gomez [Thu, 26 Apr 2018 19:14:10 +0000 (21:14 +0200)]
Improve alias rendering

6 years agoImprove results
Guillaume Gomez [Wed, 25 Apr 2018 22:36:00 +0000 (00:36 +0200)]
Improve results

6 years agoAuto merge of #50684 - nikic:prepare-thinlto, r=nagisa
bors [Sat, 12 May 2018 16:23:15 +0000 (16:23 +0000)]
Auto merge of #50684 - nikic:prepare-thinlto, r=nagisa

Set PrepareForThinLTO flag when using ThinLTO

The LLVM PassManager has a PrepareForThinLTO flag, which is intended for use when compilation occurs in conjunction with linking by ThinLTO. The flag has two effects:

 * The NameAnonGlobal pass is run after all other passes, which ensures that all globals have a name.
 * In optimized builds, a number of late passes (mainly related to vectorization and unrolling) are disabled, on the rationale that these a) will increase codesize of the intermediate artifacts and b) will be run by ThinLTO again anyway.

This patch enables the use of PrepareForThinLTO if Thin or ThinLocal linking is used.

The background for this change is the CI failure in #49479, which we assume to be caused by the NameAnonGlobal pass not being run. As this changes which passes LLVM runs, this might have performance (or other) impact, so we want to land this separately.

6 years agorustc: Only suggest deleting `extern crate` if it works
Alex Crichton [Fri, 11 May 2018 18:31:08 +0000 (11:31 -0700)]
rustc: Only suggest deleting `extern crate` if it works

This commit updates one of the edition lints to only suggest deleting `extern
crate` if it actually works. Otherwise this can yield some confusing behavior
with rustfix specifically where if you accidentally deny the `rust_2018_idioms`
lint in the 2015 edition it's suggesting features that don't work!

6 years agorustc: Allow an edition's feature on that edition
Alex Crichton [Fri, 11 May 2018 16:14:23 +0000 (09:14 -0700)]
rustc: Allow an edition's feature on that edition

This commit fixes a hard error where the `#![feature(rust_2018_preview)]`
feature was forbidden to be mentioned when the `--edition 2018` flag was passed.
This instead silently accepts that feature gate despite it not being necessary.
It's intended that this will help ease the transition into the 2018 edition as
users will, for the time being, start off with the `rust_2018_preview` feature
and no longer immediately need to remove it.

Closes #50662

6 years agoDisplay the name of the failed file in tidy/libcoretest
varkor [Fri, 11 May 2018 20:36:24 +0000 (21:36 +0100)]
Display the name of the failed file in tidy/libcoretest

6 years agoIgnore non .rs files for tidy libcoretest
varkor [Fri, 11 May 2018 16:04:50 +0000 (17:04 +0100)]
Ignore non .rs files for tidy libcoretest

Previously, any file would be read, which is both unnecessary, and causes issues if irrelevant non-Unicode files were read (e.g. `.DS_STORE`).

6 years agoAppVeyor: Dump crash log on failure.
kennytm [Fri, 11 May 2018 04:30:50 +0000 (12:30 +0800)]
AppVeyor: Dump crash log on failure.

6 years agoDo not silently truncate offsets for `read_at`/`write_at` on emscripten
Tobias Bucher [Sat, 12 May 2018 00:31:38 +0000 (02:31 +0200)]
Do not silently truncate offsets for `read_at`/`write_at` on emscripten

Generate an IO error if the offset is out of bounds for the system call.

6 years agofs::write: Add example writing a &str
Aaron DeVore [Thu, 10 May 2018 18:47:31 +0000 (11:47 -0700)]
fs::write: Add example writing a &str

6 years agoRollup merge of #50607 - Zoxc:symbol-arena, r=michaelwoerister
Mark Simulacrum [Sat, 12 May 2018 13:32:30 +0000 (07:32 -0600)]
Rollup merge of #50607 - Zoxc:symbol-arena, r=michaelwoerister

Allocate Symbol strings from an arena

This is an alternative to https://github.com/rust-lang/rust/pull/50549

cc @nnethercote

r? @michaelwoerister

6 years agoRollup merge of #50602 - Screwtapello:update-canonicalize-docs, r=cramertj
Mark Simulacrum [Sat, 12 May 2018 13:32:29 +0000 (07:32 -0600)]
Rollup merge of #50602 - Screwtapello:update-canonicalize-docs, r=cramertj

Update canonicalize docs

I was recently working with file-paths in Rust, and I felt let down by the `std::fs::canonicalize` docs, so I figured I should submit a PR with some suggestions.

I was looking for a method to turn a relative path into an absolute path. The `canonicalize` docs didn't mention the words "relative" or "absolute", but they did mention resolving symlinks (which is a kind of canonicalisation and does not imply converting to absolute), so I assumed that's all it did. To remedy this, I've added the word "absolute" to the description of both `std::fs::canonicalize` and `std::path::Path::canonicalize`.

After calling `canonicalize` on Windows, I ran into a bunch of other problems I would not have expected from the function's behaviour on Linux. Specifically, if you call `canonicalize` on a path:

  - it's allowed to be much longer than it otherwise would
  - `.join("a/slash/delimited/path")` gives you a broken path that Windows can't use, where the same operation would have worked perfectly without `canonicalize` (if the path were short enough)
  - the resulting path may confuse other Windows programs if you pass it to them on the command-line, or write it to a config file that they read, etc.

...so I tried to summarize those behaviours too.

If I understand correctly, those behaviours are a side-effect of calling `GetFinalPathNameByHandle`, and the documentation says `canonicalize` might not call that function in future, so maybe those side-effects shouldn't be part of the function's documentation. However, I bet there's a lot of applications deliberately calling `canonicalize` just for the path-length-extension alone, so that particular side-effect is de-facto part of the `canonicalize` interface.

6 years agoRollup merge of #50558 - whitfin:issue-50500, r=michaelwoerister
Mark Simulacrum [Sat, 12 May 2018 13:32:28 +0000 (07:32 -0600)]
Rollup merge of #50558 - whitfin:issue-50500, r=michaelwoerister

Remove all reference to DepGraph::work_products

This is an attempt at fixing #50500. It will remove the `work_products` key from `DepGraphData` completely, in favour of just passing the relevant data around. I went in a little blindly; everything appears to work just fine but I'd appreciate any additional advice people.

I didn't want to remove too much of what was already there, so I kept the structure pretty much the same (aside from some naming tweaks) - if anyone has suggestions on how to streamline it a little better, happy to follow up.

r? @michaelwoerister

6 years agoRollup merge of #50550 - llogiq:fmt-result, r=petrochenkov
Mark Simulacrum [Sat, 12 May 2018 13:32:27 +0000 (07:32 -0600)]
Rollup merge of #50550 - llogiq:fmt-result, r=petrochenkov

use fmt::Result where applicable

This is a quite boring PR, but I think the type alias improves readability, so why not use it?

6 years agoRollup merge of #50545 - rizakrko:const_time, r=oli-obk
Mark Simulacrum [Sat, 12 May 2018 13:32:25 +0000 (07:32 -0600)]
Rollup merge of #50545 - rizakrko:const_time, r=oli-obk

Made some functions in time module const

They may be const, or i missed something?

6 years agoRollup merge of #50544 - Eijebong:cleanup_deps, r=alexcrichton
Mark Simulacrum [Sat, 12 May 2018 13:32:24 +0000 (07:32 -0600)]
Rollup merge of #50544 - Eijebong:cleanup_deps, r=alexcrichton

Cleanup some dependencies

6 years agoSet PrepareForThinLTO flag when using ThinLTO
Nikita Popov [Sat, 12 May 2018 12:07:20 +0000 (14:07 +0200)]
Set PrepareForThinLTO flag when using ThinLTO

The LLVM PassManager has a PrepareForThinLTO flag, which is intended
when compilation occurs in conjunction with linking by ThinLTO. The
flag has two effects:

 * The NameAnonGlobal pass is run after all other passes, which
   ensures that all globals have a name.
 * In optimized builds, a number of late passes (mainly related to
   vectorization and unrolling) are disabled, on the rationale that
   these a) will increase codesize of the intermediate artifacts
   and b) will be run by ThinLTO again anyway.

This patch enables the use of PrepareForThinLTO if Thin or ThinLocal
linking is used.

The background for this change is the CI failure in #49479, which
we assume to be caused by the NameAnonGlobal pass not being run.
As this changes which passes LLVM runs, this might have performance
(or other) impact, so we want to land this separately.

6 years agoAuto merge of #50352 - porglezomp:btree-no-empty-alloc, r=Gankro
bors [Sat, 12 May 2018 09:42:11 +0000 (09:42 +0000)]
Auto merge of #50352 - porglezomp:btree-no-empty-alloc, r=Gankro

Don't allocate when creating an empty BTree

Following the discussion in #50266, this adds a static instance of `LeafNode` that empty BTrees point to, and then replaces it on `insert`, `append`, and `entry`. This avoids allocating for empty maps.

Fixes #50266

r? @Gankro

6 years agoadd aarch64-unknown-openbsd support
Sébastien Marie [Sat, 12 May 2018 07:45:35 +0000 (09:45 +0200)]
add aarch64-unknown-openbsd support

6 years agoopenbsd-i686: use lld as linker by default
Sébastien Marie [Sat, 12 May 2018 07:46:07 +0000 (09:46 +0200)]
openbsd-i686: use lld as linker by default

standard binutils on openbsd is too old to do proper job with i128
code.

6 years agoAuto merge of #50476 - zackmdavis:tame_unreachable_pub_suggestion, r=Manishearth
bors [Sat, 12 May 2018 05:42:10 +0000 (05:42 +0000)]
Auto merge of #50476 - zackmdavis:tame_unreachable_pub_suggestion, r=Manishearth

don't make crazy suggestion for unreachable braced pub-use

The Higher Intermediate Representation doesn't have spans for visibility
keywords, so we were assuming that the first whitespace-delimited token
in the item span was the `pub` to be weakened. This doesn't work for
brace-grouped `use`s, which get lowered as if they were several
individual `use` statements, but with spans that only cover the braced
path-segments. Constructing a correct suggestion here presents some
challenges—until someone works those out, we can at least protect the
dignity of our compiler by not offering any suggestion at all for `use` items.

This resolves #50455 (but again, it would be desirable in the future to
make a correct suggestion instead of copping out like this).

r? @Manishearth

6 years agotypeck: Fix ICE with struct update syntax
Dan Robertson [Fri, 11 May 2018 03:56:08 +0000 (03:56 +0000)]
typeck: Fix ICE with struct update syntax

If check_expr_struct_fields fails, do not continue to record update.
If we continue to record update, the struct may cause us to ICE later
on indexing a field that may or may not exist.

6 years agoAuto merge of #50249 - Zoxc:allocation-const, r=oli-obk
bors [Sat, 12 May 2018 01:48:11 +0000 (01:48 +0000)]
Auto merge of #50249 - Zoxc:allocation-const, r=oli-obk

Introduce ConstValue and use it instead of miri's Value for constant values

r? @oli-obk

6 years agoDo not silently truncate offsets for `read_at`/`write_at` on emscripten
Tobias Bucher [Sat, 12 May 2018 00:31:38 +0000 (02:31 +0200)]
Do not silently truncate offsets for `read_at`/`write_at` on emscripten

Generate an IO error if the offset is out of bounds for the system call.

6 years agoAuto merge of #50161 - rizakrko:impl_note, r=estebank
bors [Fri, 11 May 2018 23:06:27 +0000 (23:06 +0000)]
Auto merge of #50161 - rizakrko:impl_note, r=estebank

added missing implementation hint

Fixes [#50151](https://github.com/rust-lang/rust/issues/50151).
Actually, i don't know, should following code
`let x = |ref x: isize| { x += 1; };`
emit
`note: an implementation of std::ops::AddAssign might be missing for &isize`
or
`note: this is a reference to a type that + can be applied to; you need to dereference this variable once for this operation to work`
or both

6 years agoDisplay the name of the failed file in tidy/libcoretest
varkor [Fri, 11 May 2018 20:36:24 +0000 (21:36 +0100)]
Display the name of the failed file in tidy/libcoretest

6 years agorustc: Only suggest deleting `extern crate` if it works
Alex Crichton [Fri, 11 May 2018 18:31:08 +0000 (11:31 -0700)]
rustc: Only suggest deleting `extern crate` if it works

This commit updates one of the edition lints to only suggest deleting `extern
crate` if it actually works. Otherwise this can yield some confusing behavior
with rustfix specifically where if you accidentally deny the `rust_2018_idioms`
lint in the 2015 edition it's suggesting features that don't work!

6 years agoAuto merge of #50105 - mixi:crt-included, r=alexcrichton
bors [Fri, 11 May 2018 19:46:16 +0000 (19:46 +0000)]
Auto merge of #50105 - mixi:crt-included, r=alexcrichton

Use the correct crt*.o files when linking musl targets.

This is supposed to support optionally using the system copy of musl
libc instead of the included one if supported. This currently only
affects the start files, which is enough to allow building rustc on musl
targets.

Most of the changes are analogous to crt-static.

Excluding the start files is something musl based distributions usually patch into their copy of rustc:
  - https://github.com/alpinelinux/aports/blob/eb064c8/community/rust/musl-fix-linux_musl_base.patch
  - https://github.com/voidlinux/void-packages/blob/77400fc/srcpkgs/rust/patches/link-musl-dynamically.patch

For third-party distributions that not yet carry those patches it would be nice if it was supported without the need to patch upstream sources.

## Reasons
### What breaks?
Some start files were missed when originally writing the logic to swap in musl start files (gcc comes with its own start files, which are suppressed by -nostdlib, but not manually included later on). This caused #36710, which also affects rustc with the internal llvm copy or any other system libraries that need crtbegin/crtend.

### How is it fixed?
The system linker already has all the logic to decide which start files to include, so we can just defer to it (except of course if it doesn't target musl).

### Why is it optional?
In #40113 it was first tried to remove the start files, which broke compiling musl-targeting static binaries with a glibc-targeting compiler. This is why it eventually landed without removing the start files. Being an option side-steps the issue.

### Why are the start files still installed?
This has the nice side-effect, that the produced rust-std-* binaries can still be used by on a glibc-targeting system with a rustc built against glibc.

## Does it work?
With the following build script (using [musl-cross-make](https://github.com/richfelker/musl-cross-make)): https://shadowice.org/~mixi/rust-musl/build.sh, I was able to cross-compile a musl-host musl-targeting rustc on a glibc-based system. The resulting binaries are at https://shadowice.org/~mixi/rust-musl/binaries/. This also requires #50103 and #50104 (which are also applied to the branch the build script uses).

6 years agorustc: Include semicolon when removing `extern crate`
Alex Crichton [Fri, 11 May 2018 19:34:56 +0000 (12:34 -0700)]
rustc: Include semicolon when removing `extern crate`

Currently the lint for removing `extern crate` suggests removing `extern crate`
most of the time, but the rest of the time it suggest replacing it with `use
crate_name`. Unfortunately though when spliced into the original code you're
replacing

    extern crate foo;

with

    use foo

which is syntactically invalid! This commit ensure that the trailing semicolon
is included in rustc's suggestion to ensure that the code continues to compile
afterwards.

6 years agorustc: Allow an edition's feature on that edition
Alex Crichton [Fri, 11 May 2018 16:14:23 +0000 (09:14 -0700)]
rustc: Allow an edition's feature on that edition

This commit fixes a hard error where the `#![feature(rust_2018_preview)]`
feature was forbidden to be mentioned when the `--edition 2018` flag was passed.
This instead silently accepts that feature gate despite it not being necessary.
It's intended that this will help ease the transition into the 2018 edition as
users will, for the time being, start off with the `rust_2018_preview` feature
and no longer immediately need to remove it.

Closes #50662

6 years agoIgnore non .rs files for tidy libcoretest
varkor [Fri, 11 May 2018 16:04:50 +0000 (17:04 +0100)]
Ignore non .rs files for tidy libcoretest

Previously, any file would be read, which is both unnecessary, and causes issues if irrelevant non-Unicode files were read (e.g. `.DS_STORE`).

6 years agoAuto merge of #50650 - oli-obk:clippy, r=Manishearth
bors [Fri, 11 May 2018 15:40:35 +0000 (15:40 +0000)]
Auto merge of #50650 - oli-obk:clippy, r=Manishearth

Update the clippy and miri submodules

r? @Manishearth

6 years agoUpdate an old method name in debug logging
Isaac Whitfield [Wed, 9 May 2018 15:32:04 +0000 (08:32 -0700)]
Update an old method name in debug logging

6 years agoUpdate naming in line with PR comments
Isaac Whitfield [Wed, 9 May 2018 15:16:08 +0000 (08:16 -0700)]
Update naming in line with PR comments

6 years agoNeaten a couple of long signatures
Isaac Whitfield [Wed, 9 May 2018 06:10:03 +0000 (23:10 -0700)]
Neaten a couple of long signatures

6 years agoCatch a bad reference in use clauses
Isaac Whitfield [Wed, 9 May 2018 05:26:50 +0000 (22:26 -0700)]
Catch a bad reference in use clauses

6 years agoRemove shared access to DepGraph::work_products
Isaac Whitfield [Wed, 9 May 2018 05:20:09 +0000 (22:20 -0700)]
Remove shared access to DepGraph::work_products

6 years agoAuto merge of #50332 - Zoxc:interner-split, r=michaelwoerister
bors [Fri, 11 May 2018 13:26:13 +0000 (13:26 +0000)]
Auto merge of #50332 - Zoxc:interner-split, r=michaelwoerister

Only lookup types in one interner

6 years agoresolved merge conflict
Roman Stoliar [Fri, 11 May 2018 12:14:23 +0000 (15:14 +0300)]
resolved merge conflict