]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoRemove rustc_session::config::Config
est31 [Wed, 14 Oct 2020 16:42:13 +0000 (18:42 +0200)]
Remove rustc_session::config::Config

The wrapper type led to tons of target.target
across the compiler. Its ptr_width field isn't
required any more, as target_pointer_width
is already present in parsed form.

3 years agoReplace target.target with target and target.ptr_width with target.pointer_width
est31 [Thu, 15 Oct 2020 09:44:00 +0000 (11:44 +0200)]
Replace target.target with target and target.ptr_width with target.pointer_width

Preparation for a subsequent change that replaces
rustc_target::config::Config with its wrapped Target.

On its own, this commit breaks the build. I don't like making
build-breaking commits, but in this instance I believe that it
makes review easier, as the "real" changes of this PR can be
seen much more easily.

Result of running:

find compiler/ -type f -exec sed -i -e 's/target\.target\([)\.,; ]\)/target\1/g' {} \;
find compiler/ -type f -exec sed -i -e 's/target\.target$/target/g' {} \;
find compiler/ -type f -exec sed -i -e 's/target.ptr_width/target.pointer_width/g' {} \;
./x.py fmt

3 years agoRename target_pointer_width to pointer_width and turn it into an u32
est31 [Wed, 14 Oct 2020 16:22:10 +0000 (18:22 +0200)]
Rename target_pointer_width to pointer_width and turn it into an u32

Rename target_pointer_width to pointer_width because it is already
member of the Target struct.

The compiler supports only three valid values for target_pointer_width:
16, 32, 64. Thus it can safely be turned into an int.
This means less allocations and clones as well as easier handling of the type.

3 years agoUse integer literals for builtin target_pointer_width fields
est31 [Wed, 14 Oct 2020 16:08:12 +0000 (18:08 +0200)]
Use integer literals for builtin target_pointer_width fields

Also change target_pointer_width to pointer_width.

Preparation for a subsequent type change of
target_pointer_width to an integer together with a rename
to pointer_width.

On its own, this commit breaks the build. I don't like making
build-breaking commits, but in this instance I believe that it
makes review easier, as the "real" changes of this PR can be
seen much more easily.

Result of running:

find compiler/rustc_target/src/spec/ -type f -exec sed -i -e 's/target_pointer_width: "\(.*\)"\..*,/pointer_width: \1,/g' {} \;

3 years agoAuto merge of #77948 - cuviper:rust-llvm11, r=nikic
bors [Thu, 15 Oct 2020 06:25:32 +0000 (06:25 +0000)]
Auto merge of #77948 - cuviper:rust-llvm11, r=nikic

Rebase LLVM onto 11.0.0 final

3 years agoAuto merge of #77873 - sexxi-goose:use_tuple_inference_for_closures, r=nikomatsakis
bors [Thu, 15 Oct 2020 04:17:10 +0000 (04:17 +0000)]
Auto merge of #77873 - sexxi-goose:use_tuple_inference_for_closures, r=nikomatsakis

Replace tuple of infer vars for upvar_tys with single infer var

This commit allows us to decide the number of captures required after
completing capture ananysis, which is required as part of implementing
RFC-2229.

closes https://github.com/rust-lang/project-rfc-2229/issues/4
r? `@nikomatsakis`

3 years agoAuto merge of #77756 - alarsyo:setup-llvm-detect, r=jyn514
bors [Thu, 15 Oct 2020 02:10:11 +0000 (02:10 +0000)]
Auto merge of #77756 - alarsyo:setup-llvm-detect, r=jyn514

Detect configuration for LLVM during setup

This is a first draft to address #77579, setting `download-ci-llvm` to true on Linux, but I could also implement the `if-available` setting mentioned in the issue.

