]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoAdd the "memcpy" doc alias to slice::copy_from_slice
Yoshua Wuyts [Thu, 19 Nov 2020 20:52:08 +0000 (21:52 +0100)]
Add the "memcpy" doc alias to slice::copy_from_slice

3 years agoAuto merge of #79200 - Dylan-DPC:rollup-su689pq, r=Dylan-DPC
bors [Thu, 19 Nov 2020 17:27:24 +0000 (17:27 +0000)]
Auto merge of #79200 - Dylan-DPC:rollup-su689pq, r=Dylan-DPC

Rollup of 14 pull requests

Successful merges:

 - #78961 (Make bad "rust-call" arguments no longer ICE)
 - #79082 (Improve the diagnostic for when an `fn` contains qualifiers inside an `extern` block.)
 - #79090 (libary: Forward compiler-builtins "asm"  and "mangled-names" feature)
 - #79094 (Add //ignore-macos to pretty-std-collections.rs)
 - #79101 (Don't special case constant operands when lowering intrinsics)
 - #79102 (Add two regression tests)
 - #79110 (Remove redundant notes in E0275)
 - #79116 (compiletest: Fix a warning in debuginfo tests on windows-gnu)
 - #79117 (add optimization fuel checks to some mir passes)
 - #79147 (Highlight MIR as Rust on GitHub)
 - #79149 (Move capture lowering from THIR to MIR)
 - #79155 (fix handling the default config for profiler and sanitizers)
 - #79156 (Allow using `download-ci-llvm` from directories other than the root)
 - #79164 (Permit standalone generic parameters as const generic arguments in macros)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agoRollup merge of #79164 - varkor:unbraced-single-segment-const-arguments, r=petrochenkov
Dylan DPC [Thu, 19 Nov 2020 15:26:44 +0000 (16:26 +0100)]
Rollup merge of #79164 - varkor:unbraced-single-segment-const-arguments, r=petrochenkov

Permit standalone generic parameters as const generic arguments in macros

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

r? ```@petrochenkov```

3 years agoRollup merge of #79156 - jyn514:relative-llvm, r=Mark-Simulacrum
Dylan DPC [Thu, 19 Nov 2020 15:26:42 +0000 (16:26 +0100)]
Rollup merge of #79156 - jyn514:relative-llvm, r=Mark-Simulacrum

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
```

r? ```@Mark-Simulacrum```
cc ```@pnkfelix```

3 years agoRollup merge of #79155 - 12101111:fix-profiler-config, r=Mark-Simulacrum
Dylan DPC [Thu, 19 Nov 2020 15:26:40 +0000 (16:26 +0100)]
Rollup merge of #79155 - 12101111:fix-profiler-config, r=Mark-Simulacrum

fix handling the default config for profiler and sanitizers

#78354 don't handle the case that user don't add any target-specific config in `[target.*]` of `config.toml`:
```toml
changelog-seen = 2
[llvm]
link-shared = true
[build]
sanitizers = true
profiler = true
[install]
[rust]
[dist]
```

The previes code handle the default config in `Config::prase()`:

```rust
target.sanitizers = cfg.sanitizers.unwrap_or(build.sanitizers.unwrap_or_default());
target.profiler = cfg.profiler.unwrap_or(build.profiler.unwrap_or_default());
config.target_config.insert(TargetSelection::from_user(&triple), target);
```

In this case, `toml.target` don't contain any target, so the above code won't execute. Instead, a default `Target` is insert in https://github.com/rust-lang/rust/blob/c919f490bbcd2b29b74016101f7ec71aaa24bdbb/src/bootstrap/sanity.rs#L162-L166

The default value for `bool` is false, hence the issue in #79124

This fix change the type of `sanitizers` and `profiler` to `Option<bool>`, so the default value is `None`, and fallback config is handled in  `Config::sanitizers_enabled` and `Config::profiler_enabled`

fix #79124

cc `@Mark-Simulacrum` `@richkadel`

3 years agoRollup merge of #79149 - sexxi-goose:upvar_ref, r=nikomatsakis
Dylan DPC [Thu, 19 Nov 2020 15:26:39 +0000 (16:26 +0100)]
Rollup merge of #79149 - sexxi-goose:upvar_ref, r=nikomatsakis

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`).

- 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.

Closes: rust-lang/project-rfc-2229#25
r? ```@nikomatsakis```

