]> git.lizzy.rs Git - rust.git/log
rust.git
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 #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

5 years agoRollup merge of #56014 - euclio:issue-21335, r=nagisa
kennytm [Fri, 30 Nov 2018 17:05:50 +0000 (01:05 +0800)]
Rollup merge of #56014 - euclio:issue-21335, r=nagisa

add test for issue #21335

Running this test with LLVM assertions enabled doesn't seem to trigger an assertion on my Mac.

Fixes #21335.

5 years agoRollup merge of #55821 - ljedrz:cached_key_sorts, r=michaelwoerister
kennytm [Fri, 30 Nov 2018 17:05:48 +0000 (01:05 +0800)]
Rollup merge of #55821 - ljedrz:cached_key_sorts, r=michaelwoerister

Use sort_by_cached_key when the key function is not trivial/free

I'm not 100% sure about `def_path_hash` (everything it does is inlined) but it seems like a good idea at least for the rest, as they are cloning.

5 years agoMoved feature-gate tests to correct dir.
Alexander Regueiro [Fri, 30 Nov 2018 15:48:01 +0000 (15:48 +0000)]
Moved feature-gate tests to correct dir.

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

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

5 years agoarena: speed up TypedArena::clear
ljedrz [Fri, 30 Nov 2018 15:36:20 +0000 (16:36 +0100)]
arena: speed up TypedArena::clear

5 years agoAdd the edition guide to doc.rust-lang.org
Steve Klabnik [Fri, 30 Nov 2018 14:36:49 +0000 (09:36 -0500)]
Add the edition guide to doc.rust-lang.org

5 years agoupdate nomicon
Steve Klabnik [Fri, 30 Nov 2018 14:29:36 +0000 (09:29 -0500)]
update nomicon

5 years agoPacify tidy
Philipp Hansch [Fri, 30 Nov 2018 07:45:15 +0000 (08:45 +0100)]
Pacify tidy

5 years agoFix const_fn ICE with non-const function pointer
Philipp Hansch [Fri, 30 Nov 2018 07:43:50 +0000 (08:43 +0100)]
Fix const_fn ICE with non-const function pointer

5 years agoInline things
John Kåre Alsaker [Thu, 29 Nov 2018 13:33:36 +0000 (14:33 +0100)]
Inline things

5 years agoAuto merge of #49219 - eddyb:proc-macro-decouple, r=alexcrichton
bors [Fri, 30 Nov 2018 06:44:14 +0000 (06:44 +0000)]
Auto merge of #49219 - eddyb:proc-macro-decouple, r=alexcrichton

Decouple proc_macro from the rest of the compiler.

This PR removes all dependencies of `proc_macro` on compiler crates and allows multiple copies of `proc_macro`, built even by different compilers (but from the same source), to interoperate.

Practically, it allows:
* running proc macro tests at stage1 (I moved most from `-fulldeps` to the regular suites)
* using proc macros in the compiler itself (may require some rustbuild trickery)

On the server (i.e. compiler front-end) side:
* `server::*` traits are implemented to provide the concrete types and methods
  * the concrete types are completely separated from the `proc_macro` public API
  * the only use of the type implementing `Server` is to be passed to `Client::run`

On the client (i.e. proc macro) side (potentially using a different `proc_macro` instance!):
* `client::Client` wraps around client-side (expansion) function pointers
  * it encapsulates the `proc_macro` instance used by the client
  * its `run` method can be called by a server, to execute the client-side function
    * the client instance is bridged to the provided server, while it runs
    * ~~currently a thread is spawned, could use process isolation in the future~~
