]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agosubmodules: update clippy from b2601beb to 29bf75cd
Matthias Krüger [Wed, 5 Dec 2018 14:31:30 +0000 (15:31 +0100)]
submodules: update clippy from b2601beb to 29bf75cd

Changes:
````
Fix ty::TyKind usage
Fix TyKind::<kind> usage in codebase
Extract single_match_else UI test
cargo fmt
Adds inequality cases to bool comparison lint
Remove unsafe_vector_initialization lint
Fix wildcard_dependencies false positive
Fix rustfmt format
Disable incremental build for windows
Travis: Add rustc sysroot bin to PATH for windows build
Fix some nursery links
Enforce LF lineendings for everything
Mention triage procedure in contributing.md
Keep testing large_digit_groups as ui test
Keep testing unsafe_vector_initialization as ui test
Downgrade large_digit_groups to pedantic
Downgrade unsafe_vector_initialization to restriction
remove macro_at_most_once_rep feature attribute since it's stable
Add missing word
Update docs in regards to the merged RFC
Document how to run rustfmt in CONTRIBUTING.md
Don't run integration tests in forks
Fix some formatting issues
Run rustfmt on clippy_lints
Run rustfmt on build.rs
Run rustfmt on clippy_dev
Run rustfmt on rustc_tools_util
Run rustfmt on src
Run rustfmt on the tests
Let travis run cargo fmt --all -- --check
Error on line overflow
````

5 years agoAuto merge of #55922 - oli-obk:slice_pat_ice, r=zackmdavis
bors [Wed, 5 Dec 2018 07:16:17 +0000 (07:16 +0000)]
Auto merge of #55922 - oli-obk:slice_pat_ice, r=zackmdavis

Fix ICE in `const` slice patterns

fixes #55911

based on https://github.com/rust-lang/rust/pull/55915

New commits start at eabc1551e0d0953f1951020afb5919ab4c129cf5

5 years agoAuto merge of #56519 - steveklabnik:edition-guide, r=pietroalbini
bors [Wed, 5 Dec 2018 02:24:35 +0000 (02:24 +0000)]
Auto merge of #56519 - steveklabnik:edition-guide, r=pietroalbini

update edition guide

spiritual successor to https://github.com/rust-lang/rust/pull/56457

not to be backported, being in nightly is enough.

i'm testing this locally now but figure travis can test it in parallel

5 years agobuild the edition guide
Steve Klabnik [Tue, 4 Dec 2018 21:47:46 +0000 (16:47 -0500)]
build the edition guide

and update it so that links are correct

5 years agoAuto merge of #56486 - matthewjasper:propagate-all-closure-bounds, r=pnkfelix
bors [Tue, 4 Dec 2018 20:56:11 +0000 (20:56 +0000)]
Auto merge of #56486 - matthewjasper:propagate-all-closure-bounds, r=pnkfelix

Propagate all closure requirements to the caller

Closes #56477

This should be backported to 1.32 if it doesn't make the cut.

r? @pnkfelix
cc @nikomatsakis

5 years agoCall methods on the right tcx
Matthew Jasper [Tue, 4 Dec 2018 19:14:13 +0000 (19:14 +0000)]
Call methods on the right tcx

There are two `TyCtxt`s, one global, one local. Methods must be called
on the right one, as they differ by invariant lifetimes.

5 years agoAuto merge of #56244 - oli-obk:loud_ui_errors, r=nikomatsakis
bors [Tue, 4 Dec 2018 16:26:18 +0000 (16:26 +0000)]
Auto merge of #56244 - oli-obk:loud_ui_errors, r=nikomatsakis

Report failing tests without `//~ ERROR` comments

r? @nikomatsakis

5 years agoAuto merge of #55871 - ljedrz:llvm_back_allocations, r=nagisa
bors [Tue, 4 Dec 2018 11:47:07 +0000 (11:47 +0000)]
Auto merge of #55871 - ljedrz:llvm_back_allocations, r=nagisa

codegen_llvm_back: improve allocations

This commit was split out from https://github.com/rust-lang/rust/pull/54864. Last time it was causing an LLVM OOM, which was most probably caused by not collecting the globals.

- preallocate vectors of known length
- `extend` instead of `append` where the argument is consumable
- turn 2 `push` loops into `extend`s
- create a vector from a function producing one instead of using `extend_from_slice` on it
- consume `modules` when no longer needed
- ~~return an `impl Iterator` from `generate_lto_work`~~
- ~~don't `collect` `globals`, as they are iterated over and consumed right afterwards~~

While I'm hoping it won't cause an OOM anymore, I would still consider this a "high-risk" PR and not roll it up.

5 years agoAuto merge of #56224 - ehuss:update-cargo, r=alexcrichton
bors [Tue, 4 Dec 2018 09:21:21 +0000 (09:21 +0000)]
Auto merge of #56224 - ehuss:update-cargo, r=alexcrichton

Update cargo, rls

