]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoPermit standalone generic parameters as const generic arguments in macros
varkor [Wed, 18 Nov 2020 12:49:39 +0000 (12:49 +0000)]
Permit standalone generic parameters as const generic arguments in macros

3 years agoExtract write_srclink to its own method
Nixon Enraght-Moony [Wed, 18 Nov 2020 12:48:54 +0000 (12:48 +0000)]
Extract write_srclink to its own method

3 years agoAuto merge of #79159 - pietroalbini:woops, r=pietroalbini
bors [Wed, 18 Nov 2020 10:39:02 +0000 (10:39 +0000)]
Auto merge of #79159 - pietroalbini:woops, r=pietroalbini

Revert #79132

The beta promotion release was mistakenly landed on master instead of beta. Ugh.

r? `@ghost`
cc `@rust-lang/release`

3 years agochange error for `LayoutErr::SizeOverflow`
Bastian Kauschke [Wed, 18 Nov 2020 09:42:49 +0000 (10:42 +0100)]
change error for `LayoutErr::SizeOverflow`

3 years agoRevert "Auto merge of #79132 - pietroalbini:beta-next, r=Mark-Simulacrum"
Pietro Albini [Wed, 18 Nov 2020 10:18:40 +0000 (11:18 +0100)]
Revert "Auto merge of #79132 - pietroalbini:beta-next, r=Mark-Simulacrum"

This was landed on master instead of beta!

3 years agoBTreeMap: reuse NodeRef as Root, keep BoxedNode for edges only, ban Unique
Stein Somers [Thu, 5 Nov 2020 12:23:11 +0000 (13:23 +0100)]
BTreeMap: reuse NodeRef as Root, keep BoxedNode for edges only, ban Unique

3 years agoAuto merge of #77820 - jyn514:from-inner, r=petrochenkov
bors [Wed, 18 Nov 2020 03:56:18 +0000 (03:56 +0000)]
Auto merge of #77820 - jyn514:from-inner, r=petrochenkov

Add `Item::from_def_id_and_kind` to reduce duplication in rustdoc

This makes it harder to make typos, and also makes it much more clear what's intentionally different rather than a typo (look for `what_rustc_thinks`).

Found this while working on https://github.com/rust-lang/rust/issues/76998, I really didn't want to add `const_visibility` in 20 different places.

r? `@GuillaumeGomez`

3 years agoAllow using `download-ci-llvm` from directories other than the root
Joshua Nelson [Wed, 18 Nov 2020 03:09:08 +0000 (22:09 -0500)]
Allow using `download-ci-llvm` from directories other than the root

Previously, bootstrap.py would attempt to find the LLVM commit from
`src/llvm-project`. However, it assumed it was always being run from the
top-level directory, which isn't always the case.

Before:

```
downloading https://ci-artifacts.rust-lang.org/rustc-builds//rust-dev-nightly-x86_64-unknown-linux-gnu.tar.gz

curl: (22) The requested URL returned error: 404
failed to run: curl -# -y 30 -Y 10 --connect-timeout 30 --retry 3 -Sf -o /tmp/tmppyh4w8 https://ci-artifacts.rust-lang.org/rustc-builds//rust-dev-nightly-x86_64-unknown-linux-gnu.tar.gz
Build completed unsuccessfully in 0:00:02
```

After:

```
downloading https://ci-artifacts.rust-lang.org/rustc-builds/430feb24a46993e5073c1bb1b39da190d83fa2bf/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.gz
 ###################################################################################################################################################################### 100.0%
extracting /home/joshua/rustc/src/bootstrap/build/cache/llvm-430feb24a46993e5073c1bb1b39da190d83fa2bf-False/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.gz
```

3 years agofix handling the default config for profiler and sanitizers
12101111 [Wed, 18 Nov 2020 02:33:07 +0000 (10:33 +0800)]
fix handling the default config for profiler and sanitizers

3 years agoAuto merge of #79132 - pietroalbini:beta-next, r=Mark-Simulacrum
bors [Wed, 18 Nov 2020 01:34:32 +0000 (01:34 +0000)]
Auto merge of #79132 - pietroalbini:beta-next, r=Mark-Simulacrum