3 years agoRollup merge of #79147 - camelid:mir-gitattributes, r=oli-obk
Dylan DPC [Thu, 19 Nov 2020 15:26:37 +0000 (16:26 +0100)]
Rollup merge of #79147 - camelid:mir-gitattributes, r=oli-obk

Highlight MIR as Rust on GitHub

3 years agoRollup merge of #79117 - cjkenn:mir-fuel, r=oli-obk
Dylan DPC [Thu, 19 Nov 2020 15:26:35 +0000 (16:26 +0100)]
Rollup merge of #79117 - cjkenn:mir-fuel, r=oli-obk

add optimization fuel checks to some mir passes

Fixes #77402

Inserts a bunch of calls to `consider_optimizing`. Note that `consider_optimizing` is the method that actually decrements the fuel count, so the point at which it's called is when the optimization takes place, from a fuel perspective. This means that where we call it has some thought behind it:

1. We probably don't want to decrement the fuel count before other simple checks, otherwise we count an optimization as being performed even if nothing was mutated (ie. it returned early).
2. In cases like `InstCombine`, where we gather optimizations in a pass and then mutate values, we probably would rather skip the gathering pass for performance reasons rather than skip the mutations afterwards.

3 years agoRollup merge of #79116 - petrochenkov:gdbwarn, r=Mark-Simulacrum
Dylan DPC [Thu, 19 Nov 2020 15:26:33 +0000 (16:26 +0100)]
Rollup merge of #79116 - petrochenkov:gdbwarn, r=Mark-Simulacrum

compiletest: Fix a warning in debuginfo tests on windows-gnu

The warning looked like this for me:
```
Warning: C:msys64homewerust./src/etc: No such file or directory.
```
It didn't affect actual testing because we don't currently emit gdb pretty-printer information into executables on windows-gnu.

3 years agoRollup merge of #79110 - estebank:issue-58964, r=oli-obk
Dylan DPC [Thu, 19 Nov 2020 15:26:31 +0000 (16:26 +0100)]
Rollup merge of #79110 - estebank:issue-58964, r=oli-obk

Remove redundant notes in E0275

Fix #58964.

3 years agoRollup merge of #79102 - Alexendoo:ice-regression-tests, r=Mark-Simulacrum
Dylan DPC [Thu, 19 Nov 2020 15:26:29 +0000 (16:26 +0100)]
Rollup merge of #79102 - Alexendoo:ice-regression-tests, r=Mark-Simulacrum

Add two regression tests

For #78721 and #78722

3 years agoRollup merge of #79101 - tmiasko:lower-func-type, r=jonas-schievink
Dylan DPC [Thu, 19 Nov 2020 15:26:27 +0000 (16:26 +0100)]
Rollup merge of #79101 - tmiasko:lower-func-type, r=jonas-schievink

Don't special case constant operands when lowering intrinsics

3 years agoRollup merge of #79094 - est31:ignore_macos, r=pietroalbini
Dylan DPC [Thu, 19 Nov 2020 15:26:26 +0000 (16:26 +0100)]
Rollup merge of #79094 - est31:ignore_macos, r=pietroalbini

Add //ignore-macos to pretty-std-collections.rs

On macOS the test is flaky and sometimes fails,
sometimes succeeds on CI.

This is no fix for the underlying issue,
but I feel the workaround is worth it as
the issue makes it harder
to get things merged into master.

cc #78665

3 years agoRollup merge of #79090 - hermitcore:builtins, r=Mark-Simulacrum
Dylan DPC [Thu, 19 Nov 2020 15:26:23 +0000 (16:26 +0100)]
Rollup merge of #79090 - hermitcore:builtins, r=Mark-Simulacrum

libary: Forward compiler-builtins "asm"  and "mangled-names" feature

In principle this is a followup of rust-lang/rust#78472. In the previous PR was the support of the test crate missing.

Now users will be able to do:
```
cargo build -Zbuild-std=core -Zbuild-std-features=compiler-builtins-asm
```
and correctly get the assembly implemenations for `memcpy` and friends.

3 years agoRollup merge of #79082 - ThePuzzlemaker:issue-78941-fix, r=estebank
Dylan DPC [Thu, 19 Nov 2020 15:26:21 +0000 (16:26 +0100)]
Rollup merge of #79082 - ThePuzzlemaker:issue-78941-fix, r=estebank

Improve the diagnostic for when an `fn` contains qualifiers inside an `extern` block.

