]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoAuto merge of #52351 - mbrubeck:docs, r=apasel422
bors [Sun, 15 Jul 2018 13:12:39 +0000 (13:12 +0000)]
Auto merge of #52351 - mbrubeck:docs, r=apasel422

Fix link to RFC 1510

None

6 years agoAuto merge of #52381 - oli-obk:ty_to_def_id, r=eddyb
bors [Sun, 15 Jul 2018 10:29:00 +0000 (10:29 +0000)]
Auto merge of #52381 - oli-obk:ty_to_def_id, r=eddyb

Remove `ty_to_def_id`

fixes https://github.com/rust-lang/rust/issues/52341

The uses were mostly convenience and generally "too powerful" (would also have worked for types that weren't interesting at the use site)

r? @eddyb

6 years agoAuto merge of #52361 - QuietMisdreavus:proc-macro-doc, r=ollie27
bors [Sun, 15 Jul 2018 08:30:36 +0000 (08:30 +0000)]
Auto merge of #52361 - QuietMisdreavus:proc-macro-doc, r=ollie27

rustdoc: don't panic when the cross-re-export handler sees a proc-macro

When i moved the macro cross-re-export inlining code into `clean::inline`, i thought that if a macro had a `Def` that said it was a bang macro, it wouldn't be a proc macro. I thought wrong. Turns out, the `quote!()` in `libproc_macro` is actually a proc-macro, and when the `quote!()` macro is re-exported, this proc-macro is accessed in its place. This causes any `proc_macro::*` glob re-export to pull in this proc-macro, causing the assertion i added to fire, leading to an ICE. This replaces that with an Option that ignores proc-macros for the time being.

Fixes https://github.com/rust-lang/rust/issues/52129

6 years agoAuto merge of #52360 - Mark-Simulacrum:fix-keep-stage-for-cg-backends, r=alexcrichton
bors [Sun, 15 Jul 2018 06:31:24 +0000 (06:31 +0000)]
Auto merge of #52360 - Mark-Simulacrum:fix-keep-stage-for-cg-backends, r=alexcrichton

Do not attempt to recompile codegen backend(s) with --keep-stage

Previously we'd attempt to recompile them and that would fail since
we've essentially not built the entire compiler yet, or we're faking
that fact. This commit should make us ignore the codegen backend build
as well.

Unlike the other compile steps, there is no CodegenBackendLink step that
we run here, because that is done later as a part of assembling the
final compiler and as an explicit function call.

r? @alexcrichton

I think this may fix or at least assist with #52174.

cc @RalfJung @tinco -- if you can test this patch locally that'd be
amazing; I don't want to recompile for the next couple hours to test it
locally. I don't think it can make the situation worse, and in fact, if
I've interpreted the cause of the failure correctly then this will fix
your problem.

6 years agoAuto merge of #52348 - oli-obk:bugfix, r=petrochenkov
bors [Sun, 15 Jul 2018 04:01:43 +0000 (04:01 +0000)]
Auto merge of #52348 - oli-obk:bugfix, r=petrochenkov

Reach the body of functions returning `impl Trait` but don't treat it as public

fixes #52128

r? @pnkfelix

cc @eddyb

6 years agoAuto merge of #52388 - oli-obk:clippy, r=Manishearth
bors [Sun, 15 Jul 2018 00:29:43 +0000 (00:29 +0000)]
Auto merge of #52388 - oli-obk:clippy, r=Manishearth

Update clippy and rls

r? @Manishearth

cc @kennytm @nrc

6 years agoUpdate clippy and rls
Oliver Schneider [Sat, 14 Jul 2018 22:01:24 +0000 (00:01 +0200)]
Update clippy and rls

6 years agoUbsan this newly discovered dead code
Oliver Schneider [Sat, 14 Jul 2018 23:52:45 +0000 (01:52 +0200)]
Ubsan this newly discovered dead code

6 years agoAuto merge of #52318 - TheDarkula:master, r=oli-obk
bors [Sat, 14 Jul 2018 22:28:31 +0000 (22:28 +0000)]
Auto merge of #52318 - TheDarkula:master, r=oli-obk

Removed the promotable field from CheckCrateVisitor...

and replaced it with the custom enum Promotability.

r? @oli-obk

6 years agoRemoved the promotable field from CheckCrateVisitor and replaced it with the structs...
Meade Kincke [Sat, 7 Jul 2018 14:39:21 +0000 (15:39 +0100)]
Removed the promotable field from CheckCrateVisitor and replaced it with the structs Promotable and NotPromotable.

6 years agoAuto merge of #52326 - alexcrichton:tweak-proc-macro-expand, r=petrochenkov
bors [Sat, 14 Jul 2018 20:27:56 +0000 (20:27 +0000)]
Auto merge of #52326 - alexcrichton:tweak-proc-macro-expand, r=petrochenkov

rustc: Tweak expansion of #[proc_macro] for 2018

The syntactical expansion of `#[proc_macro]` and related attributes currently
contains absolute paths which conflicts with a lint for the 2018 edition,
causing issues like #52214. This commit puts a band-aid on the issue by ensuring
that procedural macros can also migrate to the 2018 edition for now by tweaking
the expansion based on what features are activated. A more long-term solution
would probably tweak the edition hygiene of spans, but this should do the trick
for now.

Closes #52214

6 years agoExpose a self-referential object
Oliver Schneider [Sat, 14 Jul 2018 18:34:32 +0000 (20:34 +0200)]
Expose a self-referential object

6 years agoAuto merge of #52379 - kennytm:revert-o3, r=rkruppe
bors [Sat, 14 Jul 2018 18:28:50 +0000 (18:28 +0000)]
Auto merge of #52379 - kennytm:revert-o3, r=rkruppe

Revert #52212 (revert set opt-level = 3)

Setting -O3 causes LLVM to spuriously segfault at least on Linux. This PR reverts to -O2.

cc #52378

6 years agoChange keep-stage to only affect the passed stage
Mark Rousskov [Sat, 14 Jul 2018 16:58:10 +0000 (10:58 -0600)]
Change keep-stage to only affect the passed stage

The best way to build a stage 2 rustc is now probably
  ./x.py build --stage 2 src/rustc # once
  ./x.py build --stage 2 --keep-stage 1 src/rustc

6 years agoAuto merge of #51829 - petrochenkov:noideq, r=eddyb
bors [Sat, 14 Jul 2018 16:22:19 +0000 (16:22 +0000)]
Auto merge of #51829 - petrochenkov:noideq, r=eddyb

Remove most of `PartialEq` and `Hash` impls from AST and HIR structures

Continuation of https://github.com/rust-lang/rust/pull/49326, prerequisite for removing `PartialEq` for `Ident`.

6 years agoRemove `ty_to_def_id`
Oliver Schneider [Sat, 14 Jul 2018 15:22:53 +0000 (17:22 +0200)]
Remove `ty_to_def_id`

6 years agoRevert "Auto merge of #52212 - kennytm:o3-again, r=alexcrichton"
kennytm [Sat, 14 Jul 2018 15:04:33 +0000 (23:04 +0800)]
Revert "Auto merge of #52212 - kennytm:o3-again, r=alexcrichton"

This reverts commit 1731f0af22af16c461b2b7abe58988b8549b2de6, reversing
changes made to 0a8275f8b677304458c6161e26436dfe67ab766b.

6 years agoAddress comments
Vadim Petrochenkov [Fri, 6 Jul 2018 20:18:38 +0000 (23:18 +0300)]
Address comments

6 years agoRemove some tests using AST comparisons, fix other tests
Vadim Petrochenkov [Tue, 26 Jun 2018 22:59:07 +0000 (01:59 +0300)]
Remove some tests using AST comparisons, fix other tests

6 years agoRemove most of `Hash` impls from AST and HIR structures
Vadim Petrochenkov [Tue, 26 Jun 2018 21:57:27 +0000 (00:57 +0300)]
Remove most of `Hash` impls from AST and HIR structures

6 years agoRemove most of `PartialEq` impls from AST and HIR structures
Vadim Petrochenkov [Tue, 20 Mar 2018 22:58:25 +0000 (01:58 +0300)]
Remove most of `PartialEq` impls from AST and HIR structures

6 years agoAuto merge of #52212 - kennytm:o3-again, r=alexcrichton
bors [Sat, 14 Jul 2018 10:24:59 +0000 (10:24 +0000)]
Auto merge of #52212 - kennytm:o3-again, r=alexcrichton

Set opt-level = 3 the third time.

This PR reverts #51165 (set -O2 for fixing #50867),
which reverted #50329 (set -O3),
which was second attempt of #48204 (set -O3, closed due to Windows segfault that is fixed now),
which reverted #42123 (set -O2 to fix spurious Windows segfaults),
which reverted #41967 (set -O3).

Since we have found the root cause of #50867, this optimization could be tried again.

Last time we've found that setting -O3 regressed the wall time of NLL (https://github.com/rust-lang/rust/pull/50329#issuecomment-388084894), so we may need another perf run to confirm. I'd like to check this *after* the LLVM 7 upgrade #51966 has been merged, so marking this as <kbd>S-blocked</kbd> for now.

6 years agoAuto merge of #52244 - glandium:issue52097, r=estebank
bors [Sat, 14 Jul 2018 06:24:42 +0000 (06:24 +0000)]
Auto merge of #52244 - glandium:issue52097, r=estebank

Don't display default generic parameters in diagnostics that compare types

In errors like:
```
   expected type: `RawVec<foo, Global>`
      found type: `foo`
```

`RawVec` being defined as `RawVec<T, A: Alloc = Global>`, the error is better written as
```
   expected type: `RawVec<foo>`
      found type: `foo`
```

In fact, that is already what happens when `foo` is not an ADT, because in that case, the diagnostic handler doesn't try to highlight something, and just uses the `Display` trait instead of its own logic.

e.g.
```
   expected type: `RawVec<usize>`
      found type: `usize`
```

6 years agoAuto merge of #52328 - petrochenkov:pmroot, r=alexcrichton
bors [Sat, 14 Jul 2018 04:19:44 +0000 (04:19 +0000)]
Auto merge of #52328 - petrochenkov:pmroot, r=alexcrichton

proc_macro: Fix crate root detection

Fixes https://github.com/rust-lang/rust/issues/52270

6 years agoadd test for issue 52129
QuietMisdreavus [Sat, 14 Jul 2018 02:46:47 +0000 (21:46 -0500)]
add test for issue 52129

6 years agoDo not attempt to recompile codegen backend(s) with --keep-stage
Mark Rousskov [Sat, 14 Jul 2018 00:45:13 +0000 (18:45 -0600)]
Do not attempt to recompile codegen backend(s) with --keep-stage

Previously we'd attempt to recompile them and that would fail since
we've essentially not built the entire compiler yet, or we're faking
that fact. This commit should make us ignore the codegen backend build
as well.

Unlike the other compile steps, there is no CodegenBackendLink step that
we run here, because that is done later as a part of assembling the
final compiler and as an explicit function call.

6 years agoAuto merge of #52314 - varkor:issue-52023, r=oli-obk
bors [Sat, 14 Jul 2018 02:11:10 +0000 (02:11 +0000)]
Auto merge of #52314 - varkor:issue-52023, r=oli-obk

Fix ICE when using a pointer cast as array size

Fixes #52023. I'm not sure if the comment https://github.com/rust-lang/rust/issues/52023#issuecomment-402402392 suggested we also emit `E0080`, but just emitting `E0018` seems reasonable for now.

r? @oli-obk

6 years agoAuto merge of #52032 - DiamondLovesYou:amdgpu-kernel-abi, r=alexcrichton
bors [Sat, 14 Jul 2018 00:12:21 +0000 (00:12 +0000)]
Auto merge of #52032 - DiamondLovesYou:amdgpu-kernel-abi, r=alexcrichton

Add the `amdgpu-kernel` ABI.

Technically, there are requirements imposed by the LLVM
`AMDGPUTargetMachine` on functions with this ABI (eg, the return type
must be void), but I'm unsure exactly where this should be enforced.

6 years agodon't panic when you see proc-macros
QuietMisdreavus [Fri, 13 Jul 2018 22:34:58 +0000 (17:34 -0500)]
don't panic when you see proc-macros

6 years agoAdd the `amdgpu-kernel` ABI.
Richard Diamond [Mon, 2 Jul 2018 03:42:00 +0000 (22:42 -0500)]
Add the `amdgpu-kernel` ABI.

Technically, there are requirements imposed by the LLVM
`AMDGPUTargetMachine` on functions with this ABI (eg, the return type
must be void), but I'm unsure exactly where this should be enforced.

6 years agoAuto merge of #52266 - michaelwoerister:incr-thinlto-preliminaries, r=alexcrichton
bors [Fri, 13 Jul 2018 22:06:38 +0000 (22:06 +0000)]
Auto merge of #52266 - michaelwoerister:incr-thinlto-preliminaries, r=alexcrichton

Preliminary work for incremental ThinLTO.

Since implementing incremental ThinLTO is a bit more involved than I initially thought, I'm splitting out some of the things that already work. This PR (1) adds a way accessing some ThinLTO information in `rustc` and (2) does some cleanup around CGU/object file naming (which makes things quite a bit nicer).

This is probably best reviewed one commit at a time.

6 years agoAuto merge of #52352 - kennytm:rollup, r=kennytm
bors [Fri, 13 Jul 2018 19:49:11 +0000 (19:49 +0000)]
Auto merge of #52352 - kennytm:rollup, r=kennytm

Rollup of 17 pull requests

Successful merges:

 - #51962 (Provide llvm-strip in llvm-tools component)
 - #52003 (Implement `Option::replace` in the core library)
 - #52156 (Update std::ascii::ASCIIExt deprecation notes)
 - #52280 (llvm-tools-preview: fix build-manifest)
 - #52290 (Deny bare trait objects in src/librustc_save_analysis)
 - #52293 (Deny bare trait objects in librustc_typeck)
 - #52299 (Deny bare trait objects in src/libserialize)
 - #52300 (Deny bare trait objects in librustc_target and libtest)
 - #52302 (Deny bare trait objects in the rest of rust)
 - #52310 (Backport 1.27.1 release notes to master)
 - #52315 (Resolve FIXME(#27942))
 - #52316 (task: remove wrong comments about non-existent LocalWake trait)
 - #52322 (Update llvm-rebuild-trigger in light of LLVM 7 upgrade)
 - #52330 (Don't silently ignore invalid data in target spec)
 - #52333 (CI: Enable core dump on Linux, and print their stack trace on segfault. )
 - #52346 (Fix typo in improper_ctypes suggestion)
 - #52350 (Bump bootstrap compiler to 1.28.0-beta.10)

Failed merges:

r? @ghost

6 years agoRollup merge of #52350 - pietroalbini:bump-bootstrap, r=Mark-Simulacrum
kennytm [Fri, 13 Jul 2018 18:56:58 +0000 (02:56 +0800)]
Rollup merge of #52350 - pietroalbini:bump-bootstrap, r=Mark-Simulacrum

Bump bootstrap compiler to 1.28.0-beta.10

r? @Mark-Simulacrum

6 years agoRollup merge of #52346 - rkruppe:patch-1, r=cramertj
kennytm [Fri, 13 Jul 2018 18:56:57 +0000 (02:56 +0800)]
Rollup merge of #52346 - rkruppe:patch-1, r=cramertj

Fix typo in improper_ctypes suggestion

closes #52345

6 years agoRollup merge of #52333 - kennytm:linux-core-dump, r=alexcrichton
kennytm [Fri, 13 Jul 2018 18:56:56 +0000 (02:56 +0800)]
Rollup merge of #52333 - kennytm:linux-core-dump, r=alexcrichton

CI: Enable core dump on Linux, and print their stack trace on segfault.

6 years agoRollup merge of #52330 - jethrogb:jb/target-link-args, r=varkor
kennytm [Fri, 13 Jul 2018 18:56:55 +0000 (02:56 +0800)]
Rollup merge of #52330 - jethrogb:jb/target-link-args, r=varkor

Don't silently ignore invalid data in target spec

This is technically a breaking change, but only because invalid data was previously silently being ignored.

6 years agoRollup merge of #52322 - varkor:llvm-7-rebuild-trigger, r=alexcrichton
kennytm [Fri, 13 Jul 2018 18:56:53 +0000 (02:56 +0800)]
Rollup merge of #52322 - varkor:llvm-7-rebuild-trigger, r=alexcrichton

Update llvm-rebuild-trigger in light of LLVM 7 upgrade

Not triggering a LLVM rebuild [since the LLVM 7 upgrade](https://github.com/rust-lang/rust/pull/51966#issuecomment-404624633) causes builds of rustc to fail.

r? @alexcrichton

6 years agoRollup merge of #52316 - seanmonstar:waker-unsafety, r=cramertj
kennytm [Fri, 13 Jul 2018 18:56:52 +0000 (02:56 +0800)]
Rollup merge of #52316 - seanmonstar:waker-unsafety, r=cramertj

task: remove wrong comments about non-existent LocalWake trait

~~A `LocalWaker` is specifically `!Send `, and the unsafety comment around
`LocalWaker::new` only specifies that it be safe to call `wake_local`.
One could then accidentally promote a `LocalWaker` into a `Waker`, which
is universally `Send`, simply via `Waker::from(local_waker)`. A
`LocalWaker` the was built expecting to not be `Send`, such as using
`Rc`, could be sent to other threads safely.~~

~~Separately, though somewhat related, `Context` holds a `&LocalWaker`
internally, and exposes a `waker() -> &Waker` method. This simply
transmutes the `&LocalWaker` to `&Waker`, which would be unsound, except
that you can't "send" a `&Waker`, you'd need to clone it first. Since
`UnsafeWake::clone_raw` requires that it return a `Waker`, the transmute
is not unsound. The transmuted `LocalWaker` will be promoted to a
`Waker` correctly.~~

~~That would mean that if `UnsafeWake::clone_raw` were to be changed, such
as returning `Self` instead of `Waker`, this would no longer be sound.
Thus, this also adds a comment to `clone_raw` to remember this.~~

r? @cramertj

6 years agoRollup merge of #52315 - ljedrz:FIXME_#27942, r=petrochenkov
kennytm [Fri, 13 Jul 2018 18:56:51 +0000 (02:56 +0800)]
Rollup merge of #52315 - ljedrz:FIXME_#27942, r=petrochenkov

Resolve FIXME(#27942)

[related issue](https://github.com/rust-lang/rust/issues/27942)

cc [#44366](https://github.com/rust-lang/rust/issues/44366)

6 years agoRollup merge of #52310 - Mark-Simulacrum:release-notes-backport-from-stable, r=pietro...
kennytm [Fri, 13 Jul 2018 18:56:50 +0000 (02:56 +0800)]
Rollup merge of #52310 - Mark-Simulacrum:release-notes-backport-from-stable, r=pietroalbini

Backport 1.27.1 release notes to master

r? @pietroalbini

6 years agoRollup merge of #52302 - ljedrz:dyn_futureproofing, r=cramertj
kennytm [Fri, 13 Jul 2018 18:56:49 +0000 (02:56 +0800)]
Rollup merge of #52302 - ljedrz:dyn_futureproofing, r=cramertj

Deny bare trait objects in the rest of rust

Add `#![deny(bare_trait_objects)]` to all the modules not covered before (those did not require code changes) that I consider applicable (I left out shims) in order to futureproof them.

6 years agoRollup merge of #52300 - ljedrz:dyn_target_test, r=Mark-Simulacrum
kennytm [Fri, 13 Jul 2018 18:56:47 +0000 (02:56 +0800)]
Rollup merge of #52300 - ljedrz:dyn_target_test, r=Mark-Simulacrum

Deny bare trait objects in librustc_target and libtest

Enforce `#![deny(bare_trait_objects)]` in `src/librustc_target` and `src/libtest`.

6 years agoRollup merge of #52299 - ljedrz:dyn_libserialize, r=cramertj
kennytm [Fri, 13 Jul 2018 18:56:46 +0000 (02:56 +0800)]
Rollup merge of #52299 - ljedrz:dyn_libserialize, r=cramertj

Deny bare trait objects in src/libserialize

Enforce `#![deny(bare_trait_objects)]` in `src/libserialize`.

6 years agoRollup merge of #52293 - ljedrz:dyn_librustc_typeck, r=estebank
kennytm [Fri, 13 Jul 2018 18:56:45 +0000 (02:56 +0800)]
Rollup merge of #52293 - ljedrz:dyn_librustc_typeck, r=estebank

Deny bare trait objects in librustc_typeck

Enforce `#![deny(bare_trait_objects)]` in `src/librustc_typeck`.

6 years agoRollup merge of #52290 - ljedrz:dyn_librustc_save_analysis, r=cramertj
kennytm [Fri, 13 Jul 2018 18:56:44 +0000 (02:56 +0800)]
Rollup merge of #52290 - ljedrz:dyn_librustc_save_analysis, r=cramertj

Deny bare trait objects in src/librustc_save_analysis

Enforce `#![deny(bare_trait_objects)]` in `src/librustc_save_analysis`.

6 years agoRollup merge of #52280 - japaric:llvm-tools-preview, r=kennytm
kennytm [Fri, 13 Jul 2018 18:56:42 +0000 (02:56 +0800)]
Rollup merge of #52280 - japaric:llvm-tools-preview, r=kennytm

llvm-tools-preview: fix build-manifest

r? @alexcrichton

6 years agoRollup merge of #52156 - zajlerke:update-deprecation-notice, r=Kimundi
kennytm [Fri, 13 Jul 2018 18:56:41 +0000 (02:56 +0800)]
Rollup merge of #52156 - zajlerke:update-deprecation-notice, r=Kimundi

Update std::ascii::ASCIIExt deprecation notes

Fixes #52085

6 years agoRollup merge of #52003 - Kerollmops:option-replace, r=Kimundi
kennytm [Fri, 13 Jul 2018 18:56:40 +0000 (02:56 +0800)]
Rollup merge of #52003 - Kerollmops:option-replace, r=Kimundi

Implement `Option::replace` in the core library

Here is the implementation of the `Option::replace` method. The first step of [the tracking issue #51998](https://github.com/rust-lang/rust/issues/51998).

6 years agoRollup merge of #51962 - crlf0710:patch-2, r=alexcrichton
kennytm [Fri, 13 Jul 2018 18:56:37 +0000 (02:56 +0800)]
Rollup merge of #51962 - crlf0710:patch-2, r=alexcrichton

Provide llvm-strip in llvm-tools component

Shipping this tool gives people reliable way to reduce the generated executable size.

I'm not sure if this strip tool is available from the llvm version current rust is built on. But let's take a look. @japaric

6 years agoUse the correct visibility
Oliver Schneider [Fri, 13 Jul 2018 18:43:08 +0000 (20:43 +0200)]
Use the correct visibility

6 years agoFix link to RFC 1510
Matt Brubeck [Fri, 13 Jul 2018 18:00:33 +0000 (11:00 -0700)]
Fix link to RFC 1510

6 years agoBump bootstrap compiler to 1.28.0-beta.10
Pietro Albini [Fri, 13 Jul 2018 17:33:48 +0000 (19:33 +0200)]
Bump bootstrap compiler to 1.28.0-beta.10

6 years agoDon't silently ignore invalid data in target spec
Jethro Beekman [Fri, 13 Jul 2018 17:14:16 +0000 (10:14 -0700)]
Don't silently ignore invalid data in target spec

6 years agoAuto merge of #52242 - ashtneoi:suggest-ref-mut, r=pnkfelix
bors [Fri, 13 Jul 2018 17:08:39 +0000 (17:08 +0000)]
Auto merge of #52242 - ashtneoi:suggest-ref-mut, r=pnkfelix

NLL: Suggest `ref mut` and `&mut self`

Fixes #51244. Supersedes #51249, I think.

Under the old lexical lifetimes, the compiler provided helpful suggestions about adding `mut` when you tried to mutate a variable bound as `&self` or (explicit) `ref`. NLL doesn't have those suggestions yet. This pull request adds them.

I didn't bother making the help text exactly the same as without NLL, but I can if that's important.

(Originally this was supposed to be part of #51612, but I got bogged down trying to fit everything in one PR.)

6 years agorustc: Tweak expansion of #[proc_macro] for 2018
Alex Crichton [Thu, 12 Jul 2018 21:04:24 +0000 (14:04 -0700)]
rustc: Tweak expansion of #[proc_macro] for 2018

The syntactical expansion of `#[proc_macro]` and related attributes currently
contains absolute paths which conflicts with a lint for the 2018 edition,
causing issues like #52214. This commit puts a band-aid on the issue by ensuring
that procedural macros can also migrate to the 2018 edition for now by tweaking
the expansion based on what features are activated. A more long-term solution
would probably tweak the edition hygiene of spans, but this should do the trick
for now.

Closes #52214

6 years agoFix typo in improper_ctypes suggestion
Robin Kruppe [Fri, 13 Jul 2018 13:51:25 +0000 (15:51 +0200)]
Fix typo in improper_ctypes suggestion

closes #52345

6 years agoEnabled core dump on Linux, and print stack trace on failure.
kennytm [Thu, 12 Jul 2018 17:56:17 +0000 (01:56 +0800)]
Enabled core dump on Linux, and print stack trace on failure.

6 years agoAuto merge of #51987 - nikomatsakis:nll-region-infer-scc, r=pnkfelix
bors [Fri, 13 Jul 2018 13:28:55 +0000 (13:28 +0000)]
Auto merge of #51987 - nikomatsakis:nll-region-infer-scc, r=pnkfelix

nll experiment: compute SCCs instead of iterative region solving

This is an attempt to speed up region solving by replacing the current iterative dataflow with a SCC computation. The idea is to detect cycles (SCCs) amongst region constraints and then compute just one value per cycle. The graph with all cycles removed is of course a DAG, so we can then solve constraints "bottom up" once the liveness values are known.

I kinda ran out of time this morning so the last commit is a bit sloppy but I wanted to get this posted, let travis run on it, and maybe do a perf run, before I clean it up.

6 years agoUse callback-based interface to load ThinLTO import data into rustc.
Michael Woerister [Fri, 13 Jul 2018 10:41:22 +0000 (12:41 +0200)]
Use callback-based interface to load ThinLTO import data into rustc.

6 years agoAuto merge of #51622 - kennytm:three-field-range-inclusive, r=SimonSapin
bors [Fri, 13 Jul 2018 10:18:38 +0000 (10:18 +0000)]
Auto merge of #51622 - kennytm:three-field-range-inclusive, r=SimonSapin

Change RangeInclusive to a three-field struct.

Fix #45222.

This PR also reverts #48012 (i.e. removed the `try_fold`/`try_rfold` specialization for `RangeInclusive`) because LLVM no longer has trouble recognizing a RangeInclusive loop.

6 years agoAuto merge of #52281 - cramertj:fast-tls, r=alexcrichton
bors [Fri, 13 Jul 2018 08:00:16 +0000 (08:00 +0000)]
Auto merge of #52281 - cramertj:fast-tls, r=alexcrichton

Use fast TLS on Fuchsia

I'm not sure why Fuchsia was separated here, but we provide these symbols, and tests are passing in QEMU with this change. cc @raphlinus.

r? @alexcrichton

6 years agoBless one more test
ashtneoi [Fri, 13 Jul 2018 06:11:57 +0000 (23:11 -0700)]
Bless one more test

6 years agoFactor out suggest_ref_mut; use it in rustc_borrowck
ashtneoi [Thu, 12 Jul 2018 22:39:36 +0000 (15:39 -0700)]
Factor out suggest_ref_mut; use it in rustc_borrowck

Also teach rustc_borrowck not to show useless help messages like
"use a mutable reference instead: `x`".

6 years agoBless tests and update ERROR
ashtneoi [Thu, 12 Jul 2018 20:11:47 +0000 (13:11 -0700)]
Bless tests and update ERROR

6 years agospan_suggestion
csmoe [Thu, 14 Jun 2018 01:12:50 +0000 (09:12 +0800)]
span_suggestion

6 years agoadd nll stderr
csmoe [Sun, 3 Jun 2018 04:06:21 +0000 (12:06 +0800)]
add nll stderr

6 years agoupdate test
csmoe [Fri, 1 Jun 2018 13:03:24 +0000 (21:03 +0800)]
update test

6 years agoreplace ref
csmoe [Fri, 1 Jun 2018 11:00:15 +0000 (19:00 +0800)]
replace ref

6 years agolint with ref_span
csmoe [Fri, 1 Jun 2018 04:08:31 +0000 (12:08 +0800)]
lint with ref_span

6 years agoupdate test
csmoe [Thu, 31 May 2018 15:00:58 +0000 (23:00 +0800)]
update test

6 years agofix wrong replacing
csmoe [Thu, 31 May 2018 14:31:13 +0000 (22:31 +0800)]
fix wrong replacing

6 years agoAlso test `&mut self` suggestion
ashtneoi [Wed, 11 Jul 2018 10:45:25 +0000 (03:45 -0700)]
Also test `&mut self` suggestion

6 years agoSimplify match expression
ashtneoi [Wed, 11 Jul 2018 07:44:55 +0000 (00:44 -0700)]
Simplify match expression

6 years agoPut the two halves of suggest_ampmut back together
ashtneoi [Wed, 11 Jul 2018 06:23:13 +0000 (23:23 -0700)]
Put the two halves of suggest_ampmut back together

6 years agoDon't try to suggest `ref mut` for implicit `ref`
ashtneoi [Wed, 11 Jul 2018 06:14:12 +0000 (23:14 -0700)]
Don't try to suggest `ref mut` for implicit `ref`

6 years agoReimplement some "add `mut`" suggestions under NLL
ashtneoi [Wed, 11 Jul 2018 05:58:43 +0000 (22:58 -0700)]
Reimplement some "add `mut`" suggestions under NLL

Specifically, `&self` -> `&mut self` and explicit `ref` -> `ref mut`.
Implicit `ref` isn't handled yet and causes an ICE.

6 years agoAdd `ref mut` suggestion test
ashtneoi [Wed, 11 Jul 2018 04:31:07 +0000 (21:31 -0700)]
Add `ref mut` suggestion test

6 years agonit: fix typo
Niko Matsakis [Fri, 13 Jul 2018 05:28:36 +0000 (01:28 -0400)]
nit: fix typo

6 years agonit: fix `all_sccs` comment
Niko Matsakis [Fri, 13 Jul 2018 05:28:06 +0000 (01:28 -0400)]
nit: fix `all_sccs` comment

6 years agonit: tweak comment order
Niko Matsakis [Fri, 13 Jul 2018 05:27:13 +0000 (01:27 -0400)]
nit: tweak comment order

6 years agonit: improve SCC comments
Niko Matsakis [Fri, 13 Jul 2018 05:25:21 +0000 (01:25 -0400)]
nit: improve SCC comments

6 years agonit: clarify "keep it around" comment
Niko Matsakis [Fri, 13 Jul 2018 05:18:35 +0000 (01:18 -0400)]
nit: clarify "keep it around" comment

6 years agonit: s/successor/successors/
Niko Matsakis [Fri, 13 Jul 2018 05:18:00 +0000 (01:18 -0400)]
nit: s/successor/successors/

6 years agonit: `use graph::{self, ..}`
Niko Matsakis [Fri, 13 Jul 2018 05:17:20 +0000 (01:17 -0400)]
nit: `use graph::{self, ..}`

6 years agodump scc graphviz too
Niko Matsakis [Wed, 4 Jul 2018 23:39:38 +0000 (19:39 -0400)]
dump scc graphviz too

6 years agoimpl graphviz trait for a newtype of regioncx
Niko Matsakis [Wed, 4 Jul 2018 10:07:17 +0000 (06:07 -0400)]
impl graphviz trait for a newtype of regioncx

6 years agocompute region values using SCCs not iterative flow
Niko Matsakis [Mon, 2 Jul 2018 15:29:39 +0000 (11:29 -0400)]
compute region values using SCCs not iterative flow

The strategy is this:

- we compute SCCs once all outlives constraints are known
- we allocate a set of values **per region** for storing liveness
- we allocate a set of values **per SCC** for storing the final values
- when we add a liveness constraint to the region R, we also add it
  to the final value of the SCC to which R belongs
- then we can apply the constraints by just walking the DAG for the
  SCCs and union'ing the children (which have their liveness
  constraints within)

There are a few intermediate refactorings that I really ought to have
broken out into their own commits:

- reverse the constraint graph so that `R1: R2` means `R1 -> R2` and
  not `R2 -> R1`. This fits better with the SCC computation and new
  style of inference (`->` now means "take value from" and not "push
  value into")
  - this does affect some of the UI tests, since they traverse the
    graph, but mostly the artificial ones and they don't necessarily
    seem worse
- put some things (constraint set, etc) into `Rc`. This lets us root
  them to permit mutation and iteration. It also guarantees they don't
  change, which is critical to the correctness of the algorithm.
- Generalize various helpers that previously operated only on points
  to work on any sort of region element.

6 years agoChanged implementation of the third field to make LLVM optimize it better.
kennytm [Fri, 13 Jul 2018 05:08:28 +0000 (13:08 +0800)]
Changed implementation of the third field to make LLVM optimize it better.

6 years agoAuto merge of #52275 - alexcrichton:no-macro-use, r=nrc
bors [Fri, 13 Jul 2018 03:40:33 +0000 (03:40 +0000)]
Auto merge of #52275 - alexcrichton:no-macro-use, r=nrc

rustc: Lint against `#[macro_use]` in 2018 idioms

This commit adds a lint to the compiler to warn against the `#[macro_use]`
directive as part of the `rust_2018_idioms` lint. This lint is turned off by
default and is only enabled when the `use_extern_macros` feature is also
enabled.

The lint here isn't fully fleshed out as it's just a simple warning rather than
suggestions of how to actually import the macro, but hopefully it's a good base
to start from!

cc #52043

6 years agoInclude is_empty() in PartialEq and Hash.
kennytm [Sat, 30 Jun 2018 09:13:21 +0000 (17:13 +0800)]
Include is_empty() in PartialEq and Hash.

When the index is not PartialOrd, always treat the range as empty.

6 years agoUpgrade implementation of StepBy<RangeInclusive<_>>.
kennytm [Fri, 22 Jun 2018 17:42:29 +0000 (01:42 +0800)]
Upgrade implementation of StepBy<RangeInclusive<_>>.

6 years agoFix some RangeInclusive test cases.
kennytm [Tue, 19 Jun 2018 08:56:18 +0000 (16:56 +0800)]
Fix some RangeInclusive test cases.

6 years agoChange RangeInclusive to a three-field struct.
kennytm [Mon, 18 Jun 2018 20:08:20 +0000 (04:08 +0800)]
Change RangeInclusive to a three-field struct.

Fix #45222.

6 years agoAuto merge of #52046 - cramertj:fix-generator-mir, r=eddyb
bors [Fri, 13 Jul 2018 00:38:17 +0000 (00:38 +0000)]
Auto merge of #52046 - cramertj:fix-generator-mir, r=eddyb

Ensure StorageDead is created even if variable initialization fails

Rebase and slight cleanup of https://github.com/rust-lang/rust/pull/51109
Fixes https://github.com/rust-lang/rust/issues/49232

r? @eddyb

6 years agoproc_macro: Fix crate root detection
Vadim Petrochenkov [Thu, 12 Jul 2018 22:59:41 +0000 (01:59 +0300)]
proc_macro: Fix crate root detection

6 years agotask: remove wrong comments about non-existent LocalWake trait
Sean McArthur [Thu, 12 Jul 2018 22:43:57 +0000 (15:43 -0700)]
task: remove wrong comments about non-existent LocalWake trait

6 years agorustc: Lint against `#[macro_use]` in 2018 idioms
Alex Crichton [Wed, 11 Jul 2018 21:25:29 +0000 (14:25 -0700)]
rustc: Lint against `#[macro_use]` in 2018 idioms

This commit adds a lint to the compiler to warn against the `#[macro_use]`
directive as part of the `rust_2018_idioms` lint. This lint is turned off by
default and is only enabled when the `use_extern_macros` feature is also
enabled.

The lint here isn't fully fleshed out as it's just a simple warning rather than
suggestions of how to actually import the macro, but hopefully it's a good base
to start from!

cc #52043

6 years agoAuto merge of #51339 - sdroege:exact-chunks-remainder, r=alexcrichton
bors [Thu, 12 Jul 2018 19:39:04 +0000 (19:39 +0000)]
Auto merge of #51339 - sdroege:exact-chunks-remainder, r=alexcrichton

Add ExactChunks::remainder and ExactChunks::into_remainder

These allow to get the leftover items of the slice that are not being
iterated as part of the iterator due to not filling a complete chunk.

The mutable version consumes the slice because otherwise we would either
a) have to borrow the iterator instead of taking the lifetime of
the underlying slice, which is not what *any* of the other iterator
functions is doing, or
b) would allow returning multiple mutable references to the same data

The current behaviour of consuming the iterator is consistent with
IterMut::into_slice for the normal iterator.

----

This is related to https://github.com/rust-lang/rust/issues/47115#issuecomment-392685177 and the following comments.

While there the discussion was first about a way to get the "tail" of the iterator (everything from the slice that is still not iterated yet), this gives kind of unintuitive behaviour and is inconsistent with how the other slice iterators work.

Unintuitive because the `next_back` would have no effect on the tail (or otherwise the tail could not include the remainder items), inconsistent because a) generally the idea of the slice iterators seems to be to only ever return items that were not iterated yet (and don't provide a way to access the same item twice) and b) we would return a "flat" `&[T]` slice but the iterator's shape is `&[[T]]` instead, c) the mutable variant would have to borrow from the iterator instead of the underlying slice (all other iterator functions borrow from the underlying slice!)

As such, I've only implemented functions to get the remainder. This also allows the implementation to be completely safe still (and around slices instead of raw pointers), while getting the tail would either be inefficient or would have to be implemented around raw pointers.

CC @kerollmops

6 years agoUpdate llvm-rebuild-trigger in light of LLVM 7 upgrade
varkor [Thu, 12 Jul 2018 19:32:35 +0000 (12:32 -0700)]
Update llvm-rebuild-trigger in light of LLVM 7 upgrade

6 years agoEnsure StorageDead is created even if variable initialization fails
Taylor Cramer [Wed, 4 Jul 2018 01:09:00 +0000 (18:09 -0700)]
Ensure StorageDead is created even if variable initialization fails