Commit Graph

133394 Commits

Author SHA1 Message Date
Camelid
614a748b9c Highlight MIR as Rust on GitHub 2020-11-17 14:16:18 -08:00
bors
c919f490bb Auto merge of #79138 - m-ou-se:rollup-owel5ld, r=m-ou-se
Rollup of 8 pull requests

Successful merges:

 - #74293 (Rustdoc test compiler output color)
 - #78702 ([self-profiling] Include the estimated size of each cgu in the profile)
 - #79069 (Get rid of `highlight::Class::None`)
 - #79072 (Fix exhaustiveness in case a byte string literal is used at slice type)
 - #79120 (update rustfmt to v1.4.27)
 - #79125 (Get rid of clean::{Method, TyMethod})
 - #79126 (Remove duplicate `Trait::auto` field)
 - #79130 (extend macro braces test)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2020-11-17 15:27:29 +00:00
Mara Bos
f698505177
Rollup merge of #79130 - lcnr:extend-tes, r=varkor
extend macro braces test

r? `@varkor`
2020-11-17 16:14:00 +01:00
Mara Bos
ca38bd4230
Rollup merge of #79126 - jyn514:auto, r=GuillaumeGomez
Remove duplicate `Trait::auto` field

It was exactly the same as `is_auto`.

I found this while working on #78082, but it's not required for that PR.

r? `@GuillaumeGomez`
2020-11-17 16:13:58 +01:00
Mara Bos
3d63f25edf
Rollup merge of #79125 - jyn514:fewer-types, r=GuillaumeGomez
Get rid of clean::{Method, TyMethod}

They're redundant and almost the same as `clean::Function`.

I needed this for https://github.com/rust-lang/rust/pull/78082, although I forget why.

r? `@GuillaumeGomez`
2020-11-17 16:13:57 +01:00
Mara Bos
53ddb73fd3
Rollup merge of #79120 - calebcartwright:update-rustfmt, r=Mark-Simulacrum
update rustfmt to v1.4.27

Fixes https://github.com/rust-lang/rustfmt/issues/4528
2020-11-17 16:13:55 +01:00
Mara Bos
b6f52410bb
Rollup merge of #79072 - oli-obk:byte_str_pat, r=estebank
Fix exhaustiveness in case a byte string literal is used at slice type

fixes #79048
2020-11-17 16:13:53 +01:00
Mara Bos
dda479815a
Rollup merge of #79069 - jyn514:class-none, r=GuillaumeGomez
Get rid of `highlight::Class::None`

This is mostly me learning the codebase for https://github.com/rust-lang/rust/pull/77939, so feel free to close the PR.
It does have the small benefit that we statically know rustdoc isn't generating useless `span`s, though.

r? `@GuillaumeGomez`
cc `@matklad`
2020-11-17 16:13:51 +01:00
Mara Bos
fa45fce0d3
Rollup merge of #78702 - wesleywiser:self_profile_cgu_sizes, r=Mark-Simulacrum
[self-profiling] Include the estimated size of each cgu in the profile

This is helpful when looking for CGUs where the size estimate isn't a
good indicator of compilation time.

I verified that moving the profiling timer call doesn't affect the
results.

Results:

<img width="297" alt="Screen Shot 2020-11-03 at 7 25 04 AM" src="https://user-images.githubusercontent.com/831192/97985503-5901d100-1da6-11eb-9f10-f3e399702952.png">

`measureme` doesn't have support for custom arg names yet so `arg0` is the CGU name and `arg1` is the estimated size.
2020-11-17 16:13:49 +01:00
Mara Bos
81f9feba97
Rollup merge of #74293 - GuillaumeGomez:rustdoc-test-compiler-output-color, r=jyn514
Rustdoc test compiler output color

Fixes #72915

We just need to be sure it doesn't break rustdoc doctests' compilation checks. Maybe some other unforeseen consequences too?

r? `@ehuss`
cc `@rust-lang/rustdoc`
2020-11-17 16:13:46 +01:00
bors
e0ef0fc392 Auto merge of #78779 - LeSeulArtichaut:ty-visitor-return, r=oli-obk
Introduce `TypeVisitor::BreakTy`

Implements MCP rust-lang/compiler-team#383.
r? `@ghost`
cc `@lcnr` `@oli-obk`

