Commit Graph

103105 Commits

Author SHA1 Message Date
Guillaume Gomez
5bb70c14be Fix tidy issues 2019-11-27 17:58:54 +01:00
Guillaume Gomez
243fb6f7b2 Put back tidy check on error codes 2019-11-27 17:58:54 +01:00
David Hewitt
a28fbd4608
Correct typo in src/librustc_mir/const_eval.rs
Co-Authored-By: lqd <remy.rakic+github@gmail.com>
2019-11-27 16:44:53 +00:00
Guillaume Gomez
97c427cc5e Use new ErrorKind enum 2019-11-27 14:28:20 +01:00
Eduard-Mihai Burtescu
a0556b3b79 rustc_metadata: use a macro to deduplicate LazyPerDefTables and PerDefTableBuilders. 2019-11-27 15:16:25 +02:00
Eduard-Mihai Burtescu
d7444c122e rustc_metadata: remove Encodable requirements from LazyMeta impls. 2019-11-27 15:16:04 +02:00
Eduard-Mihai Burtescu
ee42979eeb rustc_metadata: use a separate TableBuilder type to build a Table. 2019-11-27 15:15:57 +02:00
Eduard-Mihai Burtescu
67421bdfdf rustc_metadata: replace PerDefTable<T> with Table<DefIndex, T>. 2019-11-27 15:15:57 +02:00
Camille GILLOT
1e12f39d83 Allocate HIR Forest on arena. 2019-11-27 13:32:28 +01:00
Camille GILLOT
e321ba989c Misc renames. 2019-11-27 13:24:19 +01:00
Camille GILLOT
77a4c85e54 Simplify handling of AllArenas. 2019-11-27 13:19:33 +01:00
Guillaume Gomez
d05a914b24 Clean up E0071 long explanation 2019-11-27 13:18:00 +01:00
Guillaume Gomez
97a1653f09 Clean up E0077 long explanation 2019-11-27 13:18:00 +01:00
Guillaume Gomez
843869c690 Clean up E0076 long explanation 2019-11-27 13:18:00 +01:00
Camille GILLOT
e5ed101098 Rename BoxedGlobalCtxt. 2019-11-27 13:17:58 +01:00
bors
04e69e4f42 Auto merge of #66691 - dtolnay:fmt0, r=sfackler
Format libcore with rustfmt

I am interested in whether we can begin cautious incremental progress on #66688 and assess along the way whether we can keep the disruption sufficiently small.

This PR applies rustfmt with default settings to files in src/libcore *that are not involved in any currently open PR* to minimize merge conflicts. The list of files involved in open PRs was determined by querying GitHub's GraphQL API  [with this script](https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8).

With the list of files from the script in `outstanding_files`, the relevant commands were:

```console
$ find src/libcore -name '*.rs' | xargs rustfmt --edition=2018
$ rg libcore outstanding_files | xargs git checkout --
```

Repeating this process several months apart should get us coverage of most of the rest of libcore.
2019-11-27 12:16:52 +00:00
Camille GILLOT
79e232401e Rename lifetimes. 2019-11-27 13:13:57 +01:00
Guillaume Gomez
b91a6fcd5d Replace Iterator::find calls with Iterator::any when better 2019-11-27 13:13:16 +01:00
Guillaume Gomez
4ab8aa3700 Add support for intra-doc link fields of enum variant 2019-11-27 13:13:16 +01:00
Guillaume Gomez
4993807dd9 little intra-doc code cleanup 2019-11-27 13:12:27 +01:00
David Hewitt
539813944d Add memoization for const function evaluations
When a const function is being evaluated, as long as all its
arguments are zero-sized-types (or it has no arguments) then we
can trivially memoize the evaluation result using the existing
query mechanism.
2019-11-27 12:01:04 +00:00
Dylan DPC
ce9b6972c2
Update mod.rs 2019-11-27 10:27:30 +01:00
bors
876a72a251 Auto merge of #66677 - wesleywiser:fix_const_prop_alloc_id_ice, r=oli-obk
[const prop] Fix "alloc id without corresponding allocation" ICE

r? @oli-obk
2019-11-27 08:00:58 +00:00
David Tolnay
166471e7f1
Bless ui tests for libcore reformat 2019-11-26 23:02:11 -08:00
David Tolnay
95e00bfed8
Format libcore with rustfmt
This commit applies rustfmt with default settings to files in
src/libcore *that are not involved in any currently open PR* to minimize
merge conflicts. The list of files involved in open PRs was determined
by querying GitHub's GraphQL API with this script:
https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8

