]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoRollup merge of #52434 - Mark-Simulacrum:incremental-keep-stage, r=alexcrichton
kennytm [Tue, 17 Jul 2018 10:15:10 +0000 (18:15 +0800)]
Rollup merge of #52434 - Mark-Simulacrum:incremental-keep-stage, r=alexcrichton

Enable incremental independent of stage

Previously we'd only do so for stage 0 but with keep-stage
improvements it seems likely that we'll see more developers working in
the stage 1, so we should allow enabling incremental for them.

6 years agoRollup merge of #52338 - RalfJung:miri, r=oli-obk
kennytm [Tue, 17 Jul 2018 10:13:38 +0000 (18:13 +0800)]
Rollup merge of #52338 - RalfJung:miri, r=oli-obk

update miri

6 years agoRollup merge of #52435 - ljedrz:misc_capacity, r=estebank
kennytm [Mon, 16 Jul 2018 18:19:02 +0000 (02:19 +0800)]
Rollup merge of #52435 - ljedrz:misc_capacity, r=estebank

Calculate the exact capacity for 2 HashMaps

6 years agoRollup merge of #52306 - ljedrz:obligation_forest_clone, r=varkor
kennytm [Mon, 16 Jul 2018 18:18:15 +0000 (02:18 +0800)]
Rollup merge of #52306 - ljedrz:obligation_forest_clone, r=varkor

Reduce the number of clone()s needed in obligation_forest

Some can be avoided by using `remove_entry` instead of `remove`.

6 years agoRollup merge of #52286 - ljedrz:dyn_librustc_errors, r=varkor
kennytm [Mon, 16 Jul 2018 18:17:53 +0000 (02:17 +0800)]
Rollup merge of #52286 - ljedrz:dyn_librustc_errors, r=varkor

Deny bare trait objects in src/librustc_errors

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

6 years agoRollup merge of #52430 - RalfJung:nomicon, r=kennytm
kennytm [Mon, 16 Jul 2018 15:11:35 +0000 (23:11 +0800)]
Rollup merge of #52430 - RalfJung:nomicon, r=kennytm

update nomicon

Will this trigger a website update automatically or is that a separate step?

6 years agoupdate miri
Ralf Jung [Tue, 17 Jul 2018 07:13:47 +0000 (09:13 +0200)]
update miri

6 years agoupdate miri (Windows tests fixed)
Ralf Jung [Mon, 16 Jul 2018 10:06:26 +0000 (12:06 +0200)]
update miri (Windows tests fixed)

6 years agoupdate miri
Ralf Jung [Fri, 13 Jul 2018 08:34:50 +0000 (10:34 +0200)]
update miri

6 years agoAuto merge of #52409 - estebank:move-cfail-ui, r=oli-obk
bors [Tue, 17 Jul 2018 06:52:20 +0000 (06:52 +0000)]
Auto merge of #52409 - estebank:move-cfail-ui, r=oli-obk

Move some `compile-fail` tests to `ui`

Re: #44844.

6 years agoReturn tests that have platform dependant output
Esteban Küber [Mon, 16 Jul 2018 21:11:37 +0000 (14:11 -0700)]
Return tests that have platform dependant output

6 years agoAuto merge of #52285 - ljedrz:dyn_librustc_driver, r=nikomatsakis
bors [Tue, 17 Jul 2018 02:50:14 +0000 (02:50 +0000)]
Auto merge of #52285 - ljedrz:dyn_librustc_driver, r=nikomatsakis

Deny bare trait objects in librustc_driver

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

6 years agoAuto merge of #52448 - Manishearth:clippyup, r=Mark-Simulacrum
bors [Tue, 17 Jul 2018 00:10:17 +0000 (00:10 +0000)]
Auto merge of #52448 - Manishearth:clippyup, r=Mark-Simulacrum

Update clippy

Fixes test failures caused by https://github.com/rust-lang/rust/pull/52081

6 years agoUpdate clippy
Manish Goregaokar [Mon, 16 Jul 2018 23:30:15 +0000 (16:30 -0700)]
Update clippy