~~Blocked on FCP in rust-lang/compiler-team#383.~~
2020-11-17 12:24:34 +00:00
Guillaume Gomez
ec10824e2d Remove unused import 2020-11-17 10:33:14 +01:00
Guillaume Gomez
63785c839d Add comment explaining why we can't split on error[{}]: because of the color escape characters 2020-11-17 10:33:14 +01:00
Guillaume Gomez
95ee1fc7ea Correctly detect color support 2020-11-17 10:33:14 +01:00
Guillaume Gomez
fd4a33cbbe Update doctest tests 2020-11-17 10:33:14 +01:00
Guillaume Gomez
32d64edcf9 Simplfy color availability check 2020-11-17 10:33:14 +01:00
Guillaume Gomez
704001b929 Update lock file 2020-11-17 10:32:48 +01:00
Guillaume Gomez
57bab5e020 Add check to get windows console type to decide to use colors or not 2020-11-17 10:32:48 +01:00
Guillaume Gomez
54e8216348 Update error code detection in compile_fail doctests 2020-11-17 10:32:48 +01:00
Guillaume Gomez
96a6a5fec1 Add color in rustdoc --test output 2020-11-17 10:32:48 +01:00
bors
efcb3b3920 Auto merge of #79128 - m-ou-se:rollup-lzz1dym, r=m-ou-se
Rollup of 9 pull requests

Successful merges:

 - #77939 (Ensure that the source code display is working with DOS backline)
 - #78138 (Upgrade dlmalloc to version 0.2)
 - #78967 (Make codegen tests compatible with extra inlining)
 - #79027 (Limit storage duration of inlined always live locals)
 - #79077 (document that __rust_alloc is also magic to our LLVM fork)
 - #79088 (clarify `span_label` documentation)
 - #79097 (Code block invalid html tag lint)
 - #79105 (std: Fix test `symlink_hard_link` on Windows)
 - #79107 (build-manifest: strip newline from rustc version)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2020-11-17 09:19:55 +00:00
Bastian Kauschke
5f2a627f89 extend macro braces test 2020-11-17 10:18:27 +01:00
oli
a1cdf722f4 Fix exhaustiveness in case a byte string literal is used at slice type 2020-11-17 09:07:23 +00:00
Mara Bos
d6c5c5217f
Rollup merge of #79107 - pietroalbini:build-manifest-newline, r=Mark-Simulacrum
build-manifest: strip newline from rustc version

Backport of https://github.com/rust-lang/rust/pull/79096 on the master branch. This will also need to be included in the beta bump tomorrow.

r? `@Mark-Simulacrum`
`@rustbot` modify labels: beta-nominated beta-accepted T-infra
2020-11-17 10:06:31 +01:00
Mara Bos
a207801551
Rollup merge of #79105 - petrochenkov:winlink, r=shepmaster
std: Fix test `symlink_hard_link` on Windows

The test was introduced in https://github.com/rust-lang/rust/pull/78026 and fails depending on Windows version and admin rights.
Other similar tests check for symlink creation permissions before doing anything, this PR performs the same check for `symlink_hard_link` as well.
2020-11-17 10:06:29 +01:00
Mara Bos
c4abdcf0ac
Rollup merge of #79097 - GuillaumeGomez:code-block-invalid-html-tag-lint, r=jyn514
Code block invalid html tag lint

Fixes #79095

r? ``@jyn514``
2020-11-17 10:06:27 +01:00
Mara Bos
c459ab3a0f
Rollup merge of #79088 - euclio:span-label-doc, r=estebank
clarify `span_label` documentation

Fixes #71857.

r? ``@estebank``

cc ``@RalfJung``
2020-11-17 10:06:25 +01:00
Mara Bos
70a4e433b1
Rollup merge of #79077 - RalfJung:llvm-magic, r=Mark-Simulacrum
document that __rust_alloc is also magic to our LLVM fork

