]> git.lizzy.rs Git - rust.git/log
rust.git
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 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 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 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 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 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 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 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

3 years agoAuto merge of #77796 - jonas-schievink:switchint-refactor, r=oli-obk
bors [Tue, 13 Oct 2020 00:57:03 +0000 (00:57 +0000)]
Auto merge of #77796 - jonas-schievink:switchint-refactor, r=oli-obk

Refactor how SwitchInt stores jump targets

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

3 years agoAuto merge of #77792 - matthewjasper:instrument-trait-selection, r=oli-obk
bors [Mon, 12 Oct 2020 23:04:55 +0000 (23:04 +0000)]
Auto merge of #77792 - matthewjasper:instrument-trait-selection, r=oli-obk

Use tracing spans in rustc_trait_selection

Spans are very helpful when debugging this code. It's also hot enough to make a good benchmark.

r? `@oli-obk`

3 years agoBless expected errors
Ethan Brierley [Mon, 12 Oct 2020 21:27:59 +0000 (22:27 +0100)]
Bless expected errors

3 years agoInclude `llvm-dis`, `llc` and `opt` in `llvm-tools-preview` component
Aaron Hill [Mon, 12 Oct 2020 20:02:48 +0000 (16:02 -0400)]
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 agoAuto merge of #77847 - Xanewok:update-rls, r=Xanewok
bors [Mon, 12 Oct 2020 21:03:35 +0000 (21:03 +0000)]
Auto merge of #77847 - Xanewok:update-rls, r=Xanewok

Update RLS

cc #77819
Fixes #77810

r? `@ghost`

3 years agoA little rewording
Ethan Brierley [Mon, 12 Oct 2020 20:58:06 +0000 (15:58 -0500)]
A little rewording

Co-authored-by: varkor <github@varkor.com>
3 years agoRemove a little jargon from error
Ethan Brierley [Mon, 12 Oct 2020 20:57:04 +0000 (15:57 -0500)]
Remove a little jargon from error

Co-authored-by: varkor <github@varkor.com>
3 years agoConfigure jemalloc for cross-compilation to aarch64-apple-darwin
Jake Goulding [Sun, 27 Sep 2020 17:27:29 +0000 (13:27 -0400)]
Configure jemalloc for cross-compilation to aarch64-apple-darwin

3 years agoMade a submodule for fn_ctxt
Nicholas-Baron [Mon, 12 Oct 2020 18:57:29 +0000 (11:57 -0700)]
Made a submodule for fn_ctxt

3 years agoAuto merge of #77867 - JohnTitor:rollup-0odg1n4, r=JohnTitor
bors [Mon, 12 Oct 2020 19:09:08 +0000 (19:09 +0000)]
Auto merge of #77867 - JohnTitor:rollup-0odg1n4, r=JohnTitor

Rollup of 10 pull requests

Successful merges:

 - #77550 (add shims for WithOptConstParam query calls)
 - #77699 (Add word wrap for short descriptions)
 - #77724 (Implement `AsRawFd` for `StdinLock` etc. on WASI.)
 - #77746 (Fix `x.py setup` sets `changelog-seen`)
 - #77784 (Fix intra-docs link in core::ffi::VaList)
 - #77811 (rustdoc: Make some functions private that don't need to be public)
 - #77818 (Mono collector: replace pair of ints with Range)
 - #77831 (Use std methods on char instead of open coding them)
 - #77852 (update url in bootstrap README (gcc-rs -> cc-rs))
 - #77863 (Remove `mark-i-m` from rustc-dev-guide maintainers)

Failed merges:

r? `@ghost`

3 years agoRollup merge of #77863 - JohnTitor:remove-mark-i-m, r=pietroalbini
Yuki Okushi [Mon, 12 Oct 2020 19:08:07 +0000 (04:08 +0900)]
Rollup merge of #77863 - JohnTitor:remove-mark-i-m, r=pietroalbini

Remove `mark-i-m` from rustc-dev-guide maintainers

They aren't a maintainer anymore and it causes failure on our CI now: https://github.com/rust-lang-ci/rust/runs/1243600577

