Michael Goulet [Fri, 6 May 2022 02:34:24 +0000 (19:34 -0700)]
Rollup merge of #96704 - GuillaumeGomez:rotation-animation, r=jsha
Add rotation animation on settings button when loading
As discussed, I added an animation when the settings JS file is loading (I voluntarily made the timeout at the end of the `settings.js` super long so we can see what the animation looks like):
Michael Goulet [Fri, 6 May 2022 02:34:23 +0000 (19:34 -0700)]
Rollup merge of #96639 - adpaco-aws:fix-offset-from-typo, r=scottmcm
Fix typo in `offset_from` documentation
Small fix for what I think is a typo in the `offset_from` documentation.
Someone reading this may understand that the distance in bytes is obtained by dividing the distance by `mem::size_of::<T>()`, but here we just want to define "units of T" in terms of bytes (i.e., units of T == bytes / `mem::size_of::<T>()`).
Michael Goulet [Fri, 6 May 2022 02:34:22 +0000 (19:34 -0700)]
Rollup merge of #96174 - RalfJung:no-run-transmute, r=scottmcm
mark ptr-int-transmute test as no_run
This causes [CI failures in Miri](https://github.com/rust-lang/miri-test-libstd/runs/6062500259?check_suite_focus=true) since ptr-int-transmutes are rejected there (when strict provenance is enabled).
bors [Thu, 5 May 2022 16:59:54 +0000 (16:59 +0000)]
Auto merge of #96734 - matthiaskrgr:rollup-hng33tb, r=matthiaskrgr
Rollup of 7 pull requests
Successful merges:
- #95359 (Update `int_roundings` methods from feedback)
- #95843 (Improve Rc::new_cyclic and Arc::new_cyclic documentation)
- #96507 (Suggest calling `Self::associated_function()`)
- #96635 (Use "strict" mode in JS scripts)
- #96673 (Report that opaque types are not allowed in impls even in the presence of other errors)
- #96682 (Show invisible delimeters (within comments) when pretty printing.)
- #96714 (interpret/validity: debug-check ScalarPair layout information)
Matthias Krüger [Thu, 5 May 2022 13:43:05 +0000 (15:43 +0200)]
Rollup merge of #96673 - oli-obk:tait_impl_diagnostic, r=petrochenkov
Report that opaque types are not allowed in impls even in the presence of other errors
fixes #96569
before this PR those useful errors were hidden because either `unused parameter` or `only traits defined in the current crate can be implemented for arbitrary types` got emitted first.
Matthias Krüger [Thu, 5 May 2022 13:43:00 +0000 (15:43 +0200)]
Rollup merge of #95359 - jhpratt:int_roundings, r=joshtriplett
Update `int_roundings` methods from feedback
This updates `#![feature(int_roundings)]` (#88581) from feedback. All methods now take `NonZeroX`. The documentation makes clear that they panic in debug mode and wrap in release mode.
bors [Thu, 5 May 2022 13:12:09 +0000 (13:12 +0000)]
Auto merge of #8788 - flip1995:rustup, r=xFrednet,flip1995
Rustup
r? `@ghost`
changelog: move trait_duplication_in_bounds and type_repetition_in_bounds to nursery temporarily. This could already be reverted before the release. Check the Clippy in the Rust repo beta branch when writing this changelog.
flip1995 [Thu, 5 May 2022 12:32:31 +0000 (13:32 +0100)]
HACK: Move buggy lints to nursery
Those lints are trait_duplication_in_bounds and
type_repetition_in_bounds. I don't think those can be fixed on the
Clippy side alone, but need changes in the compiler. So let's move them
to nursery to get the sync through and then fix them on the rustc side.
Also adds a regression test that has to be fixed before they can be
moved back to pedantic.
bors [Thu, 5 May 2022 05:08:44 +0000 (05:08 +0000)]
Auto merge of #96626 - thomcc:rand-bump, r=m-ou-se
Avoid using `rand::thread_rng` in the stdlib benchmarks.
This is kind of an anti-pattern because it introduces extra nondeterminism for no real reason. In thread_rng's case this comes both from the random seed and also from the reseeding operations it does, which occasionally does syscalls (which adds additional nondeterminism). The impact of this would be pretty small in most cases, but it's a good practice to avoid (particularly because avoiding it was not hard).
Anyway, several of our benchmarks already did the right thing here anyway, so the change was pretty easy and mostly just applying it more universally. That said, the stdlib benchmarks aren't particularly stable (nor is our benchmark framework particularly great), so arguably this doesn't matter that much in practice.
~~Anyway, this also bumps the `rand` dev-dependency to 0.8, since it had fallen somewhat out of date.~~ Nevermind, too much of a headache.
bors [Thu, 5 May 2022 02:49:16 +0000 (02:49 +0000)]
Auto merge of #96720 - JohnTitor:rollup-9jaaekr, r=JohnTitor
Rollup of 7 pull requests
Successful merges:
- #96603 (Enable full revision in const generics ui tests)
- #96616 (Relax memory ordering used in `min_stack`)
- #96619 (Relax memory ordering used in SameMutexCheck)
- #96628 (Stabilize `bool::then_some`)
- #96658 (Move callback to the () => {} syntax.)
- #96677 (Add more tests for label-break-value)
- #96697 (Enable tracing for all queries)
the regex `.*` in the key name are because the key is a debug printed DefId, so you'd get all kinds of things like hashes in there. The tracing logs will show you the key, so you can restrict it further if you want.
Yuki Okushi [Thu, 5 May 2022 01:20:37 +0000 (10:20 +0900)]
Rollup merge of #96677 - jyn514:label-break-value-tests, r=petrochenkov
Add more tests for label-break-value
Helps with https://github.com/rust-lang/rust/issues/48594. The tests are adapted from https://github.com/rust-lang/rust/issues/48594#issuecomment-421625182.
Yuki Okushi [Thu, 5 May 2022 01:20:34 +0000 (10:20 +0900)]
Rollup merge of #96619 - akiekintveld:same_mutex_check_relaxed_ordering, r=m-ou-se
Relax memory ordering used in SameMutexCheck
`SameMutexCheck` only requires atomicity for `self.addr`, but does not need ordering of other memory accesses in either the success or failure case. Using `Relaxed`, the code still correctly handles the case when two threads race to store an address.
Yuki Okushi [Thu, 5 May 2022 01:20:33 +0000 (10:20 +0900)]
Rollup merge of #96616 - akiekintveld:min_stack_relaxed_ordering, r=joshtriplett
Relax memory ordering used in `min_stack`
`min_stack` does not provide any synchronization guarantees to its callers, and only requires atomicity for `MIN` itself, so relaxed memory ordering is sufficient.
bors [Thu, 5 May 2022 00:24:48 +0000 (00:24 +0000)]
Auto merge of #96593 - jackh726:issue-93262, r=compiler-errors
Revert "Prefer projection candidates instead of param_env candidates for Sized predicates"
Fixes #93262
Reopens #89352
This was a hack that seemed to have no negative side-effects at the time. Given that the latter has a workaround and likely less common than the former, it makes sense to revert this change.
bors [Wed, 4 May 2022 21:16:28 +0000 (21:16 +0000)]
Auto merge of #96546 - nnethercote:overhaul-MacArgs, r=petrochenkov
Overhaul `MacArgs`
Motivation:
- Clarify some code that I found hard to understand.
- Eliminate one use of three places where `TokenKind::Interpolated` values are created.
bors [Wed, 4 May 2022 21:16:28 +0000 (21:16 +0000)]
Auto merge of #96546 - nnethercote:overhaul-MacArgs, r=petrochenkov
Overhaul `MacArgs`
Motivation:
- Clarify some code that I found hard to understand.
- Eliminate one use of three places where `TokenKind::Interpolated` values are created.
The value in `MacArgs::Eq` is currently represented as a `Token`.
Because of `TokenKind::Interpolated`, `Token` can be either a token or
an arbitrary AST fragment. In practice, a `MacArgs::Eq` starts out as a
literal or macro call AST fragment, and then is later lowered to a
literal token. But this is very non-obvious. `Token` is a much more
general type than what is needed.
This commit restricts things, by introducing a new type `MacArgsEqKind`
that is either an AST expression (pre-lowering) or an AST literal
(post-lowering). The downside is that the code is a bit more verbose in
a few places. The benefit is that makes it much clearer what the
possibilities are (though also shorter in some other places). Also, it
removes one use of `TokenKind::Interpolated`, taking us a step closer to
removing that variant, which will let us make `Token` impl `Copy` and
remove many "handle Interpolated" code paths in the parser.
Things to note:
- Error messages have improved. Messages like this:
```
unexpected token: `"bug" + "found"`
```
now say "unexpected expression", which makes more sense. Although
arbitrary expressions can exist within tokens thanks to
`TokenKind::Interpolated`, that's not obvious to anyone who doesn't
know compiler internals.
- In `parse_mac_args_common`, we no longer need to collect tokens for
the value expression.
The value in `MacArgs::Eq` is currently represented as a `Token`.
Because of `TokenKind::Interpolated`, `Token` can be either a token or
an arbitrary AST fragment. In practice, a `MacArgs::Eq` starts out as a
literal or macro call AST fragment, and then is later lowered to a
literal token. But this is very non-obvious. `Token` is a much more
general type than what is needed.
This commit restricts things, by introducing a new type `MacArgsEqKind`
that is either an AST expression (pre-lowering) or an AST literal
(post-lowering). The downside is that the code is a bit more verbose in
a few places. The benefit is that makes it much clearer what the
possibilities are (though also shorter in some other places). Also, it
removes one use of `TokenKind::Interpolated`, taking us a step closer to
removing that variant, which will let us make `Token` impl `Copy` and
remove many "handle Interpolated" code paths in the parser.
Things to note:
- Error messages have improved. Messages like this:
```
unexpected token: `"bug" + "found"`
```
now say "unexpected expression", which makes more sense. Although
arbitrary expressions can exist within tokens thanks to
`TokenKind::Interpolated`, that's not obvious to anyone who doesn't
know compiler internals.
- In `parse_mac_args_common`, we no longer need to collect tokens for
the value expression.
bors [Wed, 4 May 2022 09:55:51 +0000 (09:55 +0000)]
Auto merge of #96695 - JohnTitor:rollup-oo4fc1h, r=JohnTitor
Rollup of 6 pull requests
Successful merges:
- #96597 (openbsd: unbreak build on native platform)
- #96662 (Fix typo in lint levels doc)
- #96668 (Fix flaky rustdoc-ui test because it did not replace time result)
- #96679 (Quick fix for #96223.)
- #96684 (Update `ProjectionElem::Downcast` documentation)
- #96686 (Add some TAIT-related tests)
--- stderr
error: `-Csplit-debuginfo` is unstable on this platform
command did not execute successfully: "/data/semarie/build-rust/install_dir/beta/bin/cargo.bin" "build" "--target" "x86_64-unknown-openbsd" "-Zbinary-dep-depinfo" "-j" "4" "-v" "--release" "--frozen" "--manifest-path"
```
I am suspecting that all unix might be affected, but I am unsure about the right conditional to use. so I only added "openbsd" target inside it as I am able to test it.
rustc nightly built correctly with this PR on openbsd.
bors [Wed, 4 May 2022 05:01:47 +0000 (05:01 +0000)]
Auto merge of #96447 - petrochenkov:docregr, r=GuillaumeGomez
rustdoc: Resolve doc links on fields during early resolution
Another subset of https://github.com/rust-lang/rust/pull/94857 which fixes https://github.com/rust-lang/rust/issues/96429.
This case regressed in https://github.com/rust-lang/rust/pull/96135 when `may_have_doc_links`-based filtering was introduced.
Before that filtering structs could collect traits in scope for their fields, but after the filtering structs won't collect anything if they don't have doc comments on them, so we have to visit fields too.
bors [Wed, 4 May 2022 01:58:23 +0000 (01:58 +0000)]
Auto merge of #96353 - estebank:issue-95413, r=compiler-errors
When suggesting to import an item, also suggest changing the path if appropriate
When we don't find an item we search all of them for an appropriate
import and suggest `use`ing it. This is sometimes done for expressions
that have paths with more than one segment. We now also suggest changing
that path to work with the `use`.
bors [Tue, 3 May 2022 22:29:58 +0000 (22:29 +0000)]
Auto merge of #95380 - compiler-errors:unit-destructure-assign, r=nikomatsakis
Fix unit struct/enum variant in destructuring assignment
See https://github.com/rust-lang/rfcs/blob/master/text/2909-destructuring-assignment.md#guide-level-explanation, "including **unit** and tuple structs"
bors [Tue, 3 May 2022 20:42:35 +0000 (20:42 +0000)]
Auto merge of #8779 - binggh:easier-needless-late-init, r=llogiq
Easier readability for `needless_late_init` message
Closes #8530
Updated the lint to use a `MultiSpan`, showing where the `let` statement was first used and where the initialisation statement was done, as in the format described, for easier readability.
Was wondering why, when pushing the span label for the initialisation statement, that sometimes the prior statement above the initialisation statement gets pulled into the output as well - any insight is appreciated!
---
changelog: [`needless_late_init`]: Now shows the `let` statement where it was first initialized
Remove unnecessary `NtIdent` in `Token::is_whole_expr`.
The comment on this function explains that it's a specialized version of
`maybe_whole_expr`. But `maybe_whole_expr` doesn't do anything with
`NtIdent`, so `is_whole_expr` also doesn't need to.
Add support for a new attribute `#[debugger_visualizer]` to support embedding debugger visualizers into a generated PDB.
Cleanup `DebuggerVisualizerFile` type and other minor cleanup of queries.
Merge the queries for debugger visualizers into a single query.
Revert move of `resolve_path` to `rustc_builtin_macros`. Update dependencies in Cargo.toml for `rustc_passes`.
Respond to PR comments. Load visualizer files into opaque bytes `Vec<u8>`. Debugger visualizers for dynamically linked crates should not be embedded in the current crate.
Update the unstable book with the new feature. Add the tracking issue for the debugger_visualizer feature.
bors [Tue, 3 May 2022 17:22:58 +0000 (17:22 +0000)]
Auto merge of #96280 - lygstate:ffi-fixes, r=joshtriplett
library/core: Fixes implement of c_uint, c_long, c_ulong
Fixes: aa670166243 ("make memcmp return a value of c_int_width instead of i32")
Introduce c_num_definition to getting the cfg_if logic easier to maintain
Add newlines for easier code reading
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
bors [Tue, 3 May 2022 12:16:00 +0000 (12:16 +0000)]
Auto merge of #96601 - tmiasko:ssa-rpo, r=davidtwco
Use reverse postorder in `non_ssa_locals`
The reverse postorder, unlike preorder, is now cached inside the MIR
body. Code generation uses reverse postorder anyway, so it might be
a small perf improvement to use it here as well.