On other platforms I was thinking about using [the which crate](https://crates.io/crates/which), if adding a dependency on it is considered okay of course, to detect the presence of `llvm-config` in the path, and use it if found. Still a work in progress of course.

3 years agoAuto merge of #77954 - JohnTitor:rollup-bpoy497, r=JohnTitor
bors [Wed, 14 Oct 2020 23:11:04 +0000 (23:11 +0000)]
Auto merge of #77954 - JohnTitor:rollup-bpoy497, r=JohnTitor

Rollup of 9 pull requests

Successful merges:

 - #77570 (Allow ascii whitespace char for doc aliases )
 - #77739 (Remove unused code)
 - #77753 (Check html comments)
 - #77879 (Provide better documentation and help messages for x.py setup)
 - #77902 (Include aarch64-pc-windows-msvc in the dist manifests)
 - #77934 (Document -Z codegen-backend in the unstable book)
 - #77936 (Remove needless alloc_slice)
 - #77946 (Validate references to source scopes)
 - #77951 (Update books)

Failed merges:

r? `@ghost`

3 years agoRollup merge of #77951 - ehuss:update-books, r=ehuss
Yuki Okushi [Wed, 14 Oct 2020 22:32:40 +0000 (07:32 +0900)]
Rollup merge of #77951 - ehuss:update-books, r=ehuss

Update books

## reference

5 commits in 56a13c082ee90736c08d6abdcd90462517b703d3..1b78182e71709169dc0f1c3acdc4541b6860e1c4
2020-09-14 23:20:16 -0700 to 2020-10-11 13:53:47 -0700
- Specify that SSE4.1 includes SSSE3 instead of SSE3 (rust-lang-nursery/reference#892)
- Fix mutable expressions that can be dereferenced (rust-lang-nursery/reference#890)
- Fix grammar in memory model (rust-lang-nursery/reference#889)
- Add style checks. (rust-lang-nursery/reference#886)
- Add description for LUB Coercion (rust-lang-nursery/reference#808)

## book

1 commits in cb28dee95e5e50b793e6ba9291c5d1568d3ad72e..451a1e30f2dd137aa04e142414eafb8d05f87f84
2020-09-09 10:06:00 -0500 to 2020-10-05 09:11:18 -0500
- clarify description of when ? can be used (rust-lang/book#2471)

## rust-by-example

1 commits in 7d3ff1c12db08a847a57a054be4a7951ce532d2d..152475937a8d8a1f508d8eeb57db79139bc803d9
2020-09-28 15:54:25 -0300 to 2020-10-09 09:29:50 -0300
- Add 1.45.0 cast documentation (rust-lang/rust-by-example#1384)

## embedded-book

2 commits in dd310616308e01f6cf227f46347b744aa56b77d9..79ab7776929c66db83203397958fa7037d5d9a30
2020-09-26 08:54:08 +0000 to 2020-10-12 08:00:05 +0000
- llvm-objdump: Use two hyphens in flags to objdump  (rust-embedded/book#270)
- Start/hardware: clarify which file needs tweaking  (rust-embedded/book#266)

3 years agoRollup merge of #77946 - tmiasko:validate-source-scope, r=jonas-schievink
Yuki Okushi [Wed, 14 Oct 2020 22:32:39 +0000 (07:32 +0900)]
Rollup merge of #77946 - tmiasko:validate-source-scope, r=jonas-schievink

Validate references to source scopes

3 years agoRollup merge of #77936 - est31:remove_needless_alloc_slice, r=jonas-schievink
Yuki Okushi [Wed, 14 Oct 2020 22:32:37 +0000 (07:32 +0900)]
Rollup merge of #77936 - est31:remove_needless_alloc_slice, r=jonas-schievink

Remove needless alloc_slice

Don't invoke alloc_slice.

Arenas are temporary,
empty slices are eternal!

3 years agoRollup merge of #77934 - XAMPPRocky:codegen-backend-docs, r=jonas-schievink
Yuki Okushi [Wed, 14 Oct 2020 22:32:36 +0000 (07:32 +0900)]
Rollup merge of #77934 - XAMPPRocky:codegen-backend-docs, r=jonas-schievink

Document -Z codegen-backend in the unstable book

### [Rendered](https://github.com/XAMPPRocky/rust/blob/codegen-backend-docs/src/doc/unstable-book/src/compiler-flags/codegen-backend.md)

Companion PR to #77933 tracking issue.

cc @bjorn3

3 years agoRollup merge of #77902 - arlosi:arm64manifest, r=ehuss
Yuki Okushi [Wed, 14 Oct 2020 22:32:34 +0000 (07:32 +0900)]
Rollup merge of #77902 - arlosi:arm64manifest, r=ehuss

Include aarch64-pc-windows-msvc in the dist manifests

r? @ehuss

/cc @pietroalbini @Mark-Simulacrum

#72881

3 years agoRollup merge of #77879 - ijackson:x-py, r=jyn514
Yuki Okushi [Wed, 14 Oct 2020 22:32:32 +0000 (07:32 +0900)]
Rollup merge of #77879 - ijackson:x-py, r=jyn514

Provide better documentation and help messages for x.py setup

Closes: #77861
I have split this up into tiny comments because I find it clearer this way.  Feel free to squash it.

3 years agoRollup merge of #77753 - GuillaumeGomez:check-html-comments, r=jyn514
Yuki Okushi [Wed, 14 Oct 2020 22:32:31 +0000 (07:32 +0900)]
Rollup merge of #77753 - GuillaumeGomez:check-html-comments, r=jyn514

Check html comments

Part of #67799.

cc @ollie27
r? @jyn514

3 years agoRollup merge of #77739 - est31:remove_unused_code, r=petrochenkov,varkor
Yuki Okushi [Wed, 14 Oct 2020 22:32:29 +0000 (07:32 +0900)]
Rollup merge of #77739 - est31:remove_unused_code, r=petrochenkov,varkor

Remove unused code

Rustc has a builtin lint for detecting unused code inside a crate, but when an item is marked `pub`, the code, even if unused inside the entire workspace, is never marked as such. Therefore, I've built [warnalyzer](https://github.com/est31/warnalyzer) to detect unused items in a cross-crate setting.

Closes https://github.com/est31/warnalyzer/issues/2

3 years agoRollup merge of #77570 - GuillaumeGomez:whitespace-doc-alias, r=jyn514,ollie27
Yuki Okushi [Wed, 14 Oct 2020 22:32:27 +0000 (07:32 +0900)]
Rollup merge of #77570 - GuillaumeGomez:whitespace-doc-alias, r=jyn514,ollie27

Allow ascii whitespace char for doc aliases

Fixes issue from https://github.com/rust-lang/rust/issues/76705#issuecomment-703123847

cc @lopopolo @ollie27

r? @jyn514

3 years agoUpdate books
Eric Huss [Wed, 14 Oct 2020 21:55:41 +0000 (14:55 -0700)]
Update books

3 years agoRebase LLVM onto 11.0.0 final
Josh Stone [Wed, 14 Oct 2020 19:13:20 +0000 (12:13 -0700)]
Rebase LLVM onto 11.0.0 final

3 years agoAuto merge of #77944 - shepmaster:aarch64-apple-darwin-new-xcode, r=pietroalbini
bors [Wed, 14 Oct 2020 17:53:52 +0000 (17:53 +0000)]
Auto merge of #77944 - shepmaster:aarch64-apple-darwin-new-xcode, r=pietroalbini

Update Xcode beta version to allow aarch64-apple-darwin to compile again

r? `@pietroalbini`

3 years agoUpdate Xcode beta version to allow aarch64-apple-darwin to compile again
Jake Goulding [Wed, 14 Oct 2020 17:51:28 +0000 (13:51 -0400)]
Update Xcode beta version to allow aarch64-apple-darwin to compile again

3 years agoUpdate codegen-backend.md
XAMPPRocky [Wed, 14 Oct 2020 12:49:15 +0000 (14:49 +0200)]
Update codegen-backend.md

3 years agoUpdate codegen-backend.md
XAMPPRocky [Wed, 14 Oct 2020 12:46:30 +0000 (14:46 +0200)]
Update codegen-backend.md

3 years agoUpdate src/doc/unstable-book/src/compiler-flags/codegen-backend.md
XAMPPRocky [Wed, 14 Oct 2020 12:44:44 +0000 (14:44 +0200)]
Update src/doc/unstable-book/src/compiler-flags/codegen-backend.md

3 years agoDocument -Z codegen-backend in the unstable book
Erin Power [Wed, 14 Oct 2020 12:34:47 +0000 (14:34 +0200)]
Document -Z codegen-backend in the unstable book

3 years agoRemove needless alloc_slice
est31 [Wed, 14 Oct 2020 12:22:22 +0000 (14:22 +0200)]
Remove needless alloc_slice

Don't invoke alloc_slice.

Arenas are temporary,
empty slices are eternal!

3 years agox.py setup: Avoid infinite loop if stdin is /dev/null
Ian Jackson [Tue, 13 Oct 2020 17:25:17 +0000 (18:25 +0100)]
x.py setup: Avoid infinite loop if stdin is /dev/null

EOF is not an error; it just causes read_line to produce "".

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agox.py setup: Fix handling of wrong interactive input
Ian Jackson [Tue, 13 Oct 2020 11:44:23 +0000 (12:44 +0100)]
x.py setup: Fix handling of wrong interactive input

We need a fresh input buffer each time, or we reuse the previous
data (since `read_line` appends).

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agox.py: setup: Offer keywords in interactive prompt
Ian Jackson [Mon, 12 Oct 2020 23:55:05 +0000 (00:55 +0100)]
x.py: setup: Offer keywords in interactive prompt

We understand these profile names because we use .to_str().
Mention them in the question.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agox.py: setup: Provide a description of what it does
Ian Jackson [Mon, 12 Oct 2020 22:54:49 +0000 (23:54 +0100)]
x.py: setup: Provide a description of what it does

Co-authored-by: Joshua Nelson <joshua@yottadb.com>
3 years agox.py: setup: Refactor to centralise list of profiles
Ian Jackson [Mon, 12 Oct 2020 23:07:52 +0000 (00:07 +0100)]
x.py: setup: Refactor to centralise list of profiles

Put all()'s otuput in the order we want to print things in, and add a
comment about why they are in this order.  Provide purpose() and
all_for_help().  Use these things everywhere.

Move all the abbrev character ("a", "b", etc.) processing into
interactive_path.

No functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoHandle multi-line HTML comments
Guillaume Gomez [Tue, 13 Oct 2020 11:46:12 +0000 (13:46 +0200)]
Handle multi-line HTML comments

3 years agoAuto merge of #77741 - JohnTitor:add-tests, r=matthewjasper
bors [Wed, 14 Oct 2020 06:43:10 +0000 (06:43 +0000)]
Auto merge of #77741 - JohnTitor:add-tests, r=matthewjasper

Add some regression tests

They're fixed since nightly-2020-10-07:
Closes #52843
Closes #53448
Closes #54108
Closes #65581
Closes #65934
Closes #70292
Closes #71443

3 years agoAddress comments
Roxane [Wed, 14 Oct 2020 04:17:42 +0000 (00:17 -0400)]
Address comments

3 years agoAuto merge of #77926 - Dylan-DPC:rollup-wttr8a1, r=Dylan-DPC
bors [Wed, 14 Oct 2020 02:48:05 +0000 (02:48 +0000)]
Auto merge of #77926 - Dylan-DPC:rollup-wttr8a1, r=Dylan-DPC

Rollup of 8 pull requests

Successful merges:

 - #77765 (Add LLVM flags to limit DWARF version to 2 on BSD)
 - #77788 (BTreeMap: fix gdb provider on BTreeMap with ZST keys or values)
 - #77795 (Codegen backend interface refactor)
 - #77808 (Moved the main `impl` for FnCtxt to its own file.)
 - #77817 (Switch rustdoc from `clean::Stability` to `rustc_attr::Stability`)
 - #77829 (bootstrap: only use compiler-builtins-c if they exist)
 - #77870 (Use intra-doc links for links to module-level docs)
 - #77897 (Move `Strip` into a separate rustdoc pass)

Failed merges:

 - #77879 (Provide better documentation and help messages for x.py setup)
 - #77902 (Include aarch64-pc-windows-msvc in the dist manifests)

r? `@ghost`

3 years agoRemove unused code from remaining compiler crates
est31 [Fri, 9 Oct 2020 09:23:40 +0000 (11:23 +0200)]
Remove unused code from remaining compiler crates

3 years agoRemove unused code from rustc_span
est31 [Fri, 9 Oct 2020 09:23:24 +0000 (11:23 +0200)]
Remove unused code from rustc_span

3 years agoRemove unused code from rustc_query_system
est31 [Fri, 9 Oct 2020 09:22:54 +0000 (11:22 +0200)]
Remove unused code from rustc_query_system

3 years agoRemove unused code from rustc_infer
est31 [Fri, 9 Oct 2020 09:22:34 +0000 (11:22 +0200)]
Remove unused code from rustc_infer

3 years agoRemove unused code from rustc_hir
est31 [Fri, 9 Oct 2020 09:22:08 +0000 (11:22 +0200)]
Remove unused code from rustc_hir

3 years agoRemove unused code from rustc_codegen_*
est31 [Fri, 9 Oct 2020 09:21:30 +0000 (11:21 +0200)]
Remove unused code from rustc_codegen_*

3 years agoRemove unused code from rustc_ast
est31 [Fri, 9 Oct 2020 09:20:56 +0000 (11:20 +0200)]
Remove unused code from rustc_ast

3 years agoRemove unused code from rustc_middle
est31 [Fri, 9 Oct 2020 09:20:28 +0000 (11:20 +0200)]
Remove unused code from rustc_middle

3 years agoInclude aarch64-pc-windows-msvc in the dist manifests
Arlo Siemsen [Wed, 14 Oct 2020 02:02:29 +0000 (19:02 -0700)]
Include aarch64-pc-windows-msvc in the dist manifests

3 years agoRollup merge of #77897 - GuillaumeGomez:cleanup-passes-mod, r=jyn514
Dylan DPC [Wed, 14 Oct 2020 00:30:48 +0000 (02:30 +0200)]
Rollup merge of #77897 - GuillaumeGomez:cleanup-passes-mod, r=jyn514

Move `Strip` into a separate rustdoc pass

Just something which was bothering me lately. :)

r? @jyn514

3 years agoRollup merge of #77870 - camelid:intra-doc-super, r=jyn514
Dylan DPC [Wed, 14 Oct 2020 00:30:46 +0000 (02:30 +0200)]
Rollup merge of #77870 - camelid:intra-doc-super, r=jyn514

Use intra-doc links for links to module-level docs

r? @jyn514

3 years agoRollup merge of #77829 - gburgessiv:unused-features-var, r=alexcrichton
Dylan DPC [Wed, 14 Oct 2020 00:30:44 +0000 (02:30 +0200)]
Rollup merge of #77829 - gburgessiv:unused-features-var, r=alexcrichton

bootstrap: only use compiler-builtins-c if they exist

The assignment of `features` above was added in rust-lang#60981, but
never used. Presumably the intent was to replace the string literal here
with it.

While I'm in the area, `compiler_builtins_c_feature` doesn't need to be
a `String`.

I'm not entirely sure of a great way to locally test this -- `./x.py test`
passed on my machine, but 🤷‍♂️.

r? @alexcrichton

3 years agoRollup merge of #77817 - jyn514:const-since, r=petrochenkov
Dylan DPC [Wed, 14 Oct 2020 00:30:42 +0000 (02:30 +0200)]
Rollup merge of #77817 - jyn514:const-since, r=petrochenkov

Switch rustdoc from `clean::Stability` to `rustc_attr::Stability`

This gives greater type safety and is less work to maintain on the rustdoc end. It also makes rustdoc more consistent with rustc.
Noticed this while working on https://github.com/rust-lang/rust/issues/76998.

- Remove `clean::Stability` in favor of `rustc_attr::Stability`
- Remove `impl Clean for Stability`; it's no longer necessary

r? @GuillaumeGomez
cc @petrochenkov

3 years agoRollup merge of #77808 - Nicholas-Baron:fn_ctxt_impl, r=matthewjasper
Dylan DPC [Wed, 14 Oct 2020 00:30:40 +0000 (02:30 +0200)]
Rollup merge of #77808 - Nicholas-Baron:fn_ctxt_impl, r=matthewjasper

Moved the main `impl` for FnCtxt to its own file.

Resolves #77085 without breaking the API of the `FnCtxt` struct.

This is a solution to the file length being over 3000 (see issue #60302).

The other solution to the file length is
1. to change the API of this struct by
2. encapulating certain fields of the struct into other structs.

3 years agoRollup merge of #77795 - bjorn3:codegen_backend_interface_refactor, r=oli-obk
Dylan DPC [Wed, 14 Oct 2020 00:30:38 +0000 (02:30 +0200)]
Rollup merge of #77795 - bjorn3:codegen_backend_interface_refactor, r=oli-obk

Codegen backend interface refactor

This moves several things away from the codegen backend to rustc_interface. There are a few behavioral changes where previously the incremental cache (incorrectly) wouldn't get finalized, but now it does. See the individual commit messages.

3 years agoRollup merge of #77788 - ssomers:btree_cleanup_gdb, r=Mark-Simulacrum
Dylan DPC [Wed, 14 Oct 2020 00:30:36 +0000 (02:30 +0200)]
Rollup merge of #77788 - ssomers:btree_cleanup_gdb, r=Mark-Simulacrum

BTreeMap: fix gdb provider on BTreeMap with ZST keys or values

Avoid error when gdb is asked to inspect a BTreeMap or BTreeSet with a zero-sized type as key or value. And clean up.

r? @Mark-Simulacrum

3 years agoRollup merge of #77765 - amshafer:master, r=petrochenkov
Dylan DPC [Wed, 14 Oct 2020 00:30:34 +0000 (02:30 +0200)]
Rollup merge of #77765 - amshafer:master, r=petrochenkov

Add LLVM flags to limit DWARF version to 2 on BSD

This has been a thorn in my side for a while, I can finally generate flamegraphs of rust programs on bsd again. This fixes dtrace profiling on freebsd, I think it might help with lldb as well but I can't test that because my current rust-lldb setup is messed up.

I'm limiting the dwarf version to 2 on all bsd's (netbsd/openbsd/freebsd) since it looks like this applies to all of them, but I have only tested on freebsd.

Let me know if there's anything I can improve!

---
Currently on FreeBSD dtrace profiling does not work and shows jumbled/incorrect
symbols in the backtraces. FreeBSD does not support the latest versions of DWARF
in dtrace (and lldb?) yet, and needs to be limited to DWARF2 in the same way as macos.

This adds an is_like_bsd flag since it was missing. NetBSD/OpenBSD/FreeBSD all
match this.

This effectively copies #11864 but targets FreeBSD instead of macos.

3 years agoAuto merge of #77135 - Aaron1011:pretty-ignore-paren, r=petrochenkov
bors [Wed, 14 Oct 2020 00:26:50 +0000 (00:26 +0000)]
Auto merge of #77135 - Aaron1011:pretty-ignore-paren, r=petrochenkov

Refactor AST pretty-printing to allow skipping insertion of extra parens

Fixes #75734
Makes progress towards #43081
Unblocks PR #76130

When pretty-printing an AST node, we may insert additional parenthesis
to ensure that precedence is properly preserved in code we output.
However, the proc macro implementation relies on comparing a
pretty-printed AST node to the captured `TokenStream`. Inserting extra
parenthesis changes the structure of the reparsed `TokenStream`, making
the comparison fail.

This PR refactors the AST pretty-printing code to allow skipping the
insertion of additional parenthesis. Several freestanding methods are
moved to trait methods on `PrintState`, which keep track of an internal
`insert_extra_parens` flag. This flag is normally `true`, but we expose
a public method which allows pretty-printing a nonterminal with
`insert_extra_parens = false`.

To avoid changing the public interface of `rustc_ast_pretty`, the
freestanding `_to_string` methods are changed to delegate to a
newly-crated `State`. The main pretty-printing code is moved to a new
`state` module to ensure that it does not accidentally call any of these
public helper functions (instead, the internal functions with the same
name should be used).

3 years agoValidate references to source scopes
Tomasz Miąsko [Wed, 14 Oct 2020 00:00:00 +0000 (00:00 +0000)]
Validate references to source scopes

3 years agoAuto merge of #77917 - JohnTitor:rollup-e47h2qt, r=JohnTitor
bors [Tue, 13 Oct 2020 22:13:09 +0000 (22:13 +0000)]
Auto merge of #77917 - JohnTitor:rollup-e47h2qt, r=JohnTitor

Rollup of 14 pull requests

Successful merges:

 - #77239 (Enable building Cargo for aarch64-apple-darwin)
 - #77569 (BTreeMap: type-specific variants of node_as_mut and cast_unchecked)
 - #77719 (Remove unnecessary rustc_const_stable attributes.)
 - #77722 (Remove unsafety from sys/unsupported and add deny(unsafe_op_in_unsafe_fn).)
 - #77725 (Add regression issue template)
 - #77776 ( Give an error when running `x.py test --stage 0 src/test/ui`)
 - #77786 (Mention rustdoc in `x.py setup`)
 - #77825 (`min_const_generics` diagnostics improvements)
 - #77868 (Include `llvm-dis`, `llc` and `opt` in `llvm-tools-preview` component)
 - #77884 (Use Option::unwrap_or instead of open-coding it)
 - #77886 (Replace trivial bool matches with the `matches!` macro)
 - #77892 (Replace absolute paths with relative ones)
 - #77895 (Include aarch64-apple-darwin in the dist manifests)
 - #77909 (bootstrap: set correct path for the build-manifest binary)

Failed merges:

 - #77902 (Include aarch64-pc-windows-msvc in the dist manifests)

r? `@ghost`

3 years agoRollup merge of #77909 - pietroalbini:fix-build-manifest-path, r=Mark-Simulacrum
Yuki Okushi [Tue, 13 Oct 2020 21:02:41 +0000 (06:02 +0900)]
Rollup merge of #77909 - pietroalbini:fix-build-manifest-path, r=Mark-Simulacrum

bootstrap: set correct path for the build-manifest binary

This changes the path of the binary inside the tarball to be:

```
build-manifest-{release}-{target}/build-manifest/bin/build-manifest
```

...instead of:

```
build-manifest-{release}-{target}/build-manifest/bin/build-manifest/build-manifest
```

r? @Mark-Simulacrum

3 years agoRollup merge of #77895 - shepmaster:silicon-manifest, r=pietroalbini
Yuki Okushi [Tue, 13 Oct 2020 21:02:38 +0000 (06:02 +0900)]
Rollup merge of #77895 - shepmaster:silicon-manifest, r=pietroalbini

Include aarch64-apple-darwin in the dist manifests

r? @ehuss

/cc @pietroalbini @Mark-Simulacrum

3 years agoRollup merge of #77892 - est31:remove_redundant_absolute_paths, r=lcnr
Yuki Okushi [Tue, 13 Oct 2020 21:02:36 +0000 (06:02 +0900)]
Rollup merge of #77892 - est31:remove_redundant_absolute_paths, r=lcnr

Replace absolute paths with relative ones

Modern compilers allow reaching external crates
like std or core via relative paths in modules
outside of lib.rs and main.rs.

3 years agoRollup merge of #77886 - LingMan:ast_pretty_bool_matches, r=petrochenkov
Yuki Okushi [Tue, 13 Oct 2020 21:02:35 +0000 (06:02 +0900)]
Rollup merge of #77886 - LingMan:ast_pretty_bool_matches, r=petrochenkov

Replace trivial bool matches with the `matches!` macro

This derives `PartialEq` on one enum (and two structs it contains) to enable the `==` operator for it. If there's some downside to this, I could respin with the `matches!` macro instead.

3 years agoRollup merge of #77884 - LingMan:ast_pretty_unwrap_or, r=varkor
Yuki Okushi [Tue, 13 Oct 2020 21:02:33 +0000 (06:02 +0900)]
Rollup merge of #77884 - LingMan:ast_pretty_unwrap_or, r=varkor

Use Option::unwrap_or instead of open-coding it

3 years agoRollup merge of #77868 - Aaron1011:llvm-tools-opt-llc, r=Mark-Simulacrum
Yuki Okushi [Tue, 13 Oct 2020 21:02:31 +0000 (06:02 +0900)]
Rollup merge of #77868 - Aaron1011:llvm-tools-opt-llc, r=Mark-Simulacrum

Include `llvm-dis`, `llc` and `opt` in `llvm-tools-preview` component

Fixes #55890

It's useful to have `llc` and `opt` available when debugging an LLVM
miscompilation,.

3 years agoRollup merge of #77825 - ethanboxx:min_const_generics_diagnostic, r=lcnr
Yuki Okushi [Tue, 13 Oct 2020 21:02:29 +0000 (06:02 +0900)]
Rollup merge of #77825 - ethanboxx:min_const_generics_diagnostic, r=lcnr

`min_const_generics` diagnostics improvements

As disscussed in [zulip/project-const-generics/non-trivial anonymous constant](https://rust-lang.zulipchat.com/#narrow/stream/260443-project-const-generics/topic/non-trivial.20anonymous.20constants).

This is my first PR on the compiler.

@lcnr is mentoring me on this PR.

Related to #60551.

3 years agoRollup merge of #77786 - jyn514:rustdoc, r=Mark-Simulacrum
Yuki Okushi [Tue, 13 Oct 2020 21:02:27 +0000 (06:02 +0900)]
Rollup merge of #77786 - jyn514:rustdoc, r=Mark-Simulacrum

Mention rustdoc in `x.py setup`

This lets new contributors know which option they should pick; previously it wasn't clear 'compiler' also included rustdoc.

Unresolved questions: should this say 'compiler and tools' instead? I don't know of any tools that are modified in-tree other than rustdoc, though.

r? @Mark-Simulacrum

3 years agoRollup merge of #77776 - jyn514:wrong-way, r=Mark-Simulacrum
Yuki Okushi [Tue, 13 Oct 2020 21:02:25 +0000 (06:02 +0900)]
Rollup merge of #77776 - jyn514:wrong-way, r=Mark-Simulacrum

 Give an error when running `x.py test --stage 0 src/test/ui`

The error can be overridden with `COMPILETEST_FORCE_STAGE0=1`. In practice I don't know why anyone would do this.

r? @Mark-Simulacrum

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

3 years agoRollup merge of #77725 - camelid:regression-template, r=Mark-Simulacrum
Yuki Okushi [Tue, 13 Oct 2020 21:02:24 +0000 (06:02 +0900)]
Rollup merge of #77725 - camelid:regression-template, r=Mark-Simulacrum

Add regression issue template

Feel free to suggest improvements!

3 years agoRollup merge of #77722 - fusion-engineering-forks:safe-unsupported-locks, r=Mark...
Yuki Okushi [Tue, 13 Oct 2020 21:02:21 +0000 (06:02 +0900)]
Rollup merge of #77722 - fusion-engineering-forks:safe-unsupported-locks, r=Mark-Simulacrum

Remove unsafety from sys/unsupported and add deny(unsafe_op_in_unsafe_fn).

Replacing `UnsafeCell`s by a `Cell`s simplifies things and makes the mutex and rwlock implementations safe. Other than that, only unsafety in strlen() contained unsafe code.

@rustbot modify labels: +F-unsafe-block-in-unsafe-fn +C-cleanup

3 years agoRollup merge of #77719 - fusion-engineering-forks:const-new-mutex-attr-cleanup, r...
Yuki Okushi [Tue, 13 Oct 2020 21:02:19 +0000 (06:02 +0900)]
Rollup merge of #77719 - fusion-engineering-forks:const-new-mutex-attr-cleanup, r=Mark-Simulacrum

Remove unnecessary rustc_const_stable attributes.

These attributes were added in https://github.com/rust-lang/rust/pull/74033#discussion_r450593156 because of [std::io::lazy::Lazy::new](https://github.com/rust-lang/rust/blob/0c03aee8b81185d65b5821518661c30ecdb42de5/src/libstd/io/lazy.rs#L21-L23). But [std::io::lazy::Lazy is gone now](https://github.com/rust-lang/rust/pull/77154), so this can be cleaned up.

@rustbot modify labels: +T-libs +C-cleanup

3 years agoRollup merge of #77569 - ssomers:btree_cleanup_1, r=Mark-Simulacrum
Yuki Okushi [Tue, 13 Oct 2020 21:02:17 +0000 (06:02 +0900)]
Rollup merge of #77569 - ssomers:btree_cleanup_1, r=Mark-Simulacrum

BTreeMap: type-specific variants of node_as_mut and cast_unchecked

Improves debug checking and shortens some expressions. Extracted from #77408

3 years agoRollup merge of #77239 - shepmaster:silicon-ci-plus, r=pietroalbini
Yuki Okushi [Tue, 13 Oct 2020 21:02:12 +0000 (06:02 +0900)]
Rollup merge of #77239 - shepmaster:silicon-ci-plus, r=pietroalbini

Enable building Cargo for aarch64-apple-darwin

r? @ghost

3 years agoAuto merge of #75213 - dingxiangfei2009:yield-point-in-match-guard, r=tmandry
bors [Tue, 13 Oct 2020 20:20:27 +0000 (20:20 +0000)]
Auto merge of #75213 - dingxiangfei2009:yield-point-in-match-guard, r=tmandry

[generator] Special cases for match guard when analyzing interior types in generators

Fix #72651

This proposes one of ways to fix the mentioned issue. One cause of #72651 is that the interior type analysis misses out types of match pattern locals. Those locals are manifested as temporary borrows in the scopes of match arm guards. If uses of these locals appear after yield points, the borrows from them were not considered live across the yield points. However, this is not the case since the borrowing always happens at the very beginning of the match guard.

This calls for special treatment to analysis of types appearing in the match guard. Those borrows are recorded as the HIR tree is walked by `InteriorVisitor` and their uses are recorded whenever a yield point is crossed.

3 years agoAdd a target option for selecting a DWARF version
Austin Shafer [Fri, 9 Oct 2020 19:08:18 +0000 (15:08 -0400)]
Add a target option for selecting a DWARF version

Certain platforms need to limit the DWARF version emitted (oxs, *bsd). This
change adds a dwarf_version entry to the options that allows a platform to
specify the dwarf version to use. By default this option is none and the default
DWARF version is selected.

Also adds an option for printing Option<u32> json keys

3 years agoReplace trivial bool matches with the `matches!` macro
LingMan [Mon, 12 Oct 2020 19:46:15 +0000 (21:46 +0200)]
Replace trivial bool matches with the `matches!` macro

3 years agobootstrap: set correct path for the build-manifest binary
Pietro Albini [Tue, 13 Oct 2020 18:37:38 +0000 (20:37 +0200)]
bootstrap: set correct path for the build-manifest binary

3 years agoAdd regression issue template
Camelid [Thu, 8 Oct 2020 21:45:25 +0000 (14:45 -0700)]
Add regression issue template

3 years agoDeny unsafe_op_in_unsafe_fn for unsupported/common.rs through sys/wasm too.
Mara Bos [Tue, 13 Oct 2020 16:52:57 +0000 (18:52 +0200)]
Deny unsafe_op_in_unsafe_fn for unsupported/common.rs through sys/wasm too.

3 years agoexplanatory comments and fix guard binding stack
Ding Xiang Fei [Tue, 13 Oct 2020 16:50:30 +0000 (00:50 +0800)]
explanatory comments and fix guard binding stack

3 years agodedicated visitor for arm patterns
Ding Xiang Fei [Wed, 7 Oct 2020 04:58:02 +0000 (12:58 +0800)]
dedicated visitor for arm patterns

3 years agoswitch the test to an actual MCVE
Ding Xiang Fei [Wed, 19 Aug 2020 01:04:40 +0000 (09:04 +0800)]
switch the test to an actual MCVE

3 years agorustfmt
Ding Xiang Fei [Thu, 6 Aug 2020 08:20:06 +0000 (16:20 +0800)]
rustfmt

3 years agotest derived from #74961
Ding Xiang Fei [Thu, 6 Aug 2020 08:18:46 +0000 (16:18 +0800)]
test derived from #74961

3 years agoalso record the types of borrows from the pattern locals in match guards
Ding Xiang Fei [Thu, 6 Aug 2020 07:37:12 +0000 (15:37 +0800)]
also record the types of borrows from the pattern locals in match guards

so that it reflects the fact that borrowing these pattern locals is happening
before any yield points in match guards

3 years agodocumentation fix
Ding Xiang Fei [Thu, 6 Aug 2020 07:36:57 +0000 (15:36 +0800)]
documentation fix

3 years agoHandle included config in bootstrap.py
Antoine Martin [Tue, 13 Oct 2020 15:58:56 +0000 (17:58 +0200)]
Handle included config in bootstrap.py

3 years agoImplement "if-available" option for download-ci-llvm
Antoine Martin [Tue, 13 Oct 2020 14:57:58 +0000 (16:57 +0200)]
Implement "if-available" option for download-ci-llvm

3 years agoaarch64-apple-darwin now includes Cargo
Jake Goulding [Tue, 13 Oct 2020 15:00:03 +0000 (11:00 -0400)]
aarch64-apple-darwin now includes Cargo

3 years ago Give an error when running `x.py test --stage 0 src/test/ui`
Joshua Nelson [Sat, 10 Oct 2020 03:15:16 +0000 (23:15 -0400)]
 Give an error when running `x.py test --stage 0 src/test/ui`

3 years agoAuto merge of #75406 - mati865:mingw-aslr, r=Mark-Simulacrum
bors [Tue, 13 Oct 2020 14:12:08 +0000 (14:12 +0000)]
Auto merge of #75406 - mati865:mingw-aslr, r=Mark-Simulacrum

Enable ASLR for windows-gnu

Fixes https://github.com/rust-lang/rust/issues/16514
Fixes https://github.com/rust-lang/rust/issues/16593
Fixes https://github.com/rust-lang/rust/issues/17684

Passes the tests for me with x86_64 toolchain.

3 years agoAdd note about using cells in the locks on the 'unsupported' platform.
Mara Bos [Tue, 13 Oct 2020 13:29:38 +0000 (15:29 +0200)]
Add note about using cells in the locks on the 'unsupported' platform.

3 years agoReplace absolute paths with relative ones
est31 [Tue, 13 Oct 2020 08:17:05 +0000 (10:17 +0200)]
Replace absolute paths with relative ones

Modern compilers allow reaching external crates
like std or core via relative paths in modules
outside of lib.rs and main.rs.

3 years agoAuto merge of #77762 - pietroalbini:dist-build-manifest, r=Mark-Simulacrum
bors [Tue, 13 Oct 2020 12:11:47 +0000 (12:11 +0000)]
Auto merge of #77762 - pietroalbini:dist-build-manifest, r=Mark-Simulacrum

Dist build manifest

This PR makes two changes that should remove a significant chunk of the time spent in our release process: cloning the `rust-lang/rust` monorepo, all its submodules, and building `bootstrap` to then invoke `build-manifest`:

* `build-manifest` doesn't rely on a clone of the monorepo being present anymore. The only remaining bit of information it fetched from it (the Rust version) is instead bundled in the binary.
* A new "component" is added, `build-manifest`. That component includes a prebuilt version of the tool, and it's *not* included in the Rustup manifest. This will allow `promote-release` to directly invoke the tool without interacting with our build system.
* The Linux x86_64 CI is changed to also build the component mentioned above. It's the only CI builder tasked to do so, and to cleanly support this a new `--include-default-paths` flag was added to `./x.py`.
* The `BUILD_MANIFEST_NUM_THREADS` environment variable is added to configure the number of threads at runtime.

This PR is best reviewed commit-by-commit.
r? `@Mark-Simulacrum`

3 years agoClean up rustdoc passes
Guillaume Gomez [Tue, 13 Oct 2020 10:57:43 +0000 (12:57 +0200)]
Clean up rustdoc passes

3 years agoInclude aarch64-apple-darwin in the dist manifests
Jake Goulding [Tue, 13 Oct 2020 11:19:54 +0000 (07:19 -0400)]
Include aarch64-apple-darwin in the dist manifests

3 years agoAdd check for HTML comments
Guillaume Gomez [Fri, 9 Oct 2020 13:04:22 +0000 (15:04 +0200)]
Add check for HTML comments

3 years agoAuto merge of #77755 - bugadani:perf-calc-dtor, r=ecstatic-morse
bors [Tue, 13 Oct 2020 10:19:30 +0000 (10:19 +0000)]
Auto merge of #77755 - bugadani:perf-calc-dtor, r=ecstatic-morse

Monomorphize `calculate_dtor` instead of using function pointers

Change `calculate_dtor` to avoid dynamic dispatching. This change allows the empty functions to be optimized away.

Based on the discussion in https://github.com/rust-lang/rust/pull/77754#discussion_r502498970, the performance impact of this change was measured.

Perf run results: https://perf.rust-lang.org/compare.html?start=7bc5839e99411aad9061a632b62075d1346cbb3b&end=ffec759ae9bbc4d6d2235ff40ade6723a85bc7cc

3 years agoAuto merge of #77759 - tblah:fix_riscv_qemu, r=pietroalbini
bors [Tue, 13 Oct 2020 08:27:01 +0000 (08:27 +0000)]
Auto merge of #77759 - tblah:fix_riscv_qemu, r=pietroalbini

ci: Fix riscv64gc linux test QEMU fault, plus doc link fix

Newer versions of the `qemu` package (used for riscv64gc-unknown-linux-gnu testing) don't work with the version of the RISC-V bootloader we were using. https://github.com/rust-lang/rust/commit/a4a0342cf59a1bff43ed79586065eb97dba0cddb  bumps to a revision which should fix the problem.

https://github.com/rust-lang/rust/commit/e0b033e965a7d422da70a409a028af7c8b64e709 fixes a documentation failure I encountered while running the tests.

3 years agoAuto merge of #77639 - jagill:stabilize-slice_partition_at_index, r=Amanieu
bors [Tue, 13 Oct 2020 06:33:52 +0000 (06:33 +0000)]
Auto merge of #77639 - jagill:stabilize-slice_partition_at_index, r=Amanieu

Stabilize slice_partition_at_index

This stabilizes slice_partition_at_index, including renaming `partition_at_index*` -> `select_nth_unstable*`.

Closes #55300

r? `@Amanieu`

3 years agoAuto merge of #76196 - r-52:r-coverage-allow-missing-docs, r=jyn514
bors [Tue, 13 Oct 2020 04:41:08 +0000 (04:41 +0000)]
Auto merge of #76196 - r-52:r-coverage-allow-missing-docs, r=jyn514

rustdoc: skip #[allow(missing docs)] for docs in coverage report

During the document coverage reporting with:
```bash
rustdoc something.rs -Z unstable-options --show-coverage
```

the coverage report counts code that is marked with `#[allow(missing_docs)]` for the calculation, which outputs lower numbers in the coverage report even though these parts should be ignored for the calculation.

Right now I'm not sure how this can be tested (CI)? (I verified it by hand and ran the unit tests)

r? `@jyn514`

**Reference:** Fixes #76121

3 years agoAuto merge of #76830 - Artoria2e5:tune, r=nagisa
bors [Tue, 13 Oct 2020 02:49:00 +0000 (02:49 +0000)]
Auto merge of #76830 - Artoria2e5:tune, r=nagisa

Pass tune-cpu to LLVM

I think this is how it should work...

See https://internals.rust-lang.org/t/expose-tune-cpu-from-llvm/13088 for the background. Or the documentation diff.

3 years agoUse Option::unwrap_or instead of open-coding it
LingMan [Mon, 12 Oct 2020 23:05:35 +0000 (01:05 +0200)]
Use Option::unwrap_or instead of open-coding it

3 years agoUse intra-doc links for links to module-level docs
Camelid [Mon, 12 Oct 2020 20:42:49 +0000 (13:42 -0700)]
Use intra-doc links for links to module-level docs