Fixes test failures caused by https://github.com/rust-lang/rust/pull/52081

6 years agoAuto merge of #52081 - alexcrichton:proc-macro-stable, r=petrochenkov
bors [Mon, 16 Jul 2018 20:54:47 +0000 (20:54 +0000)]
Auto merge of #52081 - alexcrichton:proc-macro-stable, r=petrochenkov

rustc: Stabilize the `proc_macro` feature

This commit stabilizes some of the `proc_macro` language feature as well as a
number of APIs in the `proc_macro` crate as [previously discussed][1]. This
means that on stable Rust you can now define custom procedural macros which
operate as attributes attached to items or `macro_rules!`-like bang-style
invocations. This extends the suite of currently stable procedural macros,
custom derives, with custom attributes and custom bang macros.

Note though that despite the stabilization in this commit procedural macros are
still not usable on stable Rust. To stabilize that we'll need to stabilize at
least part of the `use_extern_macros` feature. Currently you can define a
procedural macro attribute but you can't import it to call it!

A summary of the changes made in this PR (as well as the various consequences)
is:

* The `proc_macro` language and library features are now stable.
* Other APIs not stabilized in the `proc_macro` crate are now named under a
  different feature, such as `proc_macro_diagnostic` or `proc_macro_span`.
* A few checks in resolution for `proc_macro` being enabled have switched over
  to `use_extern_macros` being enabled. This means that code using
  `#![feature(proc_macro)]` today will likely need to move to
  `#![feature(use_extern_macros)]`.

It's intended that this PR, once landed, will be followed up with an attempt to
stabilize a small slice of `use_extern_macros` just for procedural macros to
make this feature 100% usable on stable.

[1]: https://internals.rust-lang.org/t/help-stabilize-a-subset-of-macros-2-0/7252

6 years agoRollup merge of #52392 - heycam:patch-1, r=steveklabnik
kennytm [Mon, 16 Jul 2018 15:11:32 +0000 (23:11 +0800)]
Rollup merge of #52392 - heycam:patch-1, r=steveklabnik

AsRef doc wording tweaks

6 years agoCalculate the exact capacity for 2 HashMaps
ljedrz [Mon, 16 Jul 2018 14:01:29 +0000 (16:01 +0200)]
Calculate the exact capacity for 2 HashMaps

6 years agoEnable incremental independent of stage
Mark Rousskov [Mon, 16 Jul 2018 15:22:15 +0000 (09:22 -0600)]
Enable incremental independent of stage

Previously we'd only do so for stage 0 but with keep-stage
improvements it seems likely that we'll see more developers working in
the stage 1, so we should allow enabling incremental for them.

Ideally, the check we probably want is to only enable incremental for
the last compiler build scheduled, but there's no good way to do so
today. Just enabling incremental in all stages should be sufficient;
we may be doing extra work that's needles -- compiling incrementally
something that will never be recompiled in-place -- but that should be
sufficiently unlikely (i.e., users either don't care or won't be
compiling the compiler twice).

6 years agoRollup merge of #52285 - ljedrz:dyn_librustc_driver, r=nikomatsakis
kennytm [Mon, 16 Jul 2018 15:11:30 +0000 (23:11 +0800)]
Rollup merge of #52285 - ljedrz:dyn_librustc_driver, r=nikomatsakis

Deny bare trait objects in librustc_driver

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

6 years agorustc: Stabilize much of the `proc_macro` feature
Alex Crichton [Tue, 3 Jul 2018 22:36:31 +0000 (15:36 -0700)]
rustc: Stabilize much of the `proc_macro` feature

This commit stabilizes some of the `proc_macro` language feature as well as a
number of APIs in the `proc_macro` crate as [previously discussed][1]. This
means that on stable Rust you can now define custom procedural macros which
operate as attributes attached to items or `macro_rules!`-like bang-style
invocations. This extends the suite of currently stable procedural macros,
custom derives, with custom attributes and custom bang macros.

Note though that despite the stabilization in this commit procedural macros are
still not usable on stable Rust. To stabilize that we'll need to stabilize at
least part of the `use_extern_macros` feature. Currently you can define a
procedural macro attribute but you can't import it to call it!