With the list of files from the script in `outstanding_files`, the
relevant commands were:

    $ find src/libcore -name '*.rs' | xargs rustfmt --edition=2018
    $ rg libcore outstanding_files | xargs git checkout --

Repeating this process several months apart should get us coverage of
most of the rest of libcore.
2019-11-26 23:02:11 -08:00
Joshua Nelson
9617d7c887 Combine similar tests for const match
See https://github.com/rust-lang/rust/pull/66788#issuecomment-558799307
for context.
2019-11-27 00:02:04 -05:00
bors
b5f265eeed Auto merge of #66675 - GuillaumeGomez:support-anchors-intra-doc-links, r=kinnison
Support anchors intra doc links

Fixes #62833
Part of #43466.

cc @ollie27
r? @kinnison
2019-11-27 04:51:31 +00:00
Brian Wignall
16fabd8efd Fix spelling typos 2019-11-26 22:19:54 -05:00
Mark Lodato
9dc3f4b05b Fixes small typo in array docs r? @steveklabnik 2019-11-26 21:04:28 -05:00
bors
809e180a76 Auto merge of #66794 - tmandry:rollup-99qrpr0, r=tmandry
Rollup of 14 pull requests

Successful merges:

 - #66128 (alloc: Add new_zeroed() versions like new_uninit().)
 - #66661 (Add riscv64gc-unknown-linux-gnu target)
 - #66663 (Miri: print leak report even without tracing)
 - #66711 (Add hardware floating point features to aarch64-pc-windows-msvc)
 - #66713 (introduce a target to build the kernel of the unikernel HermitCore)
 - #66717 (tidy: Accommodate rustfmt's preferred layout of stability attributes)
 - #66719 (Store pointer width as u32 on Config)
 - #66720 (Move ErrorReported to rustc_errors)
 - #66737 (Error codes cleanup)
 - #66754 (Various tweaks to diagnostic output)
 - #66763 (Minor edit for documentation-tests.md that increases clarity)
 - #66779 (follow the same function order in the trait)
 - #66786 (Add wildcard test for const_if_match)
 - #66788 (Allow `Unreachable` terminators through `min_const_fn` checks)

Failed merges:

r? @ghost
2019-11-27 00:32:30 +00:00
Tyler Mandry
8547ea32db
Rollup merge of #66788 - ecstatic-morse:const-fn-unreachable, r=Centril
Allow `Unreachable` terminators through `min_const_fn` checks

Resolves #66756.

This allows `Unreachable` terminators through the `min_const_fn` checks if `#![feature(const_if_match)]` is enabled. We could probably just allow them with no feature flag, but it seems okay to be conservative here.

r? @oli-obk
2019-11-26 17:56:25 -06:00
Tyler Mandry
7f166e44ff
Rollup merge of #66786 - jyn514:const-if-match-tests, r=Centril
Add wildcard test for const_if_match

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

Many thanks to @Centril for his help getting me started!
2019-11-26 17:56:23 -06:00
Tyler Mandry
84a2d66374
Rollup merge of #66779 - guanqun:reorder-funcs, r=Dylan-DPC
follow the same function order in the trait

With this change, the function order in both traits and implementation matches.

And this fix removes several warnings in IDE.
2019-11-26 17:56:22 -06:00
Tyler Mandry
339d717776
Rollup merge of #66763 - Parth:patch-2, r=steveklabnik
Minor edit for documentation-tests.md that increases clarity
2019-11-26 17:56:20 -06:00
Tyler Mandry
bb6236cd74
Rollup merge of #66754 - estebank:rustdoc-capitalization, r=Dylan-DPC
Various tweaks to diagnostic output
2019-11-26 17:56:19 -06:00
Tyler Mandry
0b3d4a1fa4
Rollup merge of #66737 - GuillaumeGomez:err-codes-cleanup, r=Dylan-DPC
Error codes cleanup

r? @Dylan-DPC
2019-11-26 17:56:17 -06:00
Tyler Mandry
bf25f8ee19
Rollup merge of #66720 - Mark-Simulacrum:error-reported, r=Centril
Move ErrorReported to rustc_errors

