Commit Graph

100322 Commits

Author SHA1 Message Date
Charles Lew
3462b58f21 Add support for parsing #[link_ordinal] attribute. 2019-10-07 12:01:55 +08:00
Charles Lew
e70ffed9cd Add feature gate for raw_dylib. 2019-10-07 12:01:54 +08:00
Mazdak Farrokhzad
a7ba754b6c syntax: unify and simplify fn signature parsing. 2019-10-07 06:01:38 +02:00
Mazdak Farrokhzad
7f9638d5d4 syntax: unify trait parsing a bit. 2019-10-07 06:01:38 +02:00
Mazdak Farrokhzad
090f3fd0c9 syntax: further item parsing cleanup 2019-10-07 06:01:38 +02:00
Mazdak Farrokhzad
3bdbfbe8b9 syntax: de-dups in item parsing. 2019-10-07 05:59:56 +02:00
Mazdak Farrokhzad
e0fe4be465 syntax: cleanup associated const parsing. 2019-10-07 05:59:56 +02:00
Nicholas Nethercote
9267d9fe5b Remove force_ex!. 2019-10-07 11:59:28 +11:00
bors
4ac4809ccf Auto merge of #64906 - Aaron1011:feature/extern-const-fn, r=Centril
Add support for `const unsafe? extern fn`

This works just as you might expect - an `const extern fn` is a `const fn` that is callable from foreign code.

Currently, panicking is not allowed in `const`s. When https://github.com/rust-lang/rfcs/pull/2345 (https://github.com/rust-lang/rust/issues/51999) is stabilized, then panicking in an `const extern fn` will produce a compile-time error when invoked at compile time, and an abort when invoked at runtime.