Prepare beta 1.49.0

This PR sets everything up for beta 1.49.0, and backports the following PRs to it:

* #79107 - build-manifest: strip newline from rustc version
* #78986 - Avoid installing external LLVM dylibs
* #79074 - Install CI llvm into the library directory
* #78364 - Update RELEASES.md for 1.48.0
* #77939 - Ensure that the source code display is working with DOS backline

r? `@ghost`
cc `@rust-lang/release`

3 years agoFix typo in `std::io::Write` docs
William Chargin [Tue, 17 Nov 2020 23:29:49 +0000 (15:29 -0800)]
Fix typo in `std::io::Write` docs

These referred to a “`Write`er”—extra *e*. Presumably a copy-paste
holdover from “`Read`er”.

Test Plan:
Running ``git grep '`\?[Ww]rite`\?er'`` no longer finds any results.

wchargin-branch: io-write-docs

3 years agoRemove THIR::ExprKind::SelfRef
Aman Arora [Tue, 17 Nov 2020 09:54:10 +0000 (04:54 -0500)]
Remove THIR::ExprKind::SelfRef

ExprKind::SelfRef was used to express accessing `self` in
the desugared Closure/Generator struct when lowering captures in THIR.

Since we handle captures in MIR now, we don't need `ExprKind::Self`.

3 years agoMove capture lowering from THIR to MIR
Aman Arora [Tue, 17 Nov 2020 06:52:14 +0000 (01:52 -0500)]
Move capture lowering from THIR to MIR

This allows us to:
- Handle precise Places captured by a closure directly in MIR. Handling
captures in MIR is easier since we can rely on/ tweak PlaceBuilder to
generate `mir::Place`s that resemble how we store captures (`hir::Place`).
- Allows us to handle `let _ = x` case when feature `capture_disjoint_fields`
is enabled directly in MIR. This is required to be done in MIR since
patterns are desugared in MIR.

3 years agoHighlight MIR as Rust on GitHub
Camelid [Tue, 17 Nov 2020 22:16:18 +0000 (14:16 -0800)]
Highlight MIR as Rust on GitHub

3 years agoIgnore failures of RLS on aarch64 Windows
Mark Rousskov [Tue, 17 Nov 2020 21:00:41 +0000 (16:00 -0500)]
Ignore failures of RLS on aarch64 Windows

3 years agoRemove unnecessary abi import
Rune Tynan [Tue, 17 Nov 2020 20:49:40 +0000 (15:49 -0500)]
Remove unnecessary abi import

3 years agoFix handling of panic calls
Camelid [Tue, 17 Nov 2020 20:16:15 +0000 (12:16 -0800)]
Fix handling of panic calls

This should make Clippy more resilient and will unblock #78343.

This PR is made against rust-lang/rust to avoid the need for a subtree
sync at @flip1995's suggestion in rust-lang/rust-clippy#6310.

3 years agoRemove dead code in rustdoc::doctree
Joshua Nelson [Sat, 14 Nov 2020 23:27:06 +0000 (18:27 -0500)]
Remove dead code in rustdoc::doctree

It was completely unused.

3 years agoAdd `from_def_id_and_kind` reducing duplication in rustdoc
Joshua Nelson [Sun, 15 Nov 2020 19:09:26 +0000 (14:09 -0500)]
Add `from_def_id_and_kind` reducing duplication in rustdoc

- Add `Item::from_hir_id_and_kind` convenience wrapper
- Make name parameter mandatory

  `tcx.opt_item_name` doesn't handle renames, so this is necessary
  for any item that could be renamed, which is almost all of them.

- Override visibilities to be `Inherited` for enum variants

  `tcx.visibility` returns the effective visibility, not the visibility
  that was written in the source code. `pub enum E { A, B }` always has
  public variants `A` and `B`, so there's no sense printing `pub` again.

- Don't duplicate handling of `Visibility::Crate`

  Instead, represent it as just another `Restricted` path.