(not the case anymore, see #56058)
* proc macro crates get a generated `static` holding a `&[ProcMacro]`
  * this describes all derives/attr/bang proc macros, replacing the "registrar" function
  * each variant of `ProcMacro` contains an appropriately typed `Client<fn(...) -> ...>`

`proc_macro` public APIs call into the server via an internal "bridge":
* only a currently running proc macro `Client` can interact with those APIs
  * server code might not be able to (if it uses a different `proc_macro` instance)
    * however, it can always create and `run` its own `Client`, but that may be inefficient
* the `bridge` uses serialization, C ABI and integer handles to avoid Rust ABI instability
* each invocation of a proc macro results in disjoint integers in its `proc_macro` handles
  * this prevents using values of those types across invocations (if they even can be kept)

r? @alexcrichton cc @jseyfried @nikomatsakis @Zoxc @thepowersgang

5 years agobootstrap: provide host `rust_test_helpers` to compiletest, not just target.
Eduard-Mihai Burtescu [Tue, 27 Nov 2018 13:40:40 +0000 (15:40 +0200)]
bootstrap: provide host `rust_test_helpers` to compiletest, not just target.

5 years agotests: ignore wasm32 for run-pass/proc-macro/expand-with-a-macro.
Eduard-Mihai Burtescu [Tue, 27 Nov 2018 02:42:20 +0000 (04:42 +0200)]
tests: ignore wasm32 for run-pass/proc-macro/expand-with-a-macro.

5 years agotests: use alloc instead of libc in unnecessary-extern-crate, to make it work on...
Eduard-Mihai Burtescu [Mon, 26 Nov 2018 14:28:42 +0000 (16:28 +0200)]
tests: use alloc instead of libc in unnecessary-extern-crate, to make it work on wasm.

5 years agocompiletest: don't pass -Clinker when `// force-host` was requested.
Eduard-Mihai Burtescu [Mon, 26 Nov 2018 11:04:26 +0000 (13:04 +0200)]
compiletest: don't pass -Clinker when `// force-host` was requested.

5 years agotests: use a #![no_std] target crate in run-make/rustc-macro-dep-files.
Eduard-Mihai Burtescu [Mon, 26 Nov 2018 02:07:55 +0000 (04:07 +0200)]
tests: use a #![no_std] target crate in run-make/rustc-macro-dep-files.

5 years agobootstrap: don't use libraries from MUSL_ROOT on non-musl targets.
Eduard-Mihai Burtescu [Sun, 25 Nov 2018 12:08:06 +0000 (14:08 +0200)]
bootstrap: don't use libraries from MUSL_ROOT on non-musl targets.

5 years agotests: support cross-compilation in run-make/rustc-macro-dep-files.
Eduard-Mihai Burtescu [Sun, 25 Nov 2018 02:43:00 +0000 (04:43 +0200)]
tests: support cross-compilation in run-make/rustc-macro-dep-files.

5 years agobootstrap: ensure that `libproc_macro` is available on the host for tests even when...
Eduard-Mihai Burtescu [Wed, 16 May 2018 12:38:32 +0000 (15:38 +0300)]
bootstrap: ensure that `libproc_macro` is available on the host for tests even when cross-compiling.

5 years agotests: use `force-host` and `no-prefer-dynamic` in all proc_macro tests.
Eduard-Mihai Burtescu [Sat, 24 Nov 2018 13:34:13 +0000 (15:34 +0200)]
tests: use `force-host` and `no-prefer-dynamic` in all proc_macro tests.

5 years agotests: move all proc_macro tests from -fulldeps.
Eduard-Mihai Burtescu [Tue, 20 Mar 2018 20:19:52 +0000 (22:19 +0200)]
tests: move all proc_macro tests from -fulldeps.

5 years agotests: remove ignore-stage1 where possible in proc_macro tests.
Eduard-Mihai Burtescu [Tue, 20 Mar 2018 18:20:03 +0000 (20:20 +0200)]
tests: remove ignore-stage1 where possible in proc_macro tests.

5 years agoStatically link proc_macro into proc macros.
Eduard-Mihai Burtescu [Thu, 26 Apr 2018 11:11:08 +0000 (14:11 +0300)]
Statically link proc_macro into proc macros.

5 years agoproc_macro: move to a dependency of libtest.
Eduard-Mihai Burtescu [Tue, 20 Mar 2018 18:43:33 +0000 (20:43 +0200)]
proc_macro: move to a dependency of libtest.

5 years agoproc_macro: move the rustc server to syntax_ext.
Eduard-Mihai Burtescu [Tue, 20 Mar 2018 14:41:14 +0000 (16:41 +0200)]
proc_macro: move the rustc server to syntax_ext.

5 years agoproc_macro: remove the __internal module.
Eduard-Mihai Burtescu [Mon, 19 Mar 2018 20:44:24 +0000 (22:44 +0200)]
proc_macro: remove the __internal module.

5 years agoproc_macro: introduce a "bridge" between clients (proc macros) and servers (compiler...
Eduard-Mihai Burtescu [Thu, 15 Mar 2018 23:09:22 +0000 (01:09 +0200)]
proc_macro: introduce a "bridge" between clients (proc macros) and servers (compiler front-ends).

5 years agoChanged test for issue 56202 to compile-pass.
Alexander Regueiro [Fri, 30 Nov 2018 02:55:22 +0000 (02:55 +0000)]
Changed test for issue 56202 to compile-pass.

5 years agoUse opt_def_id instead of having special branch
Esteban Küber [Sun, 25 Nov 2018 15:40:26 +0000 (07:40 -0800)]
Use opt_def_id instead of having special branch

5 years agoFix ICE with feature self_struct_ctor
Esteban Küber [Sun, 25 Nov 2018 01:12:28 +0000 (17:12 -0800)]
Fix ICE with feature self_struct_ctor

5 years agoFix panic with outlives in existential type
Dan Robertson [Fri, 30 Nov 2018 02:04:10 +0000 (02:04 +0000)]
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.