Since this is extending the language (we're allowing the `const` keyword in a new context), I believe that this will need an FCP. However, it's a very minor change, so I didn't think that filing an RFC was necessary.

This will allow libc (and other FFI crates) to make many functions `const`, without having to give up on making them `extern` as well.

Tracking issue: https://github.com/rust-lang/rust/issues/64926.
2019-10-07 00:12:12 +00:00
Nicholas Nethercote
1183d60cd5 Remove def_id!. 2019-10-07 09:35:47 +11:00
Nicholas Nethercote
8f707c3a98 Remove krate!. 2019-10-07 09:35:47 +11:00
Nicholas Nethercote
90c456e732 Remove force!. 2019-10-07 09:35:47 +11:00
Andreas Jonson
50932ea1da add more info in debug traces for gcu merging 2019-10-06 23:58:07 +02:00
Tyler Mandry
8baf7bf33d Update reference
- 771c5d10cf944bf7d221f5d6cb7abd2a06c400e4 Add macros in extern blocks and new proc-macro support.
- 8caabd62ef5fbe99e6be6aa9e76f55bbb8433d95 Update for "modern" `meta` matcher.
- 1b44947d36ccf7eba2b3bd245769eff68abf6d4d Update await desugaring after rust-lang/rust#64292
2019-10-06 14:45:02 -07:00
bors
09868a56c9 Auto merge of #65169 - tmandry:rollup-qxjj8xp, r=tmandry
Rollup of 5 pull requests

Successful merges:

 - #65095 (Sort error codes in librustc_passes)
 - #65101 (Upgrade librustc_macros dependencies)
 - #65142 (Ensure that associated `async fn`s have unique fresh param names)
 - #65155 (Use shorthand initialization in rustdoc)
 - #65158 (Remove dead module)

Failed merges:

r? @ghost
2019-10-06 20:24:37 +00:00
Andrew Banchich
b7091e4f52 rewrite documentation for unimplemented! 2019-10-06 15:58:34 -04:00
Guillaume Gomez
57cb8819ee Update ui tests 2019-10-06 21:00:40 +02:00
Tyler Mandry
dd04a83918
Rollup merge of #65158 - ishitatsuyuki:remove-dead, r=Mark-Simulacrum
Remove dead module

This module is not referenced any more. (A quick audit didn't show other stale files like this, so presumably this is the only one.)
2019-10-06 11:42:00 -07:00
Tyler Mandry
c071083732
Rollup merge of #65155 - Avi-D-coder:fix-lints, r=Mark-Simulacrum
Use shorthand initialization in rustdoc

This just fixes a few lints I rust-analyzer was showing. Is this sort of PR useful? Should the lints be fixed as apart of the otherwise unrelated PR I was working on?
2019-10-06 11:41:59 -07:00
Tyler Mandry
c4bbc6dc3f
Rollup merge of #65142 - matthewjasper:unshadow-anon-lifetimes, r=petrochenkov
Ensure that associated `async fn`s have unique fresh param names

Closes #64630
2019-10-06 11:41:57 -07:00
Tyler Mandry
c457b6fcbf
Rollup merge of #65101 - mati865:rustc_macro-deps, r=nikomatsakis
Upgrade librustc_macros dependencies

Passed tests on Linux.
2019-10-06 11:41:56 -07:00
Tyler Mandry
867d876eb0
Rollup merge of #65095 - GuillaumeGomez:sort-librustc_passes-err-codes, r=varkor
Sort error codes in librustc_passes

This is just a little cleanup.
2019-10-06 11:41:54 -07:00
bors
421bd77f42 Auto merge of #64564 - jonas-schievink:cowardly-default, r=nikomatsakis
Deny specializing items not in the parent impl

Part of https://github.com/rust-lang/rust/issues/29661 (https://github.com/rust-lang/rfcs/pull/2532). At least sort of?

This was discussed in https://github.com/rust-lang/rust/pull/61812#discussion_r300504114 and is needed for that PR to make progress (fixing an unsoundness).

One annoyance with doing this is that it sometimes requires users to copy-paste a provided trait method into an impl just to mark it `default` (ie. there is no syntax to forward this impl method to the provided trait method).

cc @Centril and @arielb1
2019-10-06 16:32:46 +00:00
csmoe
dd2356fe7d add testcase for generator move suggestion 2019-10-06 14:07:23 +00:00
Guillaume Gomez
c5e0d6e4d4 Add long error explanation for E0566 2019-10-06 15:23:33 +02:00
bors
9203ee7b56 Auto merge of #65089 - nnethercote:optimize-integral-pattern-matching, r=Mark-Simulacrum
Optimize integral pattern matching

Various improvements to integral pattern matching. Together they reduce instruction counts for `unicode_normalization-check-clean` by about 16%.

r? @Mark-Simulacrum
2019-10-06 12:50:47 +00:00
Mark Rousskov
4c32d475a8 Remove loaded_from_cache map from DepGraph
It's now unused, even with -Zquery-dep-graph
2019-10-06 08:38:23 -04:00
Guillaume Gomez
65a7611b63 sort error codes in librustc_passes 2019-10-06 14:18:41 +02:00
wangxiangqing
bbb69d1455 Suggest dereferencing boolean reference when used in 'if' or 'while'
Change-Id: I0c5c4d767be2647e6f017ae7bf83558c56dbca97
2019-10-06 18:58:33 +08:00
wangxiangqing
8a164acf58 Suggest dereferencing boolean reference when used in 'if' or 'while'
Change-Id: I0c5c4d767be2647e6f017ae7bf83558c56dbca97
2019-10-06 17:12:31 +08:00
bors
0358617e3f Auto merge of #65043 - Aaron1011:fix/reexport-determinism, r=petrochenkov
Make re-export collection deterministic

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

Previously, we were using an `FxHashMap` to collect module re-exports.
However, re-exports end up getting serialized into crate metadata, which
means that metadata generation was non-deterministic. This resulted in
spurious error messages changes (e.g. PR #64906) due to pretty-printing
implicitly depending on the order of re-exports when computing the
proper path to show to the user.

See #65042 for a long-term strategy to detect this kind of issue
2019-10-06 08:40:43 +00:00
Avi Dessauer
c087111345 Use shorthand initialization in rustdoc 2019-10-06 03:42:53 -04:00
ben
5880ce3968 Fix const arguments not displaying in types mismatch diagnostic. 2019-10-06 19:56:05 +13:00
bors
5a8fb7c24d Auto merge of #65152 - tmandry:rollup-btn4a01, r=tmandry
Rollup of 18 pull requests

This contains changes from all the successful runs that bors marked as timed out, plus a revert of #63649 which appears to be the immediate cause of the timeouts.

Successful merges:

 - #64708 (Stabilize `Option::as_deref` and `Option::as_deref_mut`)
 - #64728 (Stabilize UdpSocket::peer_addr)
 - #64765 (std: Reduce checks for `feature = "backtrace"`)
 - #64909 (When encountering chained operators use heuristics to recover from bad turbofish)
 - #65011 (Do not ICE when dereferencing non-Copy raw pointer)
 - #65064 (permit asyncawait-ondeck to be added by anyone)
 - #65066 ([const-prop] Fix ICE when trying to eval polymorphic promoted MIR)
 - #65100 (Replace GeneratorSubsts with SubstsRef)
 - #65105 (Split out some passes from librustc)
 - #65106 (Allow unused attributes to avoid incremental bug)
 - #65113 (Fix lonely backtick)
 - #65116 (Remove unneeded visit_statement definition)
 - #65118 (Update the documented default of -Z mutable-noalias)
 - #65123 (Account for macro invocation in `let mut $pat` diagnostic.)
 - #65124 (Replace some instances of `as *[const | mut] _` with `.cast()`)
 - #65126 (Fix typo on `now()` comments)
 - #65130 (lint: extern non-exhaustive types are improper)
 - #65151 (Revert #63649 - "Upgrade Emscripten targets to use upstream LLVM backend")

Failed merges:

r? @ghost
2019-10-06 04:59:16 +00:00
Tyler Mandry
69598dc3cf
Rollup merge of #65151 - tmandry:revert-emscripten-upgrade, r=tmandry
Revert #63649 - "Upgrade Emscripten targets to use upstream LLVM backend"

This change caused the runtime of the linux-asmjs builder to nearly double from 2+ hours to about 4 hours, which happens to be the bors timeout. (It made it in barely under 4 hours when it was merged.) This is causing timeouts on all new changes.

This reverts commit 7870050796, reversing
changes made to 2e7244807a.
2019-10-05 21:55:13 -07:00
Tyler Mandry
485f5c953d
Rollup merge of #65130 - davidtwco:rfc-2008-improper-ctypes, r=petrochenkov
lint: extern non-exhaustive types are improper

This PR makes the `improper_ctype` lint trigger for non-exhaustive types when those types aren't defined in the current crate, as per [this comment](https://github.com/rust-lang/rust/issues/44109#issuecomment-537583344).

cc @Centril
2019-10-05 21:55:11 -07:00
Tyler Mandry
d54082e5ad
Rollup merge of #65126 - BO41:time_typo, r=kennytm
Fix typo on `now()` comments

Fix typo, update words, and remove some redundant word.
Also rustfmt on the rest of the file (hope this is okay :)

revival of #61433

r? @kennytm
2019-10-05 21:55:10 -07:00
Tyler Mandry
42caed9bac
Rollup merge of #65124 - memoryruins:castaway, r=petrochenkov
Replace some instances of `as *[const | mut] _` with `.cast()`

While in `codegen_llvm`, noticed some places for the recent `pointer::cast` method.
2019-10-05 21:55:08 -07:00
Tyler Mandry
f5c8e12a7e
Rollup merge of #65123 - Centril:mac-invoc-in-mut-pat, r=estebank
Account for macro invocation in `let mut $pat` diagnostic.

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

r? @estebank
2019-10-05 21:55:07 -07:00
Tyler Mandry
a1eac17e70
Rollup merge of #65118 - cuviper:Zmutable-noalias-default, r=rkruppe
Update the documented default of -Z mutable-noalias

It has been fully disabled by default since #54639.
2019-10-05 21:55:06 -07:00
Tyler Mandry
2f4b47189d
Rollup merge of #65116 - spastorino:remove-unneeded-fn, r=oli-obk
Remove unneeded visit_statement definition

r? @oli-obk
2019-10-05 21:55:04 -07:00
Tyler Mandry
1ac1407fc6
Rollup merge of #65113 - Qwaz:master, r=jonas-schievink
Fix lonely backtick

That backtick won't be sad anymore
2019-10-05 21:55:03 -07:00
Tyler Mandry
f80656cf7c
Rollup merge of #65106 - Mark-Simulacrum:unused-attr-allow, r=Centril
Allow unused attributes to avoid incremental bug

cc #65023

This isn't labeled as fixing that issue because it's not really a fix, just a patch.
2019-10-05 21:55:01 -07:00
Tyler Mandry
2c8cbcca54
Rollup merge of #65105 - Mark-Simulacrum:split-librustc, r=nikomatsakis
Split out some passes from librustc

This is just moving them out to librustc_passes -- I've not measured compile time or run time. I don't expect any significant impact, but this seems prudent regardless.
2019-10-05 21:55:00 -07:00
Tyler Mandry
7739f173eb
Rollup merge of #65100 - csmoe:generator, r=nikomatsakis
Replace GeneratorSubsts with SubstsRef

Closes #42340
r? @nikomatsakis
2019-10-05 21:54:59 -07:00
Tyler Mandry
f14d374d3b
Rollup merge of #65066 - wesleywiser:fix_const_prop_ice_on_polymorphic_promoted_mir, r=oli-obk
[const-prop] Fix ICE when trying to eval polymorphic promoted MIR

Fixes #64908

r? @oli-obk
cc @nikomatsakis @pnkfelix
2019-10-05 21:54:57 -07:00
Tyler Mandry
df471c1176
Rollup merge of #65064 - rust-lang:permit-asyncawait-ondeck-by-anyone, r=nikomatsakis
permit asyncawait-ondeck to be added by anyone

Still debating if this is the right approach

but r? @pietroalbini to check the format
2019-10-05 21:54:56 -07:00
Tyler Mandry
2b225bab13
Rollup merge of #65011 - estebank:ice-o-matic, r=zackmdavis
Do not ICE when dereferencing non-Copy raw pointer

CC #52262. Confirmed to remove the unnecessary ICE, but without a repro case.
2019-10-05 21:54:54 -07:00
Tyler Mandry
c7d7e3730a
Rollup merge of #64909 - estebank:turbofish-reloaded, r=Centril
When encountering chained operators use heuristics to recover from bad turbofish
2019-10-05 21:54:52 -07:00
Tyler Mandry
ae2a720e92
Rollup merge of #64765 - alexcrichton:less-check-backtrace, r=sfackler
std: Reduce checks for `feature = "backtrace"`

This is a stylistic change to libstd to reduce the number of checks of
`feature = "backtrace"` now that we unconditionally depend on the
`backtrace` crate and rely on it having an empty implementation.
otherwise.
2019-10-05 21:54:51 -07:00