3 years agoRollup merge of #77852 - 12101111:fix-bootstrap-doc, r=jonas-schievink
Yuki Okushi [Mon, 12 Oct 2020 19:08:05 +0000 (04:08 +0900)]
Rollup merge of #77852 - 12101111:fix-bootstrap-doc, r=jonas-schievink

update url in bootstrap README (gcc-rs -> cc-rs)

gcc-rs is renamed to cc-rs 3 years ago.

3 years agoRollup merge of #77831 - LingMan:use_std, r=jonas-schievink
Yuki Okushi [Mon, 12 Oct 2020 19:08:03 +0000 (04:08 +0900)]
Rollup merge of #77831 - LingMan:use_std, r=jonas-schievink

Use std methods on char instead of open coding them

3 years agoRollup merge of #77818 - bugadani:range, r=oli-obk
Yuki Okushi [Mon, 12 Oct 2020 19:08:02 +0000 (04:08 +0900)]
Rollup merge of #77818 - bugadani:range, r=oli-obk

Mono collector: replace pair of ints with Range

I found the initial PR (#33171) that introduced this piece of code but I didn't find any information about why a tuple was preferred over a `Range<usize>`.

I'm hoping there are no technical reasons to not do this.

3 years agoRollup merge of #77811 - jyn514:private, r=GuillaumeGomez
Yuki Okushi [Mon, 12 Oct 2020 19:08:00 +0000 (04:08 +0900)]
Rollup merge of #77811 - jyn514:private, r=GuillaumeGomez

rustdoc: Make some functions private that don't need to be public

r? @GuillaumeGomez

3 years agoRollup merge of #77784 - aDotInTheVoid:ffi-sealed_trait-intra-docs, r=jyn514
Yuki Okushi [Mon, 12 Oct 2020 19:07:58 +0000 (04:07 +0900)]
Rollup merge of #77784 - aDotInTheVoid:ffi-sealed_trait-intra-docs, r=jyn514

Fix intra-docs link in core::ffi::VaList

At some point, `VaList` was changes to be a [wrapper](https://github.com/rust-lang/rust/blob/1661f77/library/core/src/ffi.rs#L177-L201) over `VaListImpl`, and now the `Arg` method exists on [`VaListImpl`](https://github.com/rust-lang/rust/blob/1661f77/library/core/src/ffi.rs#L333-L336). This PR fixes the intradoc links so that when `--document-private-items` is ran on std (via [patch](https://gist.github.com/aDotInTheVoid/42c82306210203f9c9093c952b765ab4)), it works

3 years agoRollup merge of #77746 - winnayx:issue-77572-fix, r=jyn514
Yuki Okushi [Mon, 12 Oct 2020 19:07:56 +0000 (04:07 +0900)]
Rollup merge of #77746 - winnayx:issue-77572-fix, r=jyn514

Fix `x.py setup` sets `changelog-seen`

Fixes #77572 by setting changelog-seen in setup.rs

3 years agoRollup merge of #77724 - sunfishcode:stdinlock-asrawfd, r=alexcrichton
Yuki Okushi [Mon, 12 Oct 2020 19:07:54 +0000 (04:07 +0900)]
Rollup merge of #77724 - sunfishcode:stdinlock-asrawfd, r=alexcrichton

Implement `AsRawFd` for `StdinLock` etc. on WASI.

WASI implements `AsRawFd` for `Stdin`, `Stdout`, and `Stderr`, so
implement it for `StdinLock`, `StdoutLock`, and `StderrLock` as well.

r? @alexcrichton

3 years agoRollup merge of #77699 - GuillaumeGomez:word-wrap, r=XAMPPRocky
Yuki Okushi [Mon, 12 Oct 2020 19:07:52 +0000 (04:07 +0900)]
Rollup merge of #77699 - GuillaumeGomez:word-wrap, r=XAMPPRocky

Add word wrap for short descriptions

Fixes #77652

![Screenshot from 2020-10-08 13-26-18](https://user-images.githubusercontent.com/3050060/95452770-11845280-096a-11eb-80da-723da85261fa.png)

cc @WaffleLapkin
r? @jyn514

3 years agoRollup merge of #77550 - lcnr:ty-dep-path-ct-cleanup, r=ecstatic-morse
Yuki Okushi [Mon, 12 Oct 2020 19:07:50 +0000 (04:07 +0900)]
Rollup merge of #77550 - lcnr:ty-dep-path-ct-cleanup, r=ecstatic-morse

add shims for WithOptConstParam query calls

r? @ecstatic-morse @eddyb

3 years agoRemove `mark-i-m` from rustc-dev-guide maintainers
Yuki Okushi [Mon, 12 Oct 2020 18:13:00 +0000 (03:13 +0900)]
Remove `mark-i-m` from rustc-dev-guide maintainers

3 years agoEnable building Cargo for aarch64-apple-darwin
Jake Goulding [Sat, 26 Sep 2020 13:42:04 +0000 (09:42 -0400)]
Enable building Cargo for aarch64-apple-darwin

3 years agoUpgrade OpenSSL to 1.1.1h and add support for aarch64-apple-darwin
Jake Goulding [Mon, 12 Oct 2020 17:56:07 +0000 (13:56 -0400)]
Upgrade OpenSSL to 1.1.1h and add support for aarch64-apple-darwin

3 years agobuild-manifest: bundle the rustc version in the binary
Pietro Albini [Mon, 12 Oct 2020 17:40:35 +0000 (19:40 +0200)]
build-manifest: bundle the rustc version in the binary

3 years agobuild-manifest: use var_os instead of var to check if vars exist
Pietro Albini [Mon, 12 Oct 2020 17:34:01 +0000 (19:34 +0200)]
build-manifest: use var_os instead of var to check if vars exist

This will prevent the tool mistakenly ignoring the variables if they
happen to contain non-utf8 data.

3 years agobuild-manifest: allow configuring the number of threads
Pietro Albini [Mon, 12 Oct 2020 15:47:37 +0000 (17:47 +0200)]
build-manifest: allow configuring the number of threads

3 years agoci: also build the build-manifest component on dist-x86_64-linux
Pietro Albini [Fri, 9 Oct 2020 17:53:48 +0000 (19:53 +0200)]
ci: also build the build-manifest component on dist-x86_64-linux

3 years agobootstrap: add --include-default-paths to ./x.py
Pietro Albini [Fri, 9 Oct 2020 17:51:07 +0000 (19:51 +0200)]
bootstrap: add --include-default-paths to ./x.py

3 years agobootstrap: add disabled by default build-manifest dist component
Pietro Albini [Fri, 9 Oct 2020 17:49:13 +0000 (19:49 +0200)]
bootstrap: add disabled by default build-manifest dist component

3 years agobuild-manifest: accept the Rust version instead of the monorepo path
Pietro Albini [Fri, 9 Oct 2020 13:34:57 +0000 (15:34 +0200)]
build-manifest: accept the Rust version instead of the monorepo path

This commit changes the way build-manifest is invoked, to let it accept
the Rust version directly instead of requiring the path of the Rust
monorepo and letting build-manifest figure out the path on its own.

This allows to run build-manifest without a clone of the monorepo.

3 years agoAuto merge of #77854 - pietroalbini:ETOOMANYCHANNELS, r=Mark-Simulacrum
bors [Mon, 12 Oct 2020 15:50:36 +0000 (15:50 +0000)]
Auto merge of #77854 - pietroalbini:ETOOMANYCHANNELS, r=Mark-Simulacrum

build-manifest: stop generating numbered channel names except for stable

This fixes numbered channel names being created for the nightly channel, and once the root cause of this rides the trains, for beta.

r? `@Mark-Simulacrum`

3 years agobuild-manifest: stop generating numbered channel names except for stable
Pietro Albini [Mon, 12 Oct 2020 15:39:13 +0000 (17:39 +0200)]
build-manifest: stop generating numbered channel names except for stable

This fixes numbered channel names being created for the nightly channel,
and once the root cause of this rides the trains, for beta.

3 years agoAdd word-wrap rule for short descriptions
Guillaume Gomez [Thu, 8 Oct 2020 11:25:36 +0000 (13:25 +0200)]
Add word-wrap rule for short descriptions

3 years agoupdate url in bootstrap README
12101111 [Mon, 12 Oct 2020 13:17:11 +0000 (21:17 +0800)]
update url in bootstrap README