A summary of the changes made in this PR (as well as the various consequences)
is:

* The `proc_macro` language and library features are now stable.
* Other APIs not stabilized in the `proc_macro` crate are now named under a
  different feature, such as `proc_macro_diagnostic` or `proc_macro_span`.
* A few checks in resolution for `proc_macro` being enabled have switched over
  to `use_extern_macros` being enabled. This means that code using
  `#![feature(proc_macro)]` today will likely need to move to
  `#![feature(use_extern_macros)]`.

It's intended that this PR, once landed, will be followed up with an attempt to
stabilize a small slice of `use_extern_macros` just for procedural macros to
make this feature 100% usable on stable.

[1]: https://internals.rust-lang.org/t/help-stabilize-a-subset-of-macros-2-0/7252

6 years agoupdate nomicon
Ralf Jung [Mon, 16 Jul 2018 14:36:32 +0000 (16:36 +0200)]
update nomicon

6 years agoAuto merge of #52264 - csmoe:kind, r=oli-obk
bors [Mon, 16 Jul 2018 14:05:19 +0000 (14:05 +0000)]
Auto merge of #52264 - csmoe:kind, r=oli-obk

Rename spanned HIR node enums from Foo_ to FooKind

Closes https://github.com/rust-lang/rust/issues/51968
r? @oli-obk

6 years agoUpdate the clippy submodule
Oliver Schneider [Mon, 16 Jul 2018 13:09:04 +0000 (15:09 +0200)]
Update the clippy submodule

6 years agoUpdate a debug string
Oliver Schneider [Mon, 16 Jul 2018 12:20:10 +0000 (14:20 +0200)]
Update a debug string

6 years agoFix tidy
csmoe [Thu, 12 Jul 2018 00:20:31 +0000 (08:20 +0800)]
Fix tidy

6 years agoItemKind
csmoe [Wed, 11 Jul 2018 15:36:06 +0000 (23:36 +0800)]
ItemKind

6 years agoForeignItemKind
csmoe [Wed, 11 Jul 2018 14:56:44 +0000 (22:56 +0800)]
ForeignItemKind

6 years agoTyKind
csmoe [Wed, 11 Jul 2018 14:41:03 +0000 (22:41 +0800)]
TyKind

6 years agoExprKind
csmoe [Wed, 11 Jul 2018 12:05:29 +0000 (20:05 +0800)]
ExprKind

6 years agoVariantKind
csmoe [Wed, 11 Jul 2018 11:18:57 +0000 (19:18 +0800)]
VariantKind

6 years agoDeclKind
csmoe [Wed, 11 Jul 2018 10:59:17 +0000 (18:59 +0800)]
DeclKind

6 years agoStmtKind
csmoe [Wed, 11 Jul 2018 10:54:37 +0000 (18:54 +0800)]
StmtKind

6 years agoBinOpKind
csmoe [Wed, 11 Jul 2018 10:44:53 +0000 (18:44 +0800)]
BinOpKind

6 years agoAuto merge of #52422 - michaelwoerister:revert-52266, r=oli-obk
bors [Mon, 16 Jul 2018 09:41:54 +0000 (09:41 +0000)]
Auto merge of #52422 - michaelwoerister:revert-52266, r=oli-obk

Revert #52266

Reverts #52266 until the performance issues with that PR are ironed out.

6 years agoAuto merge of #52395 - zackmdavis:and_the_case_of_the_renamed_lint, r=estebank
bors [Mon, 16 Jul 2018 07:35:49 +0000 (07:35 +0000)]
Auto merge of #52395 - zackmdavis:and_the_case_of_the_renamed_lint, r=estebank

structured suggestion for renamed-and-removed-lints