26 commits in b3d0b2e545b61d4cd08096911724b7d49d213f73..5e85ba14aaa20f8133863373404cb0af69eeef2c
2018-11-15 19:13:04 +0000 to 2018-12-02 14:37:25 +0000
- ConflictStoreTrie: Faster filtered search (rust-lang/cargo#6366)
- Remove `cmake` as a requirement (rust-lang/cargo#6368)
- progress: display "Downloading 1 crate" instead of "Downloading 1 crates" (rust-lang/cargo#6369)
- Use expect over unwrap, for panic-in-panic aborts (rust-lang/cargo#6364)
- Switch to pretty_env_logger, under --features pretty-env-logger (rust-lang/cargo#6362)
- use allow-dirty option in `cargo package` to skip vcs checks (rust-lang/cargo#6280)
- remove clones made redundant by Intern PackageId (rust-lang/cargo#6352)
- docs: correct profile usage of `cargo test --release` (rust-lang/cargo#6345)
- Improve doc for `cargo install` (rust-lang/cargo#6354)
- Intern PackageId (rust-lang/cargo#6332)
- Clean only release artifacts if --release option is set (rust-lang/cargo#6349)
- remove clones made redundant by Intern SourceId (rust-lang/cargo#6347)
- Intern SourceId (rust-lang/cargo#6342)
- Tweak Layout to allow for non json file targets with internal "." (rust-lang/cargo#6255)
- Correct Target Directory command-line option (rust-lang/cargo#6343)
- Persistent data structures by im-rs (rust-lang/cargo#6336)
- Move command prelude into main library (rust-lang/cargo#6335)
- Distinguish custom build invocations (rust-lang/cargo#6331)
- Allow crate_type=bin examples to run (rust-lang/cargo#6330)
- Make verify-project honour unstable features (rust-lang/cargo#6326)
- Make autodiscovery disable inferred targets (rust-lang/cargo#6329)
- Add `c` alias for `check` (rust-lang/cargo#6218)
- Allow user aliases to override built-in aliases (rust-lang/cargo#6259)
- Fix renaming directory project using build scripts with cross-compiling. (rust-lang/cargo#6328)
- Fix add_plugin_deps-related tests. (rust-lang/cargo#6327)
- Add a glossary. (rust-lang/cargo#6321)

5 years agoUpdate doc-ui tests
Oliver Scherer [Fri, 30 Nov 2018 15:20:07 +0000 (16:20 +0100)]
Update doc-ui tests

5 years agoUpdate ui tests
Oliver Scherer [Fri, 30 Nov 2018 08:41:26 +0000 (09:41 +0100)]
Update ui tests

5 years agoRemove unused stderr file
Oliver Scherer [Tue, 27 Nov 2018 11:13:49 +0000 (12:13 +0100)]
Remove unused stderr file

5 years agoNewlines.... newlines everywhere
Oliver Scherer [Tue, 27 Nov 2018 10:29:29 +0000 (11:29 +0100)]
Newlines.... newlines everywhere

5 years agoAdd a test ensuring that we don't regress this
Oliver Scherer [Tue, 27 Nov 2018 09:56:49 +0000 (10:56 +0100)]
Add a test ensuring that we don't regress this

5 years agoUpdate tests
Oliver Scherer [Tue, 27 Nov 2018 09:56:36 +0000 (10:56 +0100)]
Update tests

5 years agoReport failing tests without `//~ ERROR` comments
Oliver Scherer [Mon, 26 Nov 2018 16:58:26 +0000 (17:58 +0100)]
Report failing tests without `//~ ERROR` comments

5 years agoAuto merge of #55707 - GuillaumeGomez:file-sidebar, r=QuietMisdreavus
bors [Tue, 4 Dec 2018 07:00:19 +0000 (07:00 +0000)]
Auto merge of #55707 - GuillaumeGomez:file-sidebar, r=QuietMisdreavus

Add source file sidebar

This is just a start currently but that gives a good overview of what it'll look like:

<img width="1440" alt="screenshot 2018-11-06 at 01 39 15" src="https://user-images.githubusercontent.com/3050060/48035592-05336180-e165-11e8-82e1-5ead0c345eb9.png">

r? @QuietMisdreavus

5 years agoAuto merge of #55682 - GuillaumeGomez:primitive-sidebar-link-gen, r=QuietMisdreavus
bors [Tue, 4 Dec 2018 03:34:32 +0000 (03:34 +0000)]
Auto merge of #55682 - GuillaumeGomez:primitive-sidebar-link-gen, r=QuietMisdreavus

Fixes primitive sidebar link generation

Fixes #50746.
Fixes #55656.

r? @QuietMisdreavus

5 years agoAuto merge of #56467 - oli-obk:osx_stack_bump, r=nagisa
bors [Tue, 4 Dec 2018 01:03:17 +0000 (01:03 +0000)]
Auto merge of #56467 - oli-obk:osx_stack_bump, r=nagisa

Bump stack size to 32MB

cc https://github.com/rust-lang/rust/issues/55471

A short term solution (really this time! Full fix being grown in https://github.com/rust-lang/rust/pull/55617) for stack overflows due to deeply recursive syntax trees.

r? @nagisa

cc @alexcrichton @eddyb @michaelwoerister @pietroalbini

5 years agoPropagate all closure requirements to the caller
Matthew Jasper [Mon, 3 Dec 2018 23:17:02 +0000 (23:17 +0000)]
Propagate all closure requirements to the caller

5 years agoAuto merge of #55041 - evq:thumbv8m, r=alexcrichton
bors [Mon, 3 Dec 2018 22:38:18 +0000 (22:38 +0000)]
Auto merge of #55041 - evq:thumbv8m, r=alexcrichton

targets: thumbv8m: Add target for baseline ARMv8-M

Tested against a SAM L11 MCU.

5 years agoDon't generate suffix for source-file.js
Guillaume Gomez [Mon, 3 Dec 2018 21:37:34 +0000 (22:37 +0100)]
Don't generate suffix for source-file.js

5 years agoBump stack size to 32MB
Oliver Scherer [Mon, 3 Dec 2018 16:38:04 +0000 (17:38 +0100)]
Bump stack size to 32MB

5 years agoAuto merge of #56451 - kennytm:rollup, r=kennytm
bors [Mon, 3 Dec 2018 15:44:43 +0000 (15:44 +0000)]
Auto merge of #56451 - kennytm:rollup, r=kennytm

Rollup of 13 pull requests

Successful merges:

 - #56141 ([std] Osstr len clarity)
 - #56366 (Stabilize self_in_typedefs feature)
 - #56395 (Stabilize dbg!(...))
 - #56401 (Move VecDeque::resize_with out of the impl<T:Clone> block)
 - #56402 (Improve the unstable book example for #[marker] trait)
 - #56412 (Update tracking issue for `extern_crate_self`)
 - #56416 (Remove unneeded body class selector)
 - #56418 (Fix failing tidy (line endings on Windows))
 - #56419 (Remove some uses of try!)
 - #56432 (Update issue number of `shrink_to` methods to point the tracking issue)
 - #56433 (Add description about `crate` for parse_visibility's comment)
 - #56435 (make the C part of compiler-builtins opt-out)
 - #56438 (Remove not used `DotEq` token)

Failed merges:

r? @ghost

5 years agoUpdate rls
Eric Huss [Mon, 3 Dec 2018 14:04:09 +0000 (06:04 -0800)]
Update rls

5 years agoRun x86_64-gnu-tools job for "update cargo" PRs since cargo can break RLS.
Eric Huss [Mon, 3 Dec 2018 07:09:47 +0000 (23:09 -0800)]
Run x86_64-gnu-tools job for "update cargo" PRs since cargo can break RLS.

5 years agoUpdate cargo
Eric Huss [Mon, 3 Dec 2018 01:33:20 +0000 (17:33 -0800)]
Update cargo

5 years agoAuto merge of #55010 - tromey:Bug-9224-generic-parameters, r=michaelwoerister
bors [Mon, 3 Dec 2018 11:59:11 +0000 (11:59 +0000)]
Auto merge of #55010 - tromey:Bug-9224-generic-parameters, r=michaelwoerister

Add template parameter debuginfo to generic types

This changes debuginfo generation to add template parameters to
generic types.  With this change the DWARF now has
DW_TAG_template_type_param for types, not just for functions, like:

 <2><40d>: Abbrev Number: 6 (DW_TAG_structure_type)
    <40e>   DW_AT_name        : (indirect string, offset: 0x375): Generic<i32>
    <412>   DW_AT_byte_size   : 4
    <413>   DW_AT_alignment   : 4
...
 <3><41f>: Abbrev Number: 8 (DW_TAG_template_type_param)
    <420>   DW_AT_type        : <0x42a>
    <424>   DW_AT_name        : (indirect string, offset: 0xa65e): T

Closes #9224

5 years agoRollup merge of #56438 - yui-knk:remove_not_used_DotEq_token, r=petrochenkov
kennytm [Mon, 3 Dec 2018 10:07:20 +0000 (18:07 +0800)]
Rollup merge of #56438 - yui-knk:remove_not_used_DotEq_token, r=petrochenkov

Remove not used `DotEq` token

Currently libproc_macro does not use `DotEq` token.
https://github.com/rust-lang/rust/pull/49545 changed libproc_macro
to not generate `DotEq` token.

5 years agoRollup merge of #56435 - RalfJung:libstd-without-c, r=alexcrichton
kennytm [Mon, 3 Dec 2018 10:07:19 +0000 (18:07 +0800)]
Rollup merge of #56435 - RalfJung:libstd-without-c, r=alexcrichton

make the C part of compiler-builtins opt-out

I'd like to be able to use Xargo to build a libstd without having a full C toolchain for the target.  This is a start (but the fact that libstd is a dylib is still a problem).

However, compiler_builtin already has somewhat similar logic to not require a C compiler for wasm:

https://github.com/rust-lang-nursery/compiler-builtins/blob/fe74674f6e4be76d47b66f67d529ebf4186f4eb1/build.rs#L36-L41

(WTF GitHub, why doesn't this show an embedded code preview??)

I wonder if there is a way to not have two separate mechanisms? Like, move the above wasm logic to some place that controls the libstd feature, or so? Or is it okay to have these two mechanisms co-exist?

Cc @alexcrichton

5 years agoRollup merge of #56433 - yui-knk:update_comment_of_parse_visibility, r=petrochenkov
kennytm [Mon, 3 Dec 2018 10:07:18 +0000 (18:07 +0800)]
Rollup merge of #56433 - yui-knk:update_comment_of_parse_visibility, r=petrochenkov

Add description about `crate` for parse_visibility's comment

This rule was introduced by https://github.com/rust-lang/rust/pull/45401.

5 years agoRollup merge of #56432 - ordovicia:shrink-to-issue, r=Centril
kennytm [Mon, 3 Dec 2018 10:07:16 +0000 (18:07 +0800)]
Rollup merge of #56432 - ordovicia:shrink-to-issue, r=Centril

Update issue number of `shrink_to` methods to point the tracking issue

Tracking issue: #56431

5 years agoRollup merge of #56419 - mark-i-m:remove-try, r=Centril
kennytm [Mon, 3 Dec 2018 10:07:15 +0000 (18:07 +0800)]
Rollup merge of #56419 - mark-i-m:remove-try, r=Centril

Remove some uses of try!

5 years agoRollup merge of #56418 - petrochenkov:wintidy, r=nagisa
kennytm [Mon, 3 Dec 2018 10:07:14 +0000 (18:07 +0800)]
Rollup merge of #56418 - petrochenkov:wintidy, r=nagisa

Fix failing tidy (line endings on Windows)

Updates to `rustc-guide` and `edition-guide` including https://github.com/rust-lang/rustc-guide/pull/246 and https://github.com/rust-lang-nursery/edition-guide/pull/122.

5 years agoRollup merge of #56416 - GuillaumeGomez:css-body, r=QuietMisdreavus
kennytm [Mon, 3 Dec 2018 10:07:13 +0000 (18:07 +0800)]
Rollup merge of #56416 - GuillaumeGomez:css-body, r=QuietMisdreavus

Remove unneeded body class selector

r? @QuietMisdreavus

5 years agoRollup merge of #56412 - petrochenkov:extself, r=Centril
kennytm [Mon, 3 Dec 2018 10:07:11 +0000 (18:07 +0800)]
Rollup merge of #56412 - petrochenkov:extself, r=Centril

Update tracking issue for `extern_crate_self`

5 years agoRollup merge of #56402 - scottmcm:better-marker-trait-example, r=Centril
kennytm [Mon, 3 Dec 2018 10:07:10 +0000 (18:07 +0800)]
Rollup merge of #56402 - scottmcm:better-marker-trait-example, r=Centril

Improve the unstable book example for #[marker] trait

The previous one didn't actually use the Display&Debug bounds in any way, so I think this one is a bit more meaningful.

5 years agoRollup merge of #56401 - scottmcm:vecdeque-resize-with, r=dtolnay
kennytm [Mon, 3 Dec 2018 10:07:09 +0000 (18:07 +0800)]
Rollup merge of #56401 - scottmcm:vecdeque-resize-with, r=dtolnay

Move VecDeque::resize_with out of the impl<T:Clone> block

I put this in the wrong `impl` block in https://github.com/rust-lang/rust/pull/56016, so fixing.

Tracking issue for the unstable method: https://github.com/rust-lang/rust/issues/41758#issuecomment-443077953

5 years agoRollup merge of #56395 - Centril:stabilize-dbg-macro, r=SimonSapin
kennytm [Mon, 3 Dec 2018 10:07:08 +0000 (18:07 +0800)]
Rollup merge of #56395 - Centril:stabilize-dbg-macro, r=SimonSapin

Stabilize dbg!(...)

Per FCP in https://github.com/rust-lang/rust/issues/54306 (which is ~1 day from completion).

r? @SimonSapin

The PR is fairly isolated so a rollup should probably work.

5 years agoRollup merge of #56366 - alexreg:stabilise-self_in_typedefs, r=Centril
kennytm [Mon, 3 Dec 2018 10:07:07 +0000 (18:07 +0800)]
Rollup merge of #56366 - alexreg:stabilise-self_in_typedefs, r=Centril

Stabilize self_in_typedefs feature

[**Tracking Issue**](https://github.com/rust-lang/rust/issues/49303)

r? @centril

5 years agoRollup merge of #56141 - jnqnfe:osstr_len_clarity, r=nagisa
kennytm [Mon, 3 Dec 2018 10:07:06 +0000 (18:07 +0800)]
Rollup merge of #56141 - jnqnfe:osstr_len_clarity, r=nagisa

[std] Osstr len clarity

5 years agoAuto merge of #56305 - RalfJung:miri, r=oli-obk
bors [Mon, 3 Dec 2018 09:36:10 +0000 (09:36 +0000)]
Auto merge of #56305 - RalfJung:miri, r=oli-obk

update miri

This should make miri green again :)
(Includes https://github.com/solson/miri/pull/553)

r? @oli-obk

5 years agocodegen_llvm_back: improve allocations
ljedrz [Sat, 6 Oct 2018 09:45:11 +0000 (11:45 +0200)]
codegen_llvm_back: improve allocations

5 years agoupdate miri
Ralf Jung [Fri, 30 Nov 2018 07:08:31 +0000 (08:08 +0100)]
update miri

5 years agoupdate miri
Ralf Jung [Wed, 28 Nov 2018 20:22:45 +0000 (21:22 +0100)]
update miri

5 years agoAuto merge of #56394 - cuviper:interrupted-timeout, r=sfackler
bors [Mon, 3 Dec 2018 07:10:15 +0000 (07:10 +0000)]
Auto merge of #56394 - cuviper:interrupted-timeout, r=sfackler

Deal with EINTR in net timeout tests

We've seen sporadic QE failures in the timeout tests on this assertion:

    assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut);

So there's an error, but not either of the expected kinds.  Adding a
format to show the kind revealed `ErrorKind::Interrupted` (`EINTR`).

For the cases that were using `read`, we can just use `read_exact` to
keep trying after interruption.  For those using `recv_from`, we have to
manually loop until we get a non-interrupted result.

5 years agoAuto merge of #56358 - nikic:mergefunc-aliases, r=rkruppe
bors [Mon, 3 Dec 2018 02:27:15 +0000 (02:27 +0000)]
Auto merge of #56358 - nikic:mergefunc-aliases, r=rkruppe

Enable -mergefunc-use-aliases

If the Rust LLVM fork is used, enable the -mergefunc-use-aliases
flag, which will create aliases for merged functions, rather than
inserting a call from one to the other.

A number of codegen tests needed to be adjusted, because functions
that previously fell below the thunk limit are now being merged.
Merging is prevented in various ways now.

I expect that this is going to break something, somewhere, because
it isn't able to deal with aliases properly, but we won't find out
until we try :)

This fixes #52651.

r? @rkruppe

5 years agoAuto merge of #56110 - varkor:inhabitedness-union-enum, r=cramertj
bors [Sun, 2 Dec 2018 22:22:12 +0000 (22:22 +0000)]
Auto merge of #56110 - varkor:inhabitedness-union-enum, r=cramertj

Consider references and unions potentially inhabited during privacy-respecting inhabitedness checks

It isn't settled exactly how references to uninhabited types and unions of uninhabited types should act, but we should be more conservative here, as it's likely it will be permitted to soundly have values of such types.

This will also be more important in light of the changes at https://github.com/rust-lang/rust/pull/54125.

cc @RalfJung

5 years agoAuto merge of #56198 - bjorn3:cg_ssa_refactor, r=eddyb
bors [Sun, 2 Dec 2018 18:02:20 +0000 (18:02 +0000)]
Auto merge of #56198 - bjorn3:cg_ssa_refactor, r=eddyb

Refactor rustc_codegen_ssa

cc #56108 (not all things are done yet)

This removes an unsafe method from cg_ssa.

r? @eddyb
cc @sunfishcode

5 years agoRemove not used `DotEq` token
yui-knk [Sun, 2 Dec 2018 13:15:50 +0000 (22:15 +0900)]
Remove not used `DotEq` token

Currently libproc_macro does not use `DotEq` token.
https://github.com/rust-lang/rust/pull/49545 changed libproc_macro
to not generate `DotEq` token.

5 years agoAuto merge of #56275 - RalfJung:win-mutex, r=SimonSapin
bors [Sun, 2 Dec 2018 13:45:22 +0000 (13:45 +0000)]
Auto merge of #56275 - RalfJung:win-mutex, r=SimonSapin

use MaybeUninit instead of mem::uninitialized for Windows Mutex

I hope this builds, I do not have a Windows machine to test...

5 years agoRun name-anon-globals after all other passes
Nikita Popov [Sun, 2 Dec 2018 13:41:39 +0000 (14:41 +0100)]
Run name-anon-globals after all other passes

name-anon-globals should always be run at the very end of the pass
pipeline, as optimization passes (in particular mergefunc) may
introduce new anonymous globals.

I believe we did not run into this earlier because it requires the
rather specific combination of a) mergefunc merging two weak functions
b) compilation not using thinlto.

5 years agomake the C part of compiler-builtins opt-out
Ralf Jung [Sun, 2 Dec 2018 12:33:00 +0000 (13:33 +0100)]
make the C part of compiler-builtins opt-out

5 years agoexplicitly control compiler_builts/c feature from libstd
Ralf Jung [Sun, 2 Dec 2018 12:27:12 +0000 (13:27 +0100)]
explicitly control compiler_builts/c feature from libstd

5 years agoavoid MaybeUninit::get_mut where it is not needed
Ralf Jung [Sun, 2 Dec 2018 11:34:39 +0000 (12:34 +0100)]
avoid MaybeUninit::get_mut where it is not needed

5 years agolet FIXME refer to tracking issue
Ralf Jung [Sun, 2 Dec 2018 11:29:54 +0000 (12:29 +0100)]
let FIXME refer to tracking issue

5 years agono reason to use mutable references here at all
Ralf Jung [Sun, 2 Dec 2018 11:16:43 +0000 (12:16 +0100)]
no reason to use mutable references here at all

5 years agoAuto merge of #56378 - ljedrz:arena_tweaks, r=nagisa
bors [Sun, 2 Dec 2018 11:14:14 +0000 (11:14 +0000)]
Auto merge of #56378 - ljedrz:arena_tweaks, r=nagisa

arena: speed up TypedArena::clear and improve common patterns

- speed up `TypedArena::clear`: improves its performance by up to **33%** (in case of a single entry)
- simplify `DroplessArena::in_arena`

5 years agoFix "line longer than 100 chars"
yui-knk [Sun, 2 Dec 2018 09:33:12 +0000 (18:33 +0900)]
Fix "line longer than 100 chars"

5 years agoAuto merge of #56406 - nrc:update, r=kennytm
bors [Sun, 2 Dec 2018 08:36:14 +0000 (08:36 +0000)]
Auto merge of #56406 - nrc:update, r=kennytm

Update RLS and Rustfmt

Closes #56261

5 years agoAdd description about `crate` for parse_visibility's comment
yui-knk [Sun, 2 Dec 2018 08:01:44 +0000 (17:01 +0900)]
Add description about `crate` for parse_visibility's comment

This rule was introduced by https://github.com/rust-lang/rust/pull/45401.

5 years agoarena: improve common patterns
ljedrz [Fri, 30 Nov 2018 15:38:30 +0000 (16:38 +0100)]
arena: improve common patterns

5 years agoUpdate issue number of `shrink_to` methods to point the tracking issue
Hidehito Yabuuchi [Sun, 2 Dec 2018 07:07:57 +0000 (16:07 +0900)]
Update issue number of `shrink_to` methods to point the tracking issue

5 years agoAuto merge of #56396 - dlrobertson:fix_va_list_tests, r=nikic
bors [Sun, 2 Dec 2018 00:08:58 +0000 (00:08 +0000)]
Auto merge of #56396 - dlrobertson:fix_va_list_tests, r=nikic

tests: Simplify VaList run-make test

The va_list tests were too complex and were causing some spurious
test failures on Windows.

Example: https://github.com/rust-lang/rust/pull/55011#issuecomment-443211097

5 years agoremove some uses of try!
Mark Mansi [Sat, 1 Dec 2018 21:48:55 +0000 (15:48 -0600)]
remove some uses of try!

5 years agoFix failing tidy (line endings on Windows)
Vadim Petrochenkov [Sat, 1 Dec 2018 21:19:06 +0000 (00:19 +0300)]
Fix failing tidy (line endings on Windows)

5 years agoRemove unneeded body class selector
Guillaume Gomez [Sat, 1 Dec 2018 17:20:43 +0000 (18:20 +0100)]
Remove unneeded body class selector

5 years agoUpdate tracking issue for `extern_crate_self`
Vadim Petrochenkov [Sat, 1 Dec 2018 15:58:43 +0000 (18:58 +0300)]
Update tracking issue for `extern_crate_self`

5 years agoAuto merge of #55275 - petrochenkov:extself, r=eddyb
bors [Sat, 1 Dec 2018 12:45:52 +0000 (12:45 +0000)]
Auto merge of #55275 - petrochenkov:extself, r=eddyb

experiment: Support aliasing local crate root in extern prelude

This PR provides some minimally invasive solution for the 2018 edition migration issue described in https://github.com/rust-lang/rust/issues/54647 and affecting proc macro crates.

`extern crate NAME as RENAME;` now accepts `NAME`=`self` and interprets it as referring to the local crate.
As with other `extern crate` items, `RENAME` in this case gets into extern prelude in accordance with https://github.com/rust-lang/rust/pull/54658, thus resolving https://github.com/rust-lang/rust/issues/54647.
```rust
extern crate self as serde; // Adds local crate to extern prelude as `serde`
```
This solution doesn't introduce any new syntax and has minimal maintenance cost, so it can be easily deprecated if something better is found in the future.

Closes https://github.com/rust-lang/rust/issues/54647

5 years agoresolve: Support aliasing local crate root in extern prelude
Vadim Petrochenkov [Thu, 25 Oct 2018 22:39:47 +0000 (01:39 +0300)]
resolve: Support aliasing local crate root in extern prelude

5 years agoUpdate RLS and Rustfmt
Nick Cameron [Sat, 1 Dec 2018 10:36:32 +0000 (23:36 +1300)]
Update RLS and Rustfmt

Closes #56261

5 years agoImprove the unstable book example for `#[marker]`
Scott McMurray [Sat, 1 Dec 2018 10:07:50 +0000 (02:07 -0800)]
Improve the unstable book example for `#[marker]`

The previous one didn't actually use the Display&Debug bounds in any way, so I think this one is a bit more meaningful.

5 years agoMove VecDeque::resize_with out of the impl<T:Clone> block
Scott McMurray [Sat, 1 Dec 2018 07:38:05 +0000 (23:38 -0800)]
Move VecDeque::resize_with out of the impl<T:Clone> block

5 years agoAuto merge of #56165 - RalfJung:drop-glue-type, r=eddyb,nikomatsakis
bors [Sat, 1 Dec 2018 07:06:17 +0000 (07:06 +0000)]
Auto merge of #56165 - RalfJung:drop-glue-type, r=eddyb,nikomatsakis

drop glue takes in mutable references, it should reflect that in its type

When drop glue begins, it should retag, like all functions taking references do. But to do that, it needs to take the reference at a proper type: `&mut T`, not `*mut T`.

Failing to retag can mean that the memory the reference points to remains frozen, and `EscapeToRaw` on a frozen location is a NOP, meaning later mutations cause a Stacked Borrows violation.

Cc @nikomatsakis @Gankro because Stacked Borrows
Cc @eddyb for the changes to miri argument passing (the intention is to allow passing `*mut [u8]` when `&mut [u8]` is expected and vice versa)

5 years agoAuto merge of #56391 - alexcrichton:less-compare-mode, r=Mark-Simulacrum
bors [Sat, 1 Dec 2018 03:04:12 +0000 (03:04 +0000)]
Auto merge of #56391 - alexcrichton:less-compare-mode, r=Mark-Simulacrum

ci: Only run compare-mode tests on one builder

The run-pass test suite currently takes 30 minutes on Windows, and
that appears to be roughly split between two 15 minute runs of the test
suite: one without NLL and one with NLL. In discussion on Discord the
platform coverage of the NLL compare mode may not necessarily be worth
it, so this commit removes the NLL compare mode from tests by default,
and then reenables it on only one builder.

5 years agostabilize std::dbg!(...)
Mazdak Farrokhzad [Sat, 1 Dec 2018 01:54:09 +0000 (02:54 +0100)]
stabilize std::dbg!(...)

5 years agoDeal with EINTR in net timeout tests
Josh Stone [Fri, 30 Nov 2018 23:33:40 +0000 (15:33 -0800)]
Deal with EINTR in net timeout tests

We've seen sporadic QE failures in the timeout tests on this assertion:

    assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut);

So there's an error, but not either of the expected kinds.  Adding a
format to show the kind revealed `ErrorKind::Interrupted` (`EINTR`).

For the cases that were using `read`, we can just use `read_exact` to
keep trying after interruption.  For those using `recv_from`, we have to
manually loop until we get a non-interrupted result.

5 years agoci: Only run compare-mode tests on one builder
Alex Crichton [Fri, 30 Nov 2018 22:31:04 +0000 (14:31 -0800)]
ci: Only run compare-mode tests on one builder

The run-pass test suite currently takes 30 minutes on Windows, and
that appears to be roughly split between two 15 minute runs of the test
suite: one without NLL and one with NLL. In discussion on Discord the
platform coverage of the NLL compare mode may not necessarily be worth
it, so this commit removes the NLL compare mode from tests by default,
and then reenables it on only one builder.

5 years agoUpdated ui tests.
Alexander Regueiro [Fri, 30 Nov 2018 15:41:32 +0000 (15:41 +0000)]
Updated ui tests.

5 years agoRemoved chapter from Unstable Book.
Alexander Regueiro [Fri, 30 Nov 2018 04:14:51 +0000 (04:14 +0000)]
Removed chapter from Unstable Book.

5 years agoRemoved feature gate.
Alexander Regueiro [Fri, 30 Nov 2018 03:55:26 +0000 (03:55 +0000)]
Removed feature gate.

5 years agotests: Simplify VaList run-make test
Dan Robertson [Fri, 30 Nov 2018 17:37:23 +0000 (17:37 +0000)]
tests: Simplify VaList run-make test

The va_list tests were too complex and were causing some spurious
test failures on Windows

5 years agoAuto merge of #56381 - kennytm:rollup, r=kennytm
bors [Fri, 30 Nov 2018 19:24:17 +0000 (19:24 +0000)]
Auto merge of #56381 - kennytm:rollup, r=kennytm

Rollup of 19 pull requests

Successful merges:

 - #55011 (Add libstd Cargo feature "panic_immediate_abort")
 - #55821 (Use sort_by_cached_key when the key function is not trivial/free)
 - #56014 (add test for issue #21335)
 - #56131 (Assorted tweaks)
 - #56214 (Implement chalk unification routines)
 - #56216 (Add TryFrom<&[T]> for [T; $N] where T: Copy)
 - #56268 (Reuse the `P` in `InvocationCollector::fold_{,opt_}expr`.)
 - #56324 (Use raw_entry for more efficient interning)
 - #56336 (Clean up and streamline the pretty-printer)
 - #56337 (Fix const_fn ICE with non-const function pointer)
 - #56339 (Remove not used option)
 - #56341 (Rename conversion util; remove duplicate util in librustc_codegen_llvm.)
 - #56349 (rustc 1.30.0's linker flavor inference is a non-backwards compat change to -Clinker)
 - #56355 (Add inline attributes and add unit to CommonTypes)
 - #56360 (Optimize local linkchecker program)
 - #56364 (Fix panic with outlives in existential type)
 - #56365 (Stabilize self_struct_ctor feature.)
 - #56367 (Moved some feature gate tests to correct location)
 - #56373 (Update books)

5 years agoRollup merge of #56214 - scalexm:unification, r=nikomatsakis
kennytm [Fri, 30 Nov 2018 18:31:12 +0000 (02:31 +0800)]
Rollup merge of #56214 - scalexm:unification, r=nikomatsakis

Implement chalk unification routines

`ResolventOps` and `AggregateOps` are mostly straightforwardly translated from chalk. I had caught a few bugs already in my `chalk` branch and backported fixes to this branch, but there may be other ones left. EDIT: I hope there are none left now :)

Fixes #54935.

5 years agoRollup merge of #56337 - phansch:fix_const_ice, r=oli-obk
kennytm [Fri, 30 Nov 2018 18:30:30 +0000 (02:30 +0800)]
Rollup merge of #56337 - phansch:fix_const_ice, r=oli-obk

Fix const_fn ICE with non-const function pointer

Fixes #56164

5 years agoRollup merge of #56324 - Zoxc:int-ext, r=nikomatsakis
kennytm [Fri, 30 Nov 2018 18:29:45 +0000 (02:29 +0800)]
Rollup merge of #56324 - Zoxc:int-ext, r=nikomatsakis

Use raw_entry for more efficient interning

Fixes https://github.com/rust-lang/rust/issues/56308#issuecomment-442492744

5 years agoRollup merge of #55011 - vi:panic_immediate_abort, r=alexcrichton
kennytm [Fri, 30 Nov 2018 18:25:46 +0000 (02:25 +0800)]
Rollup merge of #55011 - vi:panic_immediate_abort, r=alexcrichton

Add libstd Cargo feature "panic_immediate_abort"

It stop asserts and panics from libstd to automatically
include string output and formatting code.

Use case: developing static executables smaller than 50 kilobytes,
where usual formatting code is excessive while keeping debuggability
in debug mode.

May resolve #54981.

5 years agoRollup merge of #56365 - alexreg:stabilise-self_struct_ctor, r=Centril
kennytm [Fri, 30 Nov 2018 17:57:34 +0000 (01:57 +0800)]
Rollup merge of #56365 - alexreg:stabilise-self_struct_ctor, r=Centril

Stabilize self_struct_ctor feature.

[**Tracking Issue**](https://github.com/rust-lang/rust/issues/51994)

5 years agoRollup merge of #56373 - steveklabnik:update-books, r=Mark-Simulacrum
kennytm [Fri, 30 Nov 2018 17:06:10 +0000 (01:06 +0800)]
Rollup merge of #56373 - steveklabnik:update-books, r=Mark-Simulacrum

Update books

This pulls in @Gankro 's final nomicon changes, and adds the edition guide as a submodule.

This is the final doc backport to beta for 1.31, as well.

5 years agoRollup merge of #56367 - alexreg:move-feature-gate-tests-1, r=Centril
kennytm [Fri, 30 Nov 2018 17:06:09 +0000 (01:06 +0800)]
Rollup merge of #56367 - alexreg:move-feature-gate-tests-1, r=Centril

Moved some feature gate tests to correct location

I evidently need to create some sort of GitHub monitor tool that yells at people when they do this in their PRs. ;-)

r? @centril

5 years agoRollup merge of #56364 - dlrobertson:fix_55903, r=oli-obk
kennytm [Fri, 30 Nov 2018 17:06:08 +0000 (01:06 +0800)]
Rollup merge of #56364 - dlrobertson:fix_55903, r=oli-obk

Fix panic with outlives in existential type

Don't panic in determining the privacy of a type if a lifetime outlives
generic exists in an existential type.

r? @oli-obk

Fixes: #55903
5 years agoRollup merge of #56360 - alexcrichton:linkchecker-omg, r=pietroalbini
kennytm [Fri, 30 Nov 2018 17:06:06 +0000 (01:06 +0800)]
Rollup merge of #56360 - alexcrichton:linkchecker-omg, r=pietroalbini

Optimize local linkchecker program

I noticed on a [recent build][1] that the linkchecker stage of CI took a
whopping 15 minutes of CI time for something that should be near
instantaneous. Some local profiling showed some very hot functions and
clones which were pretty easy to remove, and now instead of running in
minutes locally it runs in seconds.

[1]: https://ci.appveyor.com/project/rust-lang/rust/build/job/kptifw1kb1nm4xuu

5 years agoRollup merge of #56355 - Zoxc:inline-things, r=michaelwoerister
kennytm [Fri, 30 Nov 2018 17:06:05 +0000 (01:06 +0800)]
Rollup merge of #56355 - Zoxc:inline-things, r=michaelwoerister

Add inline attributes and add unit to CommonTypes

5 years agoRollup merge of #56349 - davidtwco:issue-55396-inference-extension, r=nagisa
kennytm [Fri, 30 Nov 2018 17:06:02 +0000 (01:06 +0800)]
Rollup merge of #56349 - davidtwco:issue-55396-inference-extension, r=nagisa

rustc 1.30.0's linker flavor inference is a non-backwards compat change to -Clinker

Part of #55396.

This commit modifies linker flavor inference to only remove the extension
to the linker when performing inference if that extension is a 'exe'.

r? @nagisa
cc @alexcrichton @japaric

5 years agoRollup merge of #56341 - frewsxcv:frewsxcv-util-cstr, r=Mark-Simulacrum
kennytm [Fri, 30 Nov 2018 17:06:01 +0000 (01:06 +0800)]
Rollup merge of #56341 - frewsxcv:frewsxcv-util-cstr, r=Mark-Simulacrum

Rename conversion util; remove duplicate util in librustc_codegen_llvm.

5 years agoRollup merge of #56339 - yui-knk:remove_mir_stats_flag, r=alexcrichton
kennytm [Fri, 30 Nov 2018 17:06:00 +0000 (01:06 +0800)]
Rollup merge of #56339 - yui-knk:remove_mir_stats_flag, r=alexcrichton

Remove not used option

`mir_stats` has not been used since 2b32cb90c72d90c722d56324ca0ea9f748ebf4e1.

5 years agoRollup merge of #56336 - nnethercote:clean-up-pp, r=nikomatsakis
kennytm [Fri, 30 Nov 2018 17:05:59 +0000 (01:05 +0800)]
Rollup merge of #56336 - nnethercote:clean-up-pp, r=nikomatsakis

Clean up and streamline the pretty-printer

Some minor improvements.

5 years agoRollup merge of #56268 - nnethercote:fold_opt_expr-recycle, r=petrochenkov
kennytm [Fri, 30 Nov 2018 17:05:56 +0000 (01:05 +0800)]
Rollup merge of #56268 - nnethercote:fold_opt_expr-recycle, r=petrochenkov

Reuse the `P` in `InvocationCollector::fold_{,opt_}expr`.

This requires adding a new method, `P::filter_map`.

This commit reduces instruction counts for various benchmarks by up to
0.7%.

5 years agoRollup merge of #56216 - SimonSapin:array-tryfrom-slice, r=withoutboats
kennytm [Fri, 30 Nov 2018 17:05:54 +0000 (01:05 +0800)]
Rollup merge of #56216 - SimonSapin:array-tryfrom-slice, r=withoutboats

Add TryFrom<&[T]> for [T; $N] where T: Copy

`TryFrom<&[T]> for &[T; $N]` (note *reference* to an array) already exists, but not needing to dereference makes type inference easier for example when using `u32::from_be_bytes`.

Also add doc examples doing just that.

5 years agoRollup merge of #56131 - ljedrz:assorted, r=RalfJung
kennytm [Fri, 30 Nov 2018 17:05:51 +0000 (01:05 +0800)]
Rollup merge of #56131 - ljedrz:assorted, r=RalfJung

Assorted tweaks

- preallocate `VecDeque` in `Decodable::decode` (as it is done with other collections which can do it)
- add a FIXME to `String::from_utf16`

r? @RalfJung