]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoupdate compiler-builtins for openbsd
Sébastien Marie [Mon, 16 Jul 2018 14:26:43 +0000 (16:26 +0200)]
update compiler-builtins for openbsd

6 years agoAuto merge of #52373 - eonil:master, r=kennytm
bors [Mon, 16 Jul 2018 01:40:51 +0000 (01:40 +0000)]
Auto merge of #52373 - eonil:master, r=kennytm

Update lint plugin sample code.

The sample code is out of sync with latest test code and broken.
I just copied missing feature gates.

6 years agoAuto merge of #52401 - semarie:tidy-extdeps, r=alexcrichton
bors [Sun, 15 Jul 2018 23:39:28 +0000 (23:39 +0000)]
Auto merge of #52401 - semarie:tidy-extdeps, r=alexcrichton

tidy: add a new test for external dependencies

ensure all packages in Cargo.lock will be vendored, and fail if the
source packages isn't whitelisted.

the purpose is to avoid such kind of issues:
- #52029 Rustfmt isn't vendored correctly
- #42719 building beta with vendor=true fail due to network dependencies

as Rust comes with several external dependencies (clippy, miri, rustfmt, rls), it is important to have a way to catch some errors in the update of this submodules.

The new check in tidy quickly reads `Cargo.lock` to search for the `source` of all packages. This attribute is present when the package comes from external source (like `crates.io-index` or some `git` repository). Some sources are whitelisted (like `crates.io-index`) as the crates are vendored.

`Cargo.lock` extract with several cases (git, crates.io, and local).
```
[[package]]
name = "rustfmt-nightly"
version = "0.8.2"
source = "git+https://github.com/rust-lang-nursery/rustfmt?rev=5e5992517d3591e2708d4ca6b155dfcbdf3344b9#5e5992517d3591e2708d4ca6b155dfcbdf3344b9"
dependencies = [
...
]

[[package]]
name = "same-file"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
...
]

[[package]]
name = "rustdoc-themes"
version = "0.1.0"
```

r? @alexcrichton

6 years agoAuto merge of #52400 - RalfJung:match, r=oli-obk
bors [Sun, 15 Jul 2018 21:35:22 +0000 (21:35 +0000)]
Auto merge of #52400 - RalfJung:match, r=oli-obk

CTFE: use binary_op to compare integer with match disriminant

This is needed to unblock https://github.com/solson/miri/pull/401: There is code in the Windows initialization functions that uses `match` to test whether a pointer is NULL.

I will add a testcase in miri; I was not sure where to add a testcase in Rust itself.

r? @oli-obk

6 years agoAuto merge of #52383 - petrochenkov:pmns, r=alexcrichton
bors [Sun, 15 Jul 2018 19:35:06 +0000 (19:35 +0000)]
Auto merge of #52383 - petrochenkov:pmns, r=alexcrichton

resolve: Functions introducing procedural macros reserve a slot in the macro namespace as well

Similarly to https://github.com/rust-lang/rust/pull/52234, this gives us symmetry between internal and external views of a crate, but in this case it's always an error to call a procedural macro in the same crate in which it's defined.

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

6 years agofix line numbers
Ralf Jung [Sun, 15 Jul 2018 18:42:18 +0000 (20:42 +0200)]
fix line numbers

6 years agoAuto merge of #52399 - semarie:llvmtools, r=alexcrichton
bors [Sun, 15 Jul 2018 17:23:31 +0000 (17:23 +0000)]
Auto merge of #52399 - semarie:llvmtools, r=alexcrichton

Disable LlvmTools packaging with external LLVM

Fixes: #52102
6 years agoAuto merge of #52372 - KarolinePlum:Duration-rounding-documentation, r=joshtriplett
bors [Sun, 15 Jul 2018 15:18:33 +0000 (15:18 +0000)]
Auto merge of #52372 - KarolinePlum:Duration-rounding-documentation, r=joshtriplett

Document rounding down in std::time::Durations's subsec_millis etc.

Now also the documentations of `subsec_millis`, `subsec_micros`, `as_millis` and `as_micros` make clear that the fractional nanosecond component is rounded down to whole units.

Fixed #52263

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 agoadd license text
Ralf Jung [Sun, 15 Jul 2018 12:26:31 +0000 (14:26 +0200)]
add license text

6 years agoadd test case
Ralf Jung [Sun, 15 Jul 2018 11:55:17 +0000 (13:55 +0200)]
add test case

6 years agotidy: add a new test for external dependencies
Sébastien Marie [Sun, 15 Jul 2018 10:46:02 +0000 (12:46 +0200)]
tidy: add a new test for external dependencies

ensure all packages in Cargo.lock will be vendored, and fail if the
source packages isn't whitelisted.

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 agoCTFE: use binary_op to compare integer with match disriminant
Ralf Jung [Sun, 15 Jul 2018 09:35:18 +0000 (11:35 +0200)]
CTFE: use binary_op to compare integer with match disriminant

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 agotidy: avoid long line
Sébastien Marie [Sun, 15 Jul 2018 07:58:58 +0000 (09:58 +0200)]
tidy: avoid long line

6 years agoDisable LlvmTools packaging with external LLVM
Sébastien Marie [Sun, 15 Jul 2018 07:23:36 +0000 (09:23 +0200)]
Disable LlvmTools packaging with external LLVM

Fixes: #52102
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 agoFunctions introducing procedural macros reserve a slot in the macro namespace as...
Vadim Petrochenkov [Thu, 12 Jul 2018 10:24:59 +0000 (13:24 +0300)]
Functions introducing procedural macros reserve a slot in the macro namespace as well

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 agoUpdate lint plugin sample code.
eonil [Sat, 14 Jul 2018 14:23:31 +0000 (21:23 +0700)]
Update lint plugin sample code.

6 years agoMake rounding down clear in duration documentation
Karoline Plum [Sat, 14 Jul 2018 13:48:52 +0000 (15:48 +0200)]
Make rounding down clear in duration documentation

Now also the documentations of `subsec_millis`, `subsec_micros`, `as_millis` and `as_micros` make clear that the fractional nanosecond component is rounded down to whole units.

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/