bors [Wed, 3 Feb 2021 03:03:08 +0000 (03:03 +0000)]
Auto merge of #81535 - nikic:update-test-various, r=sanxiyn
Update test-various to Ubuntu 20.04
The test command-setgroups.rs is adjusted to skip on musl, where `sysconf(_SC_NGROUPS_MAX)` always returns a dummy value of 32, even though the actual value is 65536. I'm not sure why this only became a problem now, as the information I found indicates that this value changed in kernel version 2.6.4, which is ages ago.
I'm a bit unsure whether this one will go through, because I locally also saw a failure in std-backtrace.rs which went away on subsequent runs, and also had port assignment failures, but I think those might be on my side. I'm kind of curious how the code in https://github.com/rust-lang/rust/blob/b122908617436af187252572ed5db96850551380/library/std/src/net/test.rs#L43-L56 is supposed to work, as the directory names it checks don't seem to appear anywhere else.
bors [Tue, 2 Feb 2021 23:15:22 +0000 (23:15 +0000)]
Auto merge of #81678 - jackh726:rollup-3nerni4, r=jackh726
Rollup of 14 pull requests
Successful merges:
- #80593 (Upgrade Chalk)
- #81260 (Add .editorconfig)
- #81455 (Add AArch64 big-endian and ILP32 targets)
- #81517 (Remove remnants of the santizer runtime crates from bootstrap)
- #81530 (sys: use `process::abort()` instead of `arch::wasm32::unreachable()`)
- #81544 (Add better diagnostic for unbounded Abst. Const)
- #81588 (Add doc aliases for "delete")
- #81603 (rustbuild: Don't build compiler twice for error-index-generator.)
- #81634 (Add long explanation e0521)
- #81636 (Directly use `Option<&[T]>` instead of converting from `Option<&Vec<T>>` later on)
- #81647 (Fix bug with assert!() calling the wrong edition of panic!().)
- #81655 (Improve wording of suggestion about accessing field)
- #81665 (Fix out of date `Scalar` documentation)
- #81671 (Add more associated type tests)
Jack Huey [Tue, 2 Feb 2021 21:01:48 +0000 (16:01 -0500)]
Rollup merge of #81655 - matsujika:suggest-accessing-field-rewording, r=estebank
Improve wording of suggestion about accessing field
Follow-up to #81504
The compiler at this moment suggests "you might have meant to use field `b` of type `B`", sounding like it's type `B` which has the field `b`.
r? ```@estebank```
Jack Huey [Tue, 2 Feb 2021 21:01:42 +0000 (16:01 -0500)]
Rollup merge of #81603 - ehuss:error-index-build, r=Mark-Simulacrum
rustbuild: Don't build compiler twice for error-index-generator.
When using `--stage=1`, the error-index-generator was forcing the compiler to be built twice. This isn't necessary; the error-index-generator just needs the same unusual logic that rustdoc uses to build with stage minus one.
`--stage=0` and `--stage=2` should be unaffected by this change.
Jack Huey [Tue, 2 Feb 2021 21:01:39 +0000 (16:01 -0500)]
Rollup merge of #81544 - JulianKnodt:sat_where, r=lcnr
Add better diagnostic for unbounded Abst. Const
~~In the case where a generic abst. const requires a trivial where bound: `where TypeWithConst<const_fn(N)>: ,`,
instead of requiring a where bound, just check that only consts are being substituted in to skip over where check.~~
~~This is pretty sketchy, but I think it works. Presumably, if there is checking for type bounds added later, it can first check nested requirements, and see if they're satisfied by the current `ParamEnv`.~~
Changed the diagnostic to add a better example, which is more practical than what was previously proposed.
Jack Huey [Tue, 2 Feb 2021 21:01:38 +0000 (16:01 -0500)]
Rollup merge of #81530 - ojeda:sys-use-abort-instead-of-wasm32-unreachable, r=Mark-Simulacrum
sys: use `process::abort()` instead of `arch::wasm32::unreachable()`
Rationale:
- `abort()` lowers to `wasm32::unreachable()` anyway.
- `abort()` isn't `unsafe`.
- `abort()` matches the comment better.
- `abort()` avoids confusion by future readers (e.g. https://github.com/rust-lang/rust/pull/81527): the naming of wasm's `unreachable` instruction is a bit unfortunate because it is not related to the `unreachable()` intrinsic (intended to trigger UB).
Codegen is likely to be different since `unreachable()` is `inline` while `abort()` is `cold`. Since it doesn't look like we are expecting here to trigger this case, the latter seems better anyway.
Jack Huey [Tue, 2 Feb 2021 21:01:33 +0000 (16:01 -0500)]
Rollup merge of #81260 - vn971:restore-editorconfig, r=Mark-Simulacrum
Add .editorconfig
This adds a .editorconfig file to rust-lang/rust, matching Clippy's. It's not clear that this will benefit many people, but the cost is low and the rewards are potentially meaningful.
Jack Huey [Tue, 2 Feb 2021 21:01:32 +0000 (16:01 -0500)]
Rollup merge of #80593 - jackh726:chalk-upgrade, r=nikomatsakis
Upgrade Chalk
~~Blocked on rust-lang/chalk#670~~
~~Now blocked on rust-lang/chalk#680 and release~~
In addition to the straight upgrade, I also tried to fix some tests by properly returning variables and max universes in the solution. Unfortunately, this actually triggers the same perf problem that rustc traits code runs into in `canonicalizer`. Not sure what the root cause of this problem is, or why it's supposed to be solved in chalk.
bors [Tue, 2 Feb 2021 20:27:09 +0000 (20:27 +0000)]
Auto merge of #81541 - Aaron1011:early-lint-async-fn, r=petrochenkov
Fix early lints inside an async desugaring
Fixes #81531
When we buffer an early lint for a macro invocation,
we need to determine which NodeId to take the lint level from.
Currently, we use the NodeId of the closest def parent. However, if
the macro invocation is inside the desugared closure from an `async fn`
or async closure, that NodeId does not actually exist in the AST.
This commit uses the parent of a desugared closure when computing
`lint_node_id`, which is something that actually exists in the AST (an
`async fn` or async closure).
Aaron Hill [Sat, 30 Jan 2021 00:03:20 +0000 (19:03 -0500)]
Fix early lints inside an async desugaring
Fixes #81531
When we buffer an early lint for a macro invocation,
we need to determine which NodeId to take the lint level from.
Currently, we use the `NodeId` of the closest def parent. However, if
the macro invocation is inside the desugared closure from an `async fn`
or async closure, that `NodeId` does not actually exist in the AST.
This commit explicitly calls `check_lint` for the `NodeId`s of closures
desugared from async expressions, ensuring that we do not miss any
buffered lints.
Vasili Novikov [Fri, 22 Jan 2021 08:51:23 +0000 (09:51 +0100)]
Add .editorconfig
Editorconfig is a lightweight specification that
helps maintaining consistent coding/formatting style
accross editors, especially those editors
that are not explicitly aware of Rust and rustfmt.
bors [Tue, 2 Feb 2021 12:02:36 +0000 (12:02 +0000)]
Auto merge of #81660 - jonas-schievink:rollup-fz2lh78, r=jonas-schievink
Rollup of 11 pull requests
Successful merges:
- #80629 (Add lint for 2229 migrations)
- #81022 (Add Frames Iterator for Backtrace)
- #81481 (move some tests)
- #81485 (Add some tests for associated-type-bounds issues)
- #81492 (rustdoc: Note why `rustdoc::html::markdown` is public)
- #81577 (const_evaluatable: consider sub-expressions to be evaluatable)
- #81599 (Implement `TrustedLen` for `Fuse<I: TrustedLen>`)
- #81608 (Improve handling of spans around macro result parse errors)
- #81609 (Remove the remains of query categories)
- #81630 (Fix overflowing text on mobile when sidebar is displayed)
- #81631 (Remove unneeded `mut` variable)
Jonas Schievink [Tue, 2 Feb 2021 11:15:08 +0000 (12:15 +0100)]
Rollup merge of #81631 - LingMan:rem_var, r=davidtwco
Remove unneeded `mut` variable
`arg_elide` gets initialized, immediately cloned, and only written to after that.
The last reading access was removed back in
https://github.com/rust-lang/rust/commit/7704762604a8bf4504a06e8c9713bc7c158d362a
Jonas Schievink [Tue, 2 Feb 2021 11:15:04 +0000 (12:15 +0100)]
Rollup merge of #81609 - Julian-Wollersberger:no-query-categories, r=davidtwco
Remove the remains of query categories
Back in October 2020 in #77830 ``@cjgillot`` removed the query categories information from the profiler, but the actual definitions which query was in which category remained, although unused.
Here I clean that up, to simplify the query definitions even further.
It's unfortunate that this loses all the context for `git blame`, ~~but I'm working on moving those query definitions into `rustc_query_system`, which will lose that context anyway.~~ EDIT: Might not work out.
The functional changes are in the first commit. The second one only changes the indentation.
Jonas Schievink [Tue, 2 Feb 2021 11:15:02 +0000 (12:15 +0100)]
Rollup merge of #81608 - Aaron1011:macro-res-parse-err, r=davidtwco
Improve handling of spans around macro result parse errors
Fixes #81543
After we expand a macro, we try to parse the resulting tokens as a AST
node. This commit makes several improvements to how we handle spans when
an error occurs:
* Only ovewrite the original `Span` if it's a dummy span. This preserves
a more-specific span if one is available.
* Use `self.prev_token` instead of `self.token` when emitting an error
message after encountering EOF, since an EOF token always has a dummy
span
* Make `SourceMap::next_point` leave dummy spans unused. A dummy span
does not have a logical 'next point', since it's a zero-length span.
Re-using the span span preserves its 'dummy-ness' for other checks
Jonas Schievink [Tue, 2 Feb 2021 11:14:59 +0000 (12:14 +0100)]
Rollup merge of #81577 - BoxyUwU:subexpr_const_evaluatable, r=oli-obk
const_evaluatable: consider sub-expressions to be evaluatable
see [zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/260443-project-const-generics/topic/const_evaluatable.3A.20subexpressions) for more info
Jonas Schievink [Tue, 2 Feb 2021 11:14:57 +0000 (12:14 +0100)]
Rollup merge of #81492 - camelid:rustdoc-internal-mod-vis, r=GuillaumeGomez
rustdoc: Note why `rustdoc::html::markdown` is public
Almost all of the modules are crate-private, except for
`rustdoc::json::types`, which I believe is intended to be for public
use; and `rustdoc::html::markdown`, which is used externally by the
error-index generator and so has to be public.
#47897 is likely closable too, but it needs an MCVE
~~#38917, #40093, #43475, #47897 all are mislabeled and shouldn't have the `F-associated-type-bounds` label~~
~~#71685 is also mislabeled as commented on in that thread~~
Jonas Schievink [Tue, 2 Feb 2021 11:14:44 +0000 (12:14 +0100)]
Rollup merge of #80629 - sexxi-goose:migrations_1, r=nikomatsakis
Add lint for 2229 migrations
Implements the first for RFC 2229 where we make the decision to migrate a root variable based on if the type of the variable needs Drop and if the root variable would be moved into the closure when the feature isn't enabled.
Originally I've copied `@Shnatsel's` [implementation](https://github.com/WanzenBug/rle-decode-helper/blob/690742a0de158d391b7bde1a0c71cccfdad33ab3/src/lib.rs#L74) with some minor changes to support other ranges:
```rust
pub fn append_from_within<R>(&mut self, src: R)
where
T: Copy,
R: RangeBounds<usize>,
{
let len = self.len();
let Range { start, end } = src.assert_len(len);;
let count = end - start;
self.reserve(count);
unsafe {
// This is safe because `reserve()` above succeeded,
// so `self.len() + count` did not overflow usize
ptr::copy_nonoverlapping(
self.get_unchecked(src.start),
self.as_mut_ptr().add(len),
count,
);
self.set_len(len + count);
}
}
```
But then I've realized that this duplicates most of the code from (private) `Vec::append_elements`, so I've used it instead.
Then I've applied `@KodrAus` suggestions from https://github.com/rust-lang/rust/pull/79015#issuecomment-727200852.
bors [Tue, 2 Feb 2021 06:23:10 +0000 (06:23 +0000)]
Auto merge of #81539 - nikic:update-armhf-gnu, r=sanxiyn
Update armhf-gnu to Ubuntu 20.04
This requires updating the used Linux kernel to avoid an assembler
error, the used busybox version to avoid a linker error, the used
rootfs to match the host version and the qemu flags to work with
the newer version.
bors [Tue, 2 Feb 2021 03:33:07 +0000 (03:33 +0000)]
Auto merge of #81651 - ehuss:update-cargo, r=ehuss
Update cargo
5 commits in c3abcfe8a75901c7c701557a728941e8fb19399e..e099df243bb2495b9b197f79c19f124032b1e778
2021-01-25 16:16:43 +0000 to 2021-02-01 16:24:34 +0000
- Impl warn for locked install without Cargo.lock (rust-lang/cargo#9108)
- Document -Z extra-link-arg. (rust-lang/cargo#9121)
- Flip 'foo' and 'bar' to be consistent (rust-lang/cargo#9120)
- Don't try to parse MSRV if feature is not enabled (rust-lang/cargo#9115)
- simplify char range check (rust-lang/cargo#9110)
Aman Arora [Sat, 21 Nov 2020 09:23:42 +0000 (04:23 -0500)]
Process mentioned upvars for analysis first pass after ExprUseVisitor
- This allows us add fake information after handling migrations if
needed.
- Capture analysis also priortizes what we see earlier, which means
fake information should go in last.
LingMan [Wed, 20 Jan 2021 01:48:48 +0000 (02:48 +0100)]
Remove unneeded `mut` variable
`arg_elide` gets initialized, immediately cloned, and only written to after that.
The last reading access was removed back in
https://github.com/rust-lang/rust/commit/7704762604a8bf4504a06e8c9713bc7c158d362a
Jonas Schievink [Mon, 1 Feb 2021 13:29:47 +0000 (14:29 +0100)]
Rollup merge of #81618 - bjorn3:sync_cg_clif-2021-02-01, r=bjorn3
Sync rustc_codegen_cranelift
The highlight of this sync are abi compatibility with cg_llvm allowing mixing of cg_clif and cg_llvm compiled crates and switching to the x64 cranelift backend based on the new backend framework.
Jonas Schievink [Mon, 1 Feb 2021 13:29:44 +0000 (14:29 +0100)]
Rollup merge of #81594 - bjorn3:avoid_building_llvm_for_dwp, r=sanxiyn
Avoid building LLVM just for llvm-dwp
When the LLVM backend is disabled, the llvm-project submodule is not checked out by default. This breaks the bootstrap test for cg_clif. As cg_clif doesn't support split debuginfo anyway llvm-dwp is not necessary. Other backends would likely not want to build LLVM just for llvm-dwp either.
The second commit fixes a small bug. On tablets or computer with very little width, the search section goes "over" the search input, making it impossible to click on the search input:
The wheel is going over the search input and the search tab is going under the search results text. The bug was fixed by simply switching to "mobile mode" at a bigger width:
Jonas Schievink [Mon, 1 Feb 2021 13:29:40 +0000 (14:29 +0100)]
Rollup merge of #81536 - tgnottingham:time-passes-rss, r=oli-obk
Indicate both start and end of pass RSS in time-passes output
Previously, only the end of pass RSS was indicated. This could easily
lead one to believe that the change in RSS from one pass to the next was
attributable to the second pass, when in fact it occurred between the
end of the first pass and the start of the second.
Jonas Schievink [Mon, 1 Feb 2021 13:29:35 +0000 (14:29 +0100)]
Rollup merge of #81463 - matsujika:nll-ensure-c-case, r=varkor
Rename NLL* to Nll* accordingly to C-CASE
Given [C-CASE](https://rust-lang.github.io/api-guidelines/naming.html#casing-conforms-to-rfc-430-c-case), `NLLRegionVariableOrigin` and `NLL` are encouraged to be `NllRegionVariableOrigin` and `Nll` respectively.
Jonas Schievink [Mon, 1 Feb 2021 13:29:28 +0000 (14:29 +0100)]
Rollup merge of #78641 - the8472:buffered-copy, r=sfackler
Let io::copy reuse BufWriter buffers
This optimization will allow users to implicitly set the buffer size for io::copy by wrapping the writer into a `BufWriter` if the default block size is insufficient, which should fix #49921
Due to min_specialization limitations this approach only works with `BufWriter` but not for `BufReader<R>` since `R` is unconstrained and thus the necessary specialization on `R: Read` is not always applicable. Once specialization becomes more powerful this optimization could be extended to look at the reader and writer side and use whichever buffer is larger.
bors [Mon, 1 Feb 2021 10:25:31 +0000 (10:25 +0000)]
Auto merge of #80851 - m-ou-se:panic-2021, r=petrochenkov
Implement Rust 2021 panic
This implements the Rust 2021 versions of `panic!()`. See https://github.com/rust-lang/rust/issues/80162 and https://github.com/rust-lang/rfcs/pull/3007.
It does so by replacing `{std, core}::panic!()` by a bulitin macro that expands to either `$crate::panic::panic_2015!(..)` or `$crate::panic::panic_2021!(..)` depending on the edition of the caller.
This does not yet make std's panic an alias for core's panic on Rust 2021 as the RFC proposes. That will be a separate change: https://github.com/rust-lang/rust/pull/80879/commits/c5273bdfb266c35e8eab9413aa8d58d27fdbe114 That change is blocked on figuring out what to do with https://github.com/rust-lang/rust/issues/80846 first.
Camelid [Thu, 28 Jan 2021 23:51:54 +0000 (15:51 -0800)]
rustdoc: Note why `rustdoc::html::markdown` is public
Almost all of the modules are crate-private, except for
`rustdoc::json::types`, which I believe is intended to be for public
use; and `rustdoc::html::markdown`, which is used externally by the
error-index generator and so has to be public.
bors [Sun, 31 Jan 2021 23:45:37 +0000 (23:45 +0000)]
Auto merge of #81596 - jonas-schievink:rollup-utk14gr, r=jonas-schievink
Rollup of 11 pull requests
Successful merges:
- #80092 (2229: Fix issues with move closures and mutability)
- #80404 (Remove const_in_array_repeat)
- #81255 (Don't link with --export-dynamic on wasm32-wasi)
- #81480 (Add suggestion for nested fields)
- #81549 (Misc ip documentation fixes)
- #81566 (Add a test for #71202)
- #81568 (Fix an old FIXME in redundant paren lint)
- #81571 (Fix typo in E0759)
- #81572 (Edit multiple error code Markdown files)
- #81589 (Fix small typo in string.rs)
- #81590 (Stabilize int_bits_const)