Based on [comments](https://github.com/rust-lang/rust/pull/79045#discussion_r523442198) by ````@tmiasko```` and ````@bjorn3.````
2020-11-17 10:06:23 +01:00
Mara Bos
336dc18aa3
Rollup merge of #79027 - tmiasko:inline-always-live-locals, r=oli-obk
Limit storage duration of inlined always live locals

Closes #76375.
2020-11-17 10:06:21 +01:00
Mara Bos
f960f2847f
Rollup merge of #78967 - tmiasko:codegen-tests, r=cuviper
Make codegen tests compatible with extra inlining
2020-11-17 10:06:19 +01:00
Mara Bos
d6da5254a0
Rollup merge of #78138 - fortanix:raoul/dlmalloc0.2, r=Mark-Simulacrum
Upgrade dlmalloc to version 0.2

In preparation of adding dynamic memory management support for SGXv2-enabled platforms, the dlmalloc crate has been refactored. More specifically, support has been added to implement platform specification outside of the dlmalloc crate. (see https://github.com/alexcrichton/dlmalloc-rs/pull/15)

This PR upgrades dlmalloc to version 0.2 for the `wasm` and `sgx` targets.

As the dlmalloc changes have received a positive review, but have not been merged yet, this PR contains a commit to prevent tidy from aborting CI prematurely.

cc: `@jethrogb`
2020-11-17 10:06:16 +01:00
Mara Bos
cf349567e4
Rollup merge of #77939 - GuillaumeGomez:fix-source-code-dos-backline, r=jyn514
Ensure that the source code display is working with DOS backline

Fixes #76361.

cc ````@lzutao````
r? ````@jyn514````
2020-11-17 10:06:13 +01:00
bors
54508a26eb Auto merge of #78924 - bjorn3:less_sysroot_build_scripts, r=Mark-Simulacrum
Make the libstd build script smaller

Of all sysroot crates currently only compiler_builtins, miniz_oxide and std require a build script. compiler_builtins uses to conditionally enable certain features and possibly compile a C version ([source](63ccaf11f0/build.rs)), miniz_oxide only uses it to detect if liballoc is supported as the MSRV is 1.34.0 instead of the 1.36.0 which stabilized liballoc ([source](28514ec09f/miniz_oxide/build.rs)). std now only uses it to enable `freebsd12` when the `RUST_STD_FREEBSD_12_ABI` env var is set, to determine if `restricted-std` should be set, to set the `STD_ENV_ARCH` env var identical to `CARGO_CFG_TARGET_ARCH`, and to unconditionally enable `backtrace_in_libstd`.

If all build scripts were to be removed, it would be possible for rustc to completely compile it's own sysroot. It currently requires a rustc version that already has an available libstd to compile the build scripts. If rustc can completely compile it's own sysroot, rustbuild could be simplified to not forcefully use the bootstrap compiler for build scripts.

`@rustbot` modify labels: +T-compiler +libs-impl
2020-11-17 06:37:59 +00:00
Joshua Nelson
5903163893 Remove duplicate Trait::auto field
It was exactly the same as `is_auto`.
2020-11-17 00:34:38 -05:00
Joshua Nelson
2a991e18ac Get rid of clean::Method
Replace it instead with `(clean::Function, Option<hir::Defaultness>)`.
2020-11-16 23:20:59 -05:00
bors
b5c37e86ff Auto merge of #78801 - sexxi-goose:min_capture, r=nikomatsakis
RFC-2229: Implement Precise Capture Analysis

### This PR introduces
- Feature gate for RFC-2229 (incomplete) `capture_disjoint_field`
- Rustc Attribute to print out the capture analysis `rustc_capture_analysis`
- Precise capture analysis

### Description of the analysis
1. If the feature gate is not set then all variables that are not local to the closure will be added to the list of captures. (This is for backcompat)
2. The rest of the analysis is based entirely on how the captured `Place`s are used within the closure. Precise information (i.e. projections) about the `Place` is maintained throughout.
3. To reduce the amount of information we need to keep track of, we do a minimization step. In this step, we determine a list such that no Place within this list represents an ancestor path to another entry in the list.  Check rust-lang/project-rfc-2229#9 for more detailed examples.
4. To keep the compiler functional as before we implement a Bridge between the results of this new analysis to existing data structures used for closure captures. Note the new capture analysis results are only part of MaybeTypeckTables that is the information is only available during typeck-ing.

### Known issues
- Statements like `let _ = x` will make the compiler ICE when used within a closure with the feature enabled. More generally speaking the issue is caused by `let` statements that create no bindings and are init'ed using a Place expression.

### Testing
We removed the code that would handle the case where the feature gate is not set, to enable the feature as default and did a bors try and perf run. More information here: #78762

### Thanks
This has been slowly in the works for a while now.
I want to call out `@Azhng` `@ChrisPardy` `@null-sleep` `@jenniferwills` `@logmosier` `@roxelo` for working on this and the previous PRs that led up to this, `@nikomatsakis` for guiding us.

Closes rust-lang/project-rfc-2229#7
Closes rust-lang/project-rfc-2229#9
Closes rust-lang/project-rfc-2229#6
Closes rust-lang/project-rfc-2229#19

r? `@nikomatsakis`
2020-11-17 03:56:03 +00:00
Joshua Nelson
b3f9795cbb Get rid of clean::TyMethod
It's the same as clean::Function.
2020-11-16 22:53:10 -05:00
Caleb Cartwright
74d54660c1 update rustfmt to v1.4.27 2020-11-16 19:30:21 -06:00
bors
9b2b02a840 Auto merge of #78313 - lcnr:somebody-fold-me, r=nikomatsakis
TypeFoldable: take self by value

Implements https://github.com/rust-lang/compiler-team/issues/371 which is currently still in FCP.

r? `@nikomatsakis`
2020-11-17 01:14:54 +00:00
Andy Russell
a78966df83
clarify span_label documentation 2020-11-16 18:05:45 -05:00
bors
c6a6105bcc Auto merge of #79104 - m-ou-se:rollup-v74492y, r=m-ou-se
Rollup of 11 pull requests

Successful merges:

 - #74989 (Implement `Index` and `IndexMut` for arrays)
 - #76339 (Test structural matching for all range types)
 - #77691 (Rename/Deprecate LayoutErr in favor of LayoutError)
 - #78364 (Update RELEASES.md for 1.48.0)
 - #78678 (Add tests and improve rendering of cfgs on traits)
 - #78714 (Simplify output capturing)
 - #78769 (Remove unneeded lifetimes in array/mod.rs)
 - #78903 (BTreeMap: test chaotic ordering & other bits & bobs)
 - #79032 (improve type const mismatch errors)
 - #79061 (Make all rustdoc functions and structs crate-private)
 - #79087 (Update E0744 about control flow in `const` contexts to accurately describe when the error is triggered and why)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2020-11-16 22:32:40 +00:00
Bastian Kauschke
7f45668af6 update cg_clif 2020-11-16 22:42:09 +01:00
lcnr
a6cbd64dae words 2020-11-16 22:42:09 +01:00
Bastian Kauschke
80acfea5a7 clippy: fold by value 2020-11-16 22:42:09 +01:00
Bastian Kauschke
2bf93bd852 compiler: fold by value 2020-11-16 22:34:57 +01:00
Bastian Kauschke
3ec6720bf1 add IdFunctor to rustc_data_structures 2020-11-16 22:27:20 +01:00
Pietro Albini
32d3146ea6
build-manifest: strip newline from rustc version 2020-11-16 19:26:03 +01:00
Vadim Petrochenkov
a5bc780b50 std: Fix test got_symlink_permission on Windows 2020-11-16 21:09:26 +03:00
Mara Bos
e6b6c8e4fc
Rollup merge of #79087 - ThePuzzlemaker:issue-79083-docfix, r=RalfJung
Update E0744 about control flow in `const` contexts to accurately describe when the error is triggered and why

This PR fixes #79083. `const fn` currently supports `if`, `match`, `loop`, and `while` in terms of control flow. The error relating to control flow in `const` contexts currently states that those control flow constructs are not allowed in `const` contexts. That is no longer true, as RFC 2342 and 2344 were [stabilized](https://github.com/rust-lang/rust/pull/72437). `for` loops, however, as well as `?` and `.await` are still not allowed, so I changed the error message to be more descriptive of the error as it is not just control flow that could trigger this error. I also added links to tracking issues that mark things that are blocking the usage of these expressions.
2020-11-16 17:26:38 +01:00
Mara Bos
c3da682249
Rollup merge of #79061 - jyn514:no-pub, r=GuillaumeGomez
Make all rustdoc functions and structs crate-private

This gives warnings when code is no longer used, which will be helpful when https://github.com/rust-lang/rust/pull/77820 and https://github.com/rust-lang/rust/pull/78082 land.

AFAIK no one is using this API.

r? ``@GuillaumeGomez``
cc ``@rust-lang/rustdoc``
2020-11-16 17:26:36 +01:00