This mitigates #78941. As suggested by ```@estebank,``` `span_suggestion` was replaced with `span_suggestion_verbose` for this specific diagnostic.

3 years agoRollup merge of #78961 - CraftSpider:22565, r=oli-obk
Dylan DPC [Thu, 19 Nov 2020 15:26:19 +0000 (16:26 +0100)]
Rollup merge of #78961 - CraftSpider:22565, r=oli-obk

Make bad "rust-call" arguments no longer ICE

The simplest of bad rust-call definitions will no longer cause an ICE. There is a FIXME added for future work, as I wanted to get this easy fix in before trying to either add a hack or mess with the whole obligation system

fixes #22565

3 years agoAuto merge of #79198 - RalfJung:miri, r=RalfJung
bors [Thu, 19 Nov 2020 14:57:39 +0000 (14:57 +0000)]
Auto merge of #79198 - RalfJung:miri, r=RalfJung

update Miri

Fixes https://github.com/rust-lang/rust/issues/79176
Fixes https://github.com/rust-lang/rust/issues/79129
Cc `@rust-lang/miri` r? `@ghost`

3 years agoupdate print fuel test output again...
cjkenn [Thu, 19 Nov 2020 13:47:00 +0000 (08:47 -0500)]
update print fuel test output again...

3 years agoremove check from const promotion
cjkenn [Thu, 19 Nov 2020 13:21:20 +0000 (08:21 -0500)]
remove check from const promotion

3 years agoAuto merge of #78449 - Aaron1011:fix/libstd-semi, r=dtolnay
bors [Thu, 19 Nov 2020 10:52:19 +0000 (10:52 +0000)]
Auto merge of #78449 - Aaron1011:fix/libstd-semi, r=dtolnay

Remove semicolon from internal `err` macro

This macro is used in expression position (a match arm), and only
compiles because of #33953

Regardless of what happens with that issue, this makes the
usage of the macro less confusing at the call site.

3 years agoupdate Miri
Ralf Jung [Thu, 19 Nov 2020 10:25:27 +0000 (11:25 +0100)]
update Miri

3 years agoAuto merge of #79068 - DevJPM:ci-llvm-9-fix, r=pietroalbini
bors [Thu, 19 Nov 2020 08:10:15 +0000 (08:10 +0000)]
Auto merge of #79068 - DevJPM:ci-llvm-9-fix, r=pietroalbini

Remove Hacks and Fixmes from PR CI's LLVM-9 Container