The new location is more consistent with what this type is for, though we don't remove it from the old location (via a re-export) to avoid changing the dozens of use sites (~139 at this time).
2019-11-26 17:56:16 -06:00
Tyler Mandry
f178d35ae7
Rollup merge of #66719 - Mark-Simulacrum:int-normalization, r=Centril
Store pointer width as u32 on Config

This removes the dependency on IntTy, UintTy from Session.

It's not obviously a win, but it seems a bit odd to store the AST IntTy/UintTy in Session, rather we store the pointer width as an integer and add normalization methods to IntTy and UintTy.
2019-11-26 17:56:15 -06:00
Tyler Mandry
ac7e604760
Rollup merge of #66717 - dtolnay:tidy, r=Mark-Simulacrum
tidy: Accommodate rustfmt's preferred layout of stability attributes

Previously tidy would require that the `feature = "name_of_feature"` part of the stability attribute was on the same line as the `#[stable(` / `#[unstable(` opening part of the attribute, and that `)]` was on the same line as the last key-value pair.

That didn't work with rustfmt's preferred layout of long attributes, which is like:

```rust
#[unstable(
    feature = "c_variadic",
    reason = "the `c_variadic` feature has not been properly tested on \
              all supported platforms",
    issue = "44930"
)]
```
2019-11-26 17:56:13 -06:00
Tyler Mandry
7ef7005422
Rollup merge of #66713 - hermitcore:hermit, r=alexcrichton
introduce a target to build the kernel of the unikernel HermitCore

We are developing the unikernel HermitCore, where the kernel is written in Rust and is already supported by the Rust Standard Library. To compile the kernel with the new build flag "-Z build-std", we introduce a new target, which avoids the usage of SSE & AVX within the kernel.
2019-11-26 17:56:11 -06:00
Tyler Mandry
9e2802b57b
Rollup merge of #66711 - mattico:aarch-msvc-fp, r=nagisa
Add hardware floating point features to aarch64-pc-windows-msvc

Fixes #66701
2019-11-26 17:56:10 -06:00
Tyler Mandry
a0e756bc79
Rollup merge of #66663 - RalfJung:miri-leaks, r=oli-obk
Miri: print leak report even without tracing

Currently, the rustup-installed Miri has no way to actually print a leak report (as `trace!` is compiled out). Make it print that per default instead when there is a leak.

r? @oli-obk
2019-11-26 17:56:08 -06:00
Tyler Mandry
a49f23e05d
Rollup merge of #66661 - msizanoen1:riscv-gnu, r=alexcrichton
Add riscv64gc-unknown-linux-gnu target

This PR add the target, but doesn't build std on CI yet.
I have a port for `libc` crate and std which I will upstream soon after this target is added.

r? @alexcrichton
2019-11-26 17:56:07 -06:00
Tyler Mandry
941d915942
Rollup merge of #66128 - emilio:new-zeroed, r=SimonSapin
alloc: Add new_zeroed() versions like new_uninit().

MaybeUninit has both uninit() and zeroed(), it seems reasonable to have the same
surface on Box/Rc/Arc.

Needs tests.

cc #63291
2019-11-26 17:56:05 -06:00
Matthew Jasper
1f850f61ea Record temporary static references in generator witnesses 2019-11-26 23:18:41 +00:00
Camille GILLOT
7e72b36299 Move local Arena to Queries. 2019-11-26 23:16:48 +01:00
Camille GILLOT
7b71e9a9df Formatting. 2019-11-26 22:57:02 +01:00
Camille GILLOT
b99513be57 Have Queries own the GlobalCtxt.
The construction of the GlobalCtxt is moved from a generator's stack to
the Queries struct.  Since the GlobalCtxt requires the HIR Forest and the
arenas to live longer, those are moved into Queries the same way.

The resulting handling of objects is more brittle, because consumers of
the Once objects need to be careful of their initialisation.
2019-11-26 22:51:02 +01:00
Camille GILLOT
58a9c73bbd Make the HIR map own the Definitions. 2019-11-26 22:48:41 +01:00
Taylor Cramer
2083e2a647 Stabilize nested self receivers
Previously, only Self, &Self, &mut Self, Arc<Self>, Rc<Self>,
and Box<Self> were available as stable method receivers.

This commit stabilizes nested uses of all the above types.
However, nested receivers remain non-object-safe.
2019-11-26 13:35:33 -08:00