![lint_renamed](https://user-images.githubusercontent.com/1076988/42730470-f74688dc-87a9-11e8-8dfd-b3e1d70b0af8.png)

r? @estebank

6 years agoRevert "Provide a way of accessing the ThinLTO module import map in rustc."
Michael Woerister [Mon, 16 Jul 2018 06:59:10 +0000 (08:59 +0200)]
Revert "Provide a way of accessing the ThinLTO module import map in rustc."

This reverts commit 9df56ca0eea1a8f5af945df25ce23e276b1d48a7.

6 years agoRevert "Persist ThinLTO import data in incr. comp. session directory."
Michael Woerister [Mon, 16 Jul 2018 06:58:56 +0000 (08:58 +0200)]
Revert "Persist ThinLTO import data in incr. comp. session directory."

This reverts commit 8dc7ddb9763f28b83de7bf3b3025f8042ea9e830.

6 years agoRevert "Clean up CodegenUnit name generation."
Michael Woerister [Mon, 16 Jul 2018 06:58:40 +0000 (08:58 +0200)]
Revert "Clean up CodegenUnit name generation."

This reverts commit 2c5cd9ce53d2d25041db0cb02b40ba460ffa8908.

6 years agoRevert "Clean up LLVM module naming (just use CodegenUnit names)."
Michael Woerister [Mon, 16 Jul 2018 06:58:29 +0000 (08:58 +0200)]
Revert "Clean up LLVM module naming (just use CodegenUnit names)."

This reverts commit f6894ebe664d111259a91a2b5fcc1236ca413436.

6 years agoRevert "Adapt codegen-unit tests to new CGU naming scheme."
Michael Woerister [Mon, 16 Jul 2018 06:58:15 +0000 (08:58 +0200)]
Revert "Adapt codegen-unit tests to new CGU naming scheme."

This reverts commit 94b32adb71a75a3f5b53a39c52c62c2ce1a7cc56.

6 years agoRevert "Fix some run-make tests after object file naming has changed."
Michael Woerister [Mon, 16 Jul 2018 06:58:05 +0000 (08:58 +0200)]
Revert "Fix some run-make tests after object file naming has changed."

This reverts commit dd3f445ed264ffc09ea42bd8d89853242e3a26f4.

6 years agoRevert "Use callback-based interface to load ThinLTO import data into rustc."
Michael Woerister [Mon, 16 Jul 2018 06:57:49 +0000 (08:57 +0200)]
Revert "Use callback-based interface to load ThinLTO import data into rustc."

This reverts commit e045a6cd8c0235a26ef11e6cd9a13ebd817f1265.

6 years agoFix tests
Esteban Küber [Mon, 16 Jul 2018 05:36:05 +0000 (22:36 -0700)]
Fix tests

6 years agoAuto merge of #52386 - Manishearth:quote-clarify, r=petrochenkov
bors [Mon, 16 Jul 2018 04:40:21 +0000 (04:40 +0000)]
Auto merge of #52386 - Manishearth:quote-clarify, r=petrochenkov

Clarify how the quote macro is loaded

@QuietMisdreavus needed to figure this out for writing a testcase, this should be better documented.

r? @jseyfried

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 agoMove some `compile-fail` tests to `ui`
Esteban Küber [Sun, 15 Jul 2018 21:11:54 +0000 (14:11 -0700)]
Move some `compile-fail` tests to `ui`

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 agostructured suggestion for renamed-and-removed-lints
Zack M. Davis [Sun, 15 Jul 2018 03:52:40 +0000 (20:52 -0700)]
structured suggestion for renamed-and-removed-lints

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 agoAsRef doc wording tweaks
Cameron McCormack [Sun, 15 Jul 2018 00:16:36 +0000 (10:16 +1000)]
AsRef doc wording tweaks

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 agoClarify how the quote macro is loaded
Manish Goregaokar [Sat, 14 Jul 2018 19:06:50 +0000 (12:06 -0700)]
Clarify how the quote macro is loaded

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 agoReduce the number of clone()s needed in obligation_forest
ljedrz [Thu, 12 Jul 2018 13:41:24 +0000 (15:41 +0200)]
Reduce the number of clone()s needed in obligation_forest

Some can be avoided by using remove_entry instead of remove.

6 years agoDeny bare trait objects in src/librustc_errors
ljedrz [Thu, 12 Jul 2018 07:33:33 +0000 (09:33 +0200)]
Deny bare trait objects in src/librustc_errors

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

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