3 years agoFix broken handling of `MacroDef` in `Map::attrs`
Joshua Nelson [Sun, 15 Nov 2020 13:07:47 +0000 (08:07 -0500)]
Fix broken handling of `MacroDef` in `Map::attrs`

This also uses an exhaustive match to avoid future similar bugs.

3 years agoUse DefPath for clean::Visibility, not clean::Path
Joshua Nelson [Sat, 14 Nov 2020 06:51:05 +0000 (01:51 -0500)]
Use DefPath for clean::Visibility, not clean::Path

Visibility needs much less information than a full path, since modules
can never have generics. This allows constructing a Visibility from only
a DefId.

Note that this means that paths are now normalized to their DefPath.
In other words, `pub(self)` or `pub(super)` now always shows `pub(in
path)` instead of preserving the original text.

3 years agoMove change to check_fn, fix up overloaded-calls-nontuple
Rune Tynan [Tue, 17 Nov 2020 19:42:29 +0000 (14:42 -0500)]
Move change to check_fn, fix up overloaded-calls-nontuple

3 years agoadd trailing_zeros and leading_zeros to non zero types
Andreas Jonson [Tue, 17 Nov 2020 18:29:15 +0000 (19:29 +0100)]
add trailing_zeros and leading_zeros to non zero types

3 years agoUpdate fulldeps test
Mark Rousskov [Wed, 7 Oct 2020 02:36:12 +0000 (22:36 -0400)]
Update fulldeps test

3 years agoAuto merge of #79138 - m-ou-se:rollup-owel5ld, r=m-ou-se
bors [Tue, 17 Nov 2020 15:27:29 +0000 (15:27 +0000)]
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

3 years agoRollup merge of #79130 - lcnr:extend-tes, r=varkor
Mara Bos [Tue, 17 Nov 2020 15:14:00 +0000 (16:14 +0100)]
Rollup merge of #79130 - lcnr:extend-tes, r=varkor

extend macro braces test

r? `@varkor`

3 years agoRollup merge of #79126 - jyn514:auto, r=GuillaumeGomez
Mara Bos [Tue, 17 Nov 2020 15:13:58 +0000 (16:13 +0100)]
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`

3 years agoRollup merge of #79125 - jyn514:fewer-types, r=GuillaumeGomez
Mara Bos [Tue, 17 Nov 2020 15:13:57 +0000 (16:13 +0100)]
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`

3 years agoRollup merge of #79120 - calebcartwright:update-rustfmt, r=Mark-Simulacrum
Mara Bos [Tue, 17 Nov 2020 15:13:55 +0000 (16:13 +0100)]
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

3 years agoRollup merge of #79072 - oli-obk:byte_str_pat, r=estebank
Mara Bos [Tue, 17 Nov 2020 15:13:53 +0000 (16:13 +0100)]
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

3 years agoRollup merge of #79069 - jyn514:class-none, r=GuillaumeGomez
Mara Bos [Tue, 17 Nov 2020 15:13:51 +0000 (16:13 +0100)]
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`

3 years agoRollup merge of #78702 - wesleywiser:self_profile_cgu_sizes, r=Mark-Simulacrum
Mara Bos [Tue, 17 Nov 2020 15:13:49 +0000 (16:13 +0100)]
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.

3 years agoRollup merge of #74293 - GuillaumeGomez:rustdoc-test-compiler-output-color, r=jyn514
Mara Bos [Tue, 17 Nov 2020 15:13:46 +0000 (16:13 +0100)]
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`

3 years agobootstrap: use the same version number for rustc and cargo
Pietro Albini [Tue, 17 Nov 2020 11:52:21 +0000 (12:52 +0100)]
bootstrap: use the same version number for rustc and cargo

Historically the stable tarballs were named after the version number of
the specific tool, instead of the version number of Rust. For example,
both of the following tarballs were part of the same release:

    rustc-1.48.0-x86_64-unknown-linux-gnu.tar.xz
    cargo-0.49.0-x86_64-unknown-linux-gnu.tar.xz

PR #77336 changed the dist code to instead use Rust's version number for
all the tarballs, regardless of the tool they contain:

    rustc-1.48.0-x86_64-unknown-linux-gnu.tar.xz
    cargo-1.48.0-x86_64-unknown-linux-gnu.tar.xz

Because of that there is no need anymore to have a separate `cargo`
field in src/stage0.txt, as the Cargo version will always be the same as
the rustc version. This PR removes the field, simplifying the code and
the maintenance work required while producing releases.

3 years agoFix ui tests for `fn`s with qualifiers in `extern` blocks
ThePuzzlemaker [Sun, 15 Nov 2020 21:34:51 +0000 (15:34 -0600)]
Fix ui tests for `fn`s with qualifiers in `extern` blocks

3 years agoUse `span_suggestion_verbose` instead of `span_suggestion` for `fn` with qualifiers...
ThePuzzlemaker [Sun, 15 Nov 2020 20:36:07 +0000 (14:36 -0600)]
Use `span_suggestion_verbose` instead of `span_suggestion` for `fn` with qualifiers inside an `extern "C"` block

3 years agoAuto merge of #78779 - LeSeulArtichaut:ty-visitor-return, r=oli-obk
bors [Tue, 17 Nov 2020 12:24:34 +0000 (12:24 +0000)]
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.~~

3 years agoAdd test to ensure that no DOS backline (\r\n) doesn't create extra backline in sourc...
Guillaume Gomez [Sun, 15 Nov 2020 19:51:25 +0000 (20:51 +0100)]
Add test to ensure that no DOS backline (\r\n) doesn't create extra backline in source rendering

3 years agoEnsure that the source code display is working with DOS backline
Guillaume Gomez [Wed, 14 Oct 2020 15:02:04 +0000 (17:02 +0200)]
Ensure that the source code display is working with DOS backline

3 years agoUpdate RELEASES.md
XAMPPRocky [Thu, 12 Nov 2020 15:20:22 +0000 (16:20 +0100)]
Update RELEASES.md

3 years agoUpdate RELEASES.md
XAMPPRocky [Thu, 29 Oct 2020 15:28:17 +0000 (16:28 +0100)]
Update RELEASES.md

3 years agoUpdate RELEASES.md
XAMPPRocky [Tue, 27 Oct 2020 12:07:14 +0000 (13:07 +0100)]
Update RELEASES.md

3 years agoUpdate RELEASES.md
XAMPPRocky [Tue, 27 Oct 2020 12:04:05 +0000 (13:04 +0100)]
Update RELEASES.md

3 years agoUpdate RELEASES.md
XAMPPRocky [Tue, 27 Oct 2020 10:00:07 +0000 (11:00 +0100)]
Update RELEASES.md

3 years agoUpdate RELEASES.md
XAMPPRocky [Mon, 26 Oct 2020 10:30:23 +0000 (11:30 +0100)]
Update RELEASES.md

3 years agoUpdate RELEASES.md
XAMPPRocky [Mon, 26 Oct 2020 10:24:31 +0000 (11:24 +0100)]
Update RELEASES.md

3 years agoUpdate RELEASES.md
XAMPPRocky [Mon, 26 Oct 2020 10:23:54 +0000 (11:23 +0100)]
Update RELEASES.md

3 years agoApply suggestions from code review
XAMPPRocky [Mon, 26 Oct 2020 06:11:03 +0000 (07:11 +0100)]
Apply suggestions from code review

Co-authored-by: Camelid <camelidcamel@gmail.com>
Co-authored-by: Mark Rousskov <mark.simulacrum@gmail.com>
3 years agoApply suggestions from code review
XAMPPRocky [Sun, 25 Oct 2020 19:43:44 +0000 (20:43 +0100)]
Apply suggestions from code review

Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com>
3 years agoUpdate RELEASES.md
XAMPPRocky [Sun, 25 Oct 2020 19:43:00 +0000 (20:43 +0100)]
Update RELEASES.md

Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
3 years agoUpdate RELEASES.md
XAMPPRocky [Sun, 25 Oct 2020 17:12:40 +0000 (18:12 +0100)]
Update RELEASES.md