Now with LLVM 9 being the minimum supported version (thanks to #78848 ), we can
finally remove the hacks in the dockerfile.

This wasn't in the main PR bumping the version as I didn't quite
understand what's going on and needed here.

Relevant issues and PRs:

- Issue #69823
- PR #70989

I hope I actually adressed things correctly here?

3 years agoAuto merge of #79002 - est31:backtrace_colno, r=dtolnay
bors [Thu, 19 Nov 2020 06:00:49 +0000 (06:00 +0000)]
Auto merge of #79002 - est31:backtrace_colno, r=dtolnay

Add column number support to Backtrace

Backtrace frames might include column numbers.
Print them if they are included.

3 years agoBump stage0 rustfmt to nightly-2020-11-19
Aaron Hill [Thu, 19 Nov 2020 04:11:38 +0000 (23:11 -0500)]
Bump stage0 rustfmt to nightly-2020-11-19

This pulls in https://github.com/rust-lang/rustfmt/pull/4507,
allowing us to remove a semicolon in an internal libstd macro

3 years agoRemove semicolon from internal `err` macro
Aaron Hill [Tue, 27 Oct 2020 18:48:29 +0000 (14:48 -0400)]
Remove semicolon from internal `err` macro

This macro is used in expression position (a match arm), and only
compiles because of #33953

Regardless of what happens with that issue, this makes the
usage of the macro less confusing at the call site.

3 years agomove checks later into optimization passes
cjkenn [Thu, 19 Nov 2020 00:16:23 +0000 (19:16 -0500)]
move checks later into optimization passes

3 years agoAuto merge of #79106 - tmiasko:inline-hint, r=nagisa,eddyb
bors [Wed, 18 Nov 2020 23:44:54 +0000 (23:44 +0000)]
Auto merge of #79106 - tmiasko:inline-hint, r=nagisa,eddyb

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.

Closes #79108.

3 years agoAuto merge of #78995 - Nadrieril:clean-empty-match, r=varkor
bors [Wed, 18 Nov 2020 21:24:40 +0000 (21:24 +0000)]
Auto merge of #78995 - Nadrieril:clean-empty-match, r=varkor

Handle empty matches cleanly in exhaustiveness checking

This removes the special-casing of empty matches that was done in `check_match`. This fixes most of https://github.com/rust-lang/rust/issues/55123.
Somewhat unrelatedly, I also made `_match.rs` more self-contained, because I think it's cleaner.

r? `@varkor`
`@rustbot` modify labels: +A-exhaustiveness-checking

3 years agoAuto merge of #79167 - m-ou-se:rollup-4g15apk, r=m-ou-se
bors [Wed, 18 Nov 2020 18:16:31 +0000 (18:16 +0000)]
Auto merge of #79167 - m-ou-se:rollup-4g15apk, r=m-ou-se

Rollup of 11 pull requests

Successful merges:

 - #78361 (Updated the list of white-listed target features for x86)
 - #78785 (linux: try to use libc getrandom to allow interposition)
 - #78999 (stability: More precise location for deprecation lint on macros)
 - #79039 (Tighten the bounds on atomic Ordering in std::sys::unix::weak::Weak)
 - #79079 (Turn top-level comments into module docs in MIR visitor)
 - #79114 (add trailing_zeros and leading_zeros to non zero types)
 - #79131 (Enable AVX512 *epi64 variants by updating stdarch)
 - #79133 (bootstrap: use the same version number for rustc and cargo)
 - #79145 (Fix handling of panic calls)
 - #79151 (Fix typo in `std::io::Write` docs)
 - #79158 (type is too big -> values of the type are too big)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agoreview comment
Esteban Küber [Wed, 18 Nov 2020 17:03:51 +0000 (09:03 -0800)]
review comment

3 years agoAccount for indirect cyclic requirements
Esteban Küber [Wed, 18 Nov 2020 16:33:27 +0000 (08:33 -0800)]
Account for indirect cyclic requirements

3 years agoRemove redundant notes in E0275
Esteban Küber [Mon, 16 Nov 2020 19:16:30 +0000 (11:16 -0800)]
Remove redundant notes in E0275

Fix #58964.

3 years agochange print-fuel ui test to check-pass
cjkenn [Wed, 18 Nov 2020 16:27:37 +0000 (11:27 -0500)]
change print-fuel ui test to check-pass

3 years agoRollup merge of #79158 - lcnr:lazy-norm-coerce, r=oli-obk
Mara Bos [Wed, 18 Nov 2020 14:46:40 +0000 (15:46 +0100)]
Rollup merge of #79158 - lcnr:lazy-norm-coerce, r=oli-obk

type is too big -> values of the type are too big

strictly speaking, `[u8; usize::MAX]` or even `[[[u128; usize::MAX]; usize::MAX]; usize::MAX]` are absolutely fine types as long as you don't try to deal with any values of it.

This error message seems to cause some confusion imo, for example in https://github.com/rust-lang/rust/pull/79135#issuecomment-729361380 so I would prefer us to be more precise here.

See the added test case which uses one of these types without causing an error.

r? ``@oli-obk``

3 years agoRollup merge of #79151 - wchargin:wchargin-io-write-docs, r=jyn514
Mara Bos [Wed, 18 Nov 2020 14:46:38 +0000 (15:46 +0100)]
Rollup merge of #79151 - wchargin:wchargin-io-write-docs, r=jyn514

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 agoRollup merge of #79145 - camelid:clippy-fix-panics, r=flip1995
Mara Bos [Wed, 18 Nov 2020 14:46:36 +0000 (15:46 +0100)]
Rollup merge of #79145 - camelid:clippy-fix-panics, r=flip1995

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.

r? ``@flip1995``
cc ``@m-ou-se``

3 years agoRollup merge of #79133 - pietroalbini:simplify-stage0, r=Mark-Simulacrum
Mara Bos [Wed, 18 Nov 2020 14:46:34 +0000 (15:46 +0100)]
Rollup merge of #79133 - pietroalbini:simplify-stage0, r=Mark-Simulacrum

bootstrap: use the same version number for rustc and cargo

Historically the stable tarballs were named after the version number ofthe 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.

r? ``@Mark-Simulacrum``

3 years agoRollup merge of #79131 - vertexclique:stdarch-update, r=Amanieu
Mara Bos [Wed, 18 Nov 2020 14:46:32 +0000 (15:46 +0100)]
Rollup merge of #79131 - vertexclique:stdarch-update, r=Amanieu

Enable AVX512 *epi64 variants by updating stdarch

3 years agoRollup merge of #79114 - andjo403:nonzero_leading_trailing_zeros, r=m-ou-se
Mara Bos [Wed, 18 Nov 2020 14:46:31 +0000 (15:46 +0100)]
Rollup merge of #79114 - andjo403:nonzero_leading_trailing_zeros, r=m-ou-se

add trailing_zeros and leading_zeros to non zero types

as a way towards being able to use the optimized intrinsics ctlz_nonzero and cttz_nonzero from stable.

have not crated any tracking issue if this is not a solution that is wanted

3 years agoRollup merge of #79079 - camelid:mir-visit-docs, r=matthewjasper
Mara Bos [Wed, 18 Nov 2020 14:46:29 +0000 (15:46 +0100)]
Rollup merge of #79079 - camelid:mir-visit-docs, r=matthewjasper

Turn top-level comments into module docs in MIR visitor

3 years agoRollup merge of #79039 - thomcc:weakly-relaxing, r=Amanieu
Mara Bos [Wed, 18 Nov 2020 14:46:27 +0000 (15:46 +0100)]
Rollup merge of #79039 - thomcc:weakly-relaxing, r=Amanieu

Tighten the bounds on atomic Ordering in std::sys::unix::weak::Weak

This moves reading this from multiple SeqCst reads to Relaxed read + Acquire fence if we are actually going to use the data.

Would love to avoid the Acquire fence, but doing so would need Ordering::Consume, which neither Rust, nor LLVM supports (a shame, since this fence is hardly free on ARM, which is what I was hoping to improve).

r? ``@Amanieu`` (Sorry for always picking you, but I know a lot of people wouldn't feel comfortable reviewing atomic ordering changes)

3 years agoRollup merge of #78999 - petrochenkov:deprid, r=eddyb
Mara Bos [Wed, 18 Nov 2020 14:46:25 +0000 (15:46 +0100)]
Rollup merge of #78999 - petrochenkov:deprid, r=eddyb

stability: More precise location for deprecation lint on macros

One missing piece of https://github.com/rust-lang/rust/pull/73178.

3 years agoRollup merge of #78785 - cuviper:weak-getrandom, r=m-ou-se
Mara Bos [Wed, 18 Nov 2020 14:46:23 +0000 (15:46 +0100)]
Rollup merge of #78785 - cuviper:weak-getrandom, r=m-ou-se

linux: try to use libc getrandom to allow interposition

We'll try to use a weak `getrandom` symbol first, because that allows
things like `LD_PRELOAD` interposition. For example, perf measurements
might want to disable randomness to get reproducible results. If the
weak symbol is not found, we fall back to a raw `SYS_getrandom` call.

3 years agoRollup merge of #78361 - DevJPM:master, r=workingjubilee
Mara Bos [Wed, 18 Nov 2020 14:46:19 +0000 (15:46 +0100)]
Rollup merge of #78361 - DevJPM:master, r=workingjubilee

Updated the list of white-listed target features for x86

This PR both adds in-source documentation on what to look out for when adding a new (X86) feature set and [adds all that are detectable at run-time in Rust stable as of 1.27.0](https://github.com/rust-lang/stdarch/blob/master/crates/std_detect/src/detect/arch/x86.rs).

This should only enable the use of the corresponding LLVM intrinsics.
Actual intrinsics need to be added separately in rust-lang/stdarch.

It also re-orders the run-time-detect test statements to be more consistent
with the actual list of intrinsics whitelisted and removes underscores not present
in the actual names (which might be mistaken as being part of the name)

The reference for LLVM's feature names used is [this file](https://github.com/llvm/llvm-project/blob/master/llvm/include/llvm/Support/X86TargetParser.def).

This PR was motivated as the compiler end's part for allowing #67329 to be adressed over on rust-lang/stdarch

3 years agomove fuel checks to later points in instcombine and const_prop, add opt level flag...
cjkenn [Wed, 18 Nov 2020 13:49:46 +0000 (08:49 -0500)]
move fuel checks to later points in instcombine and const_prop, add opt level flag to test

3 years agoAdd tests for multi-segment paths in const generic arguments
varkor [Wed, 18 Nov 2020 12:55:35 +0000 (12:55 +0000)]
Add tests for multi-segment paths in const generic arguments

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 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 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