3 years agoUpdate RELEASES.md for 1.48.0
Erin Power [Sun, 25 Oct 2020 17:09:28 +0000 (18:09 +0100)]
Update RELEASES.md for 1.48.0

3 years agoInstall CI llvm into the library directory
Mark Rousskov [Sun, 15 Nov 2020 13:59:53 +0000 (08:59 -0500)]
Install CI llvm into the library directory

3 years agoAvoid installing external LLVM dylibs
Mark Rousskov [Thu, 12 Nov 2020 14:49:45 +0000 (09:49 -0500)]
Avoid installing external LLVM dylibs

If the LLVM was externally provided, then we don't currently copy artifacts into
the sysroot. This is not necessarily the right choice (in particular, it will
require the LLVM dylib to be in the linker's load path at runtime), but the
common use case for external LLVMs is distribution provided LLVMs, and in that
case they're usually in the standard search path (e.g., /usr/lib) and copying
them here is going to cause problems as we may end up with the wrong files and
isn't what distributions want.

This behavior may be revisited in the future though.

3 years agobuild-manifest: strip newline from rustc version
Pietro Albini [Mon, 16 Nov 2020 13:36:49 +0000 (14:36 +0100)]
build-manifest: strip newline from rustc version

3 years agothis is beta 1.49.0
Pietro Albini [Tue, 17 Nov 2020 11:33:49 +0000 (12:33 +0100)]
this is beta 1.49.0

3 years agoEnable AVX512 *epi64 variants by updating stdarch
Mahmut Bulut [Tue, 17 Nov 2020 10:50:52 +0000 (11:50 +0100)]
Enable AVX512 *epi64 variants by updating stdarch

3 years agoRemove unused import
Guillaume Gomez [Sun, 15 Nov 2020 20:06:53 +0000 (21:06 +0100)]
Remove unused import

3 years agoAdd comment explaining why we can't split on `error[{}]: ` because of the color escap...
Guillaume Gomez [Fri, 13 Nov 2020 10:19:39 +0000 (11:19 +0100)]
Add comment explaining why we can't split on `error[{}]: ` because of the color escape characters

3 years agoCorrectly detect color support
Guillaume Gomez [Thu, 12 Nov 2020 21:32:42 +0000 (22:32 +0100)]
Correctly detect color support

3 years agoUpdate doctest tests
Guillaume Gomez [Wed, 11 Nov 2020 19:27:24 +0000 (20:27 +0100)]
Update doctest tests

3 years agoSimplfy color availability check
Guillaume Gomez [Wed, 11 Nov 2020 15:44:02 +0000 (16:44 +0100)]
Simplfy color availability check

3 years agoUpdate lock file
Guillaume Gomez [Thu, 16 Jul 2020 14:46:30 +0000 (16:46 +0200)]
Update lock file

3 years agoAdd check to get windows console type to decide to use colors or not
Guillaume Gomez [Thu, 16 Jul 2020 14:36:25 +0000 (16:36 +0200)]
Add check to get windows console type to decide to use colors or not

3 years agoUpdate error code detection in compile_fail doctests
Guillaume Gomez [Tue, 14 Jul 2020 12:44:12 +0000 (14:44 +0200)]
Update error code detection in compile_fail doctests

3 years agoAdd color in rustdoc --test output
Guillaume Gomez [Mon, 13 Jul 2020 13:34:38 +0000 (15:34 +0200)]
Add color in rustdoc --test output

3 years agoAuto merge of #79128 - m-ou-se:rollup-lzz1dym, r=m-ou-se
bors [Tue, 17 Nov 2020 09:19:55 +0000 (09:19 +0000)]
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

3 years agoextend macro braces test
Bastian Kauschke [Tue, 17 Nov 2020 09:18:27 +0000 (10:18 +0100)]
extend macro braces test

3 years agoFix exhaustiveness in case a byte string literal is used at slice type
oli [Sun, 15 Nov 2020 13:04:30 +0000 (13:04 +0000)]
Fix exhaustiveness in case a byte string literal is used at slice type

3 years agoRollup merge of #79107 - pietroalbini:build-manifest-newline, r=Mark-Simulacrum
Mara Bos [Tue, 17 Nov 2020 09:06:31 +0000 (10:06 +0100)]
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

3 years agoRollup merge of #79105 - petrochenkov:winlink, r=shepmaster
Mara Bos [Tue, 17 Nov 2020 09:06:29 +0000 (10:06 +0100)]
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.

3 years agoRollup merge of #79097 - GuillaumeGomez:code-block-invalid-html-tag-lint, r=jyn514
Mara Bos [Tue, 17 Nov 2020 09:06:27 +0000 (10:06 +0100)]
Rollup merge of #79097 - GuillaumeGomez:code-block-invalid-html-tag-lint, r=jyn514

Code block invalid html tag lint

Fixes #79095

r? ``@jyn514``

3 years agoRollup merge of #79088 - euclio:span-label-doc, r=estebank
Mara Bos [Tue, 17 Nov 2020 09:06:25 +0000 (10:06 +0100)]
Rollup merge of #79088 - euclio:span-label-doc, r=estebank

clarify `span_label` documentation

Fixes #71857.

r? ``@estebank``

cc ``@RalfJung``

3 years agoRollup merge of #79077 - RalfJung:llvm-magic, r=Mark-Simulacrum
Mara Bos [Tue, 17 Nov 2020 09:06:23 +0000 (10:06 +0100)]
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.````

3 years agoRollup merge of #79027 - tmiasko:inline-always-live-locals, r=oli-obk
Mara Bos [Tue, 17 Nov 2020 09:06:21 +0000 (10:06 +0100)]
Rollup merge of #79027 - tmiasko:inline-always-live-locals, r=oli-obk

Limit storage duration of inlined always live locals

Closes #76375.

3 years agoRollup merge of #78967 - tmiasko:codegen-tests, r=cuviper
Mara Bos [Tue, 17 Nov 2020 09:06:19 +0000 (10:06 +0100)]
Rollup merge of #78967 - tmiasko:codegen-tests, r=cuviper

Make codegen tests compatible with extra inlining

3 years agoRollup merge of #78138 - fortanix:raoul/dlmalloc0.2, r=Mark-Simulacrum
Mara Bos [Tue, 17 Nov 2020 09:06:16 +0000 (10:06 +0100)]
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`

3 years agoRollup merge of #77939 - GuillaumeGomez:fix-source-code-dos-backline, r=jyn514
Mara Bos [Tue, 17 Nov 2020 09:06:13 +0000 (10:06 +0100)]
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````

3 years agoAuto merge of #78924 - bjorn3:less_sysroot_build_scripts, r=Mark-Simulacrum
bors [Tue, 17 Nov 2020 06:37:59 +0000 (06:37 +0000)]
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](https://github.com/rust-lang/compiler-builtins/blob/63ccaf11f08fb5d0b39cc33884c5a1a63f547ace/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](https://github.com/Frommi/miniz_oxide/blob/28514ec09f0b1ce74bfb2d561de52a6652ce377a/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

3 years agoRemove duplicate `Trait::auto` field
Joshua Nelson [Tue, 17 Nov 2020 05:34:38 +0000 (00:34 -0500)]
Remove duplicate `Trait::auto` field

It was exactly the same as `is_auto`.

3 years agoGet rid of clean::Method
Joshua Nelson [Tue, 17 Nov 2020 04:19:58 +0000 (23:19 -0500)]
Get rid of clean::Method

Replace it instead with `(clean::Function, Option<hir::Defaultness>)`.

3 years agoAuto merge of #78801 - sexxi-goose:min_capture, r=nikomatsakis
bors [Tue, 17 Nov 2020 03:56:03 +0000 (03:56 +0000)]
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`

3 years agoGet rid of clean::TyMethod
Joshua Nelson [Tue, 17 Nov 2020 03:53:10 +0000 (22:53 -0500)]
Get rid of clean::TyMethod

It's the same as clean::Function.

3 years agoupdate rustfmt to v1.4.27
Caleb Cartwright [Tue, 17 Nov 2020 01:30:21 +0000 (19:30 -0600)]
update rustfmt to v1.4.27

3 years agoAuto merge of #78313 - lcnr:somebody-fold-me, r=nikomatsakis
bors [Tue, 17 Nov 2020 01:14:54 +0000 (01:14 +0000)]
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`

3 years agoClarify availability of atomic operations
James Munns [Tue, 17 Nov 2020 00:38:53 +0000 (01:38 +0100)]
Clarify availability of atomic operations

This was noticed while we were updating the embedded rust book: https://github.com/rust-embedded/book/pull/273/files

These targets do natively have atomic load/stores, but do not support CAS operations.

3 years agoupdate ui test for increased fuel usage
cjkenn [Tue, 17 Nov 2020 00:02:02 +0000 (19:02 -0500)]
update ui test for increased fuel usage

3 years agoFix setting inline hint based on `InstanceDef::requires_inline`
Tomasz Miąsko [Tue, 17 Nov 2020 00:00:00 +0000 (00:00 +0000)]
Fix setting inline hint based on `InstanceDef::requires_inline`

For instances where `InstanceDef::requires_inline` is true, an attempt
is made to set an inline hint though a call to the `inline` function.
The attempt is ineffective, since all attributes will be usually removed
by the second call.

Fix the issue by applying the attributes only once, with user provided
attributes having a priority when provided.

3 years agoAdd two regression tests
Alex Macleod [Mon, 16 Nov 2020 15:37:56 +0000 (15:37 +0000)]
Add two regression tests

For #78721 and #78722

3 years agoadd optimization fuel checks to some mir passes
cjkenn [Mon, 16 Nov 2020 23:09:10 +0000 (18:09 -0500)]
add optimization fuel checks to some mir passes

3 years agoclarify `span_label` documentation
Andy Russell [Mon, 16 Nov 2020 03:39:51 +0000 (22:39 -0500)]
clarify `span_label` documentation

3 years agocompiletest: Fix a warning in debuginfo tests on windows-gnu
Vadim Petrochenkov [Mon, 16 Nov 2020 22:57:27 +0000 (01:57 +0300)]
compiletest: Fix a warning in debuginfo tests on windows-gnu

3 years agoAuto merge of #79104 - m-ou-se:rollup-v74492y, r=m-ou-se
bors [Mon, 16 Nov 2020 22:32:40 +0000 (22:32 +0000)]
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

3 years agox.py: allow a custom string appended to the version
Josh Stone [Mon, 16 Nov 2020 22:08:21 +0000 (14:08 -0800)]
x.py: allow a custom string appended to the version

This adds `rust.description` to the config as a descriptive string to be
appended to `rustc --version` output, which is also used in places like
debuginfo `DW_AT_producer`. This may be useful for supplementary build
information, like distro-specific package versions.

For example, in Fedora 33, `gcc --version` outputs:

    gcc (GCC) 10.2.1 20201016 (Red Hat 10.2.1-6)

With this change, we can add similar vendor info to `rustc --version`.

3 years agoupdate `cg_clif`
Bastian Kauschke [Wed, 28 Oct 2020 07:25:06 +0000 (08:25 +0100)]
update `cg_clif`

3 years agowords
lcnr [Sat, 24 Oct 2020 07:27:15 +0000 (09:27 +0200)]
words

3 years agoclippy: fold by value
Bastian Kauschke [Sat, 24 Oct 2020 00:21:27 +0000 (02:21 +0200)]
clippy: fold by value

3 years agocompiler: fold by value
Bastian Kauschke [Sat, 24 Oct 2020 00:21:18 +0000 (02:21 +0200)]
compiler: fold by value

3 years agoadd IdFunctor to rustc_data_structures
Bastian Kauschke [Sat, 24 Oct 2020 00:20:16 +0000 (02:20 +0200)]
add IdFunctor to rustc_data_structures

3 years agoAdd a test for foreign empty enums
Nadrieril [Mon, 16 Nov 2020 21:13:00 +0000 (21:13 +0000)]
Add a test for foreign empty enums