bors [Fri, 14 Oct 2022 13:41:40 +0000 (13:41 +0000)]
Auto merge of #102529 - colinba:master, r=joshtriplett
Detect and reject out-of-range integers in format string literals
Until now out-of-range integers in format string literals were silently ignored. They wrapped around to zero at usize::MAX, producing unexpected results.
When using debug builds of rustc, such integers in format string literals even cause an 'attempt to add with overflow' panic in rustc.
Fix this by producing an error diagnostic for integers in format string literals which do not fit into usize.
bors [Fri, 14 Oct 2022 10:54:32 +0000 (10:54 +0000)]
Auto merge of #103048 - Dylan-DPC:rollup-47r62js, r=Dylan-DPC
Rollup of 8 pull requests
Successful merges:
- #102847 (impl AsFd and AsRawFd for io::{Stdin, Stdout, Stderr}, not the sys versions)
- #102856 (Only test duplicate inherent impl items in a single place)
- #102914 (Migrate css highlight without change)
- #102938 (Move some tests to more reasonable directories)
- #103015 (fix a typo)
- #103018 (More dupe word typos)
- #103025 (rustdoc: remove unused CSS `.search-container > *`)
- #103031 (Suppress irrefutable let patterns lint for prefixes in match guards)
Dylan DPC [Fri, 14 Oct 2022 10:49:16 +0000 (16:19 +0530)]
Rollup merge of #103031 - est31:match_guard_irrefutable_let, r=oli-obk
Suppress irrefutable let patterns lint for prefixes in match guards
In match guards, irrefutable prefixes might use the bindings created by the match pattern. Ideally, we check for this, but we can do the next best thing and just not lint for irrefutable prefixes in match guards.
The two items it was really intended to target were the buttons, and those both need to have the style set directly on them anyway because the buttons are both child elements of wrappers.
Dylan DPC [Fri, 14 Oct 2022 10:49:15 +0000 (16:19 +0530)]
Rollup merge of #103018 - Rageking8:more-dupe-word-typos, r=TaKO8Ki
More dupe word typos
I only picked those changes (from the regex search) that I am pretty certain doesn't change meaning and is just a typo fix. Do correct me if any fix is undesirable and I can revert those. Thanks.
Dylan DPC [Fri, 14 Oct 2022 10:49:13 +0000 (16:19 +0530)]
Rollup merge of #102914 - GuillaumeGomez:migrate-css-highlight-without-change, r=notriddle
Migrate css highlight without change
This is a "previous" version of https://github.com/rust-lang/rust/pull/102663: only migrating to CSS variables, no changes. It's a bit more verbose because rules are not coherent between themes.
Dylan DPC [Fri, 14 Oct 2022 10:49:12 +0000 (16:19 +0530)]
Rollup merge of #102847 - joshtriplett:bugfix-impl-fd-traits-for-io-types, r=m-ou-se
impl AsFd and AsRawFd for io::{Stdin, Stdout, Stderr}, not the sys versions
https://github.com/rust-lang/rust/pull/100892 implemented AsFd for the
sys versions, rather than for the public types. Change the
implementations to apply to the public types.
Weihang Lo [Fri, 14 Oct 2022 08:58:48 +0000 (09:58 +0100)]
Update cargo
12 commits in b8f30cb23c4e5f20854a4f683325782b7cff9837..b332991a57c9d055f1864de1eed93e2178d49440
2022-10-10 19:16:06 +0000 to 2022-10-13 22:05:28 +0000
- Differentiate the warning when an alias (built-in or user-defined) shadows an external subcommand (rust-lang/cargo#11170)
- chore: Update tests for latest clap (rust-lang/cargo#11235)
- feat(publish): Support 'publish.timeout' config behind '-Zpublish-timeout' (rust-lang/cargo#11230)
- Add missing edition (rust-lang/cargo#11231)
- doc(profiles): add module level doc (rust-lang/cargo#11219)
- refactor(publish): Clarify which SourceId is being used (rust-lang/cargo#11216)
- Add new SourceKind::SparseRegistry to differentiate sparse registries (rust-lang/cargo#11209)
- Fix deadlock when build scripts are waiting for input on stdin (rust-lang/cargo#11205)
- refactor: New variant `FeaturesFor::ArtifactDep` (rust-lang/cargo#11184)
- Fix rustdoc warning about unclosed HTML tag (rust-lang/cargo#11221)
- refactor(tests): Prepare for wait-for-publish test changes (rust-lang/cargo#11210)
- Add configuration option for controlling crates.io protocol (rust-lang/cargo#11215)
est31 [Thu, 13 Oct 2022 23:46:24 +0000 (01:46 +0200)]
Suppress irrefutable let patterns lint for prefixes in match guards
In match guards, irrefutable prefixes might use the bindings created
by the match pattern. Ideally, we check for this, but we can do the
next best thing and just not lint for irrefutable prefixes in match
guards.
Matthias Krüger [Thu, 13 Oct 2022 22:45:17 +0000 (00:45 +0200)]
Rollup merge of #103006 - WaffleLapkin:rustdoc_dont, r=compiler-errors
rustdoc: don't ICE on `TyKind::Typeof`
Fixes #102986
I'm not sure why rustdoc started seeing `TyKind::Typeof` all of a sudden (the code being editted was last touched 3 months ago), probably something to do with error recovery? idk.
Matthias Krüger [Thu, 13 Oct 2022 22:45:17 +0000 (00:45 +0200)]
Rollup merge of #103000 - wesleywiser:suggest_libname, r=compiler-errors
Add suggestion to the "missing native library" error
If we fail to locate a native library that we are linking with, it could be the case the user entered a complete file name like `foo.lib` or `libfoo.a` when we expect them to simply provide `foo`.
In this situation, we now detect that case and suggest the user only provide the library name itself.
The two items it was really intended to target were the buttons, and those
both need to have the style set directly on them anyway because the buttons
are both child elements of wrappers.
bors [Thu, 13 Oct 2022 14:59:39 +0000 (14:59 +0000)]
Auto merge of #103009 - Dylan-DPC:rollup-9c2tng6, r=Dylan-DPC
Rollup of 6 pull requests
Successful merges:
- #102765 (Suggest `==` to the first expr which has `ExprKind::Assign` kind)
- #102854 (openbsd: don't reallocate a guard page on the stack.)
- #102904 (Print return-position `impl Trait` in trait verbosely if `-Zverbose`)
- #102947 (Sort elaborated existential predicates in `object_ty_for_trait`)
- #102956 (Use `full_res` instead of `expect_full_res`)
- #102999 (Delay `is_intrinsic` query until after we've determined the callee is a function)
Dylan DPC [Thu, 13 Oct 2022 12:49:20 +0000 (18:19 +0530)]
Rollup merge of #102947 - compiler-errors:sort-elaborated-existentials, r=cjgillot
Sort elaborated existential predicates in `object_ty_for_trait`
r? `@cjgillot`
I think that #102845 caused #102933. Depending on the order that we elaborate these existential projection predicates, there's no guarantee that they'll be sorted by def id, which is what is failing the assertion in the issue.
bors [Thu, 13 Oct 2022 12:03:46 +0000 (12:03 +0000)]
Auto merge of #102919 - luojia65:update-stdarch, r=Amanieu
library: update stdarch submodule
It has been one month since we update `stdarch` submodule into main branch Rust, it includes various fixes in code and more neat documents. This pull request also adds missing features to ensure we can build latest stdarch submodule.
Wesley Wiser [Thu, 13 Oct 2022 02:52:31 +0000 (22:52 -0400)]
Add suggestion to the "missing native library" error
If we fail to locate a native library that we are linking with, it could
be the case the user entered a complete file name like `foo.lib` or
`libfoo.a` when we expect them to simply provide `foo`.
In this situation, we now detect that case and suggest the user only
provide the library name itself.
bors [Thu, 13 Oct 2022 06:49:29 +0000 (06:49 +0000)]
Auto merge of #102655 - joboet:windows_tls_opt, r=ChrisDenton
Optimize TLS on Windows
This implements the suggestion in the current TLS code to embed the linked list of destructors in the `StaticKey` structure to save allocations. Additionally, locking is avoided when no destructor needs to be run. By using one Windows-provided `Once` per key instead of a global lock, locking is more finely-grained (this unblocks #100579).
bors [Thu, 13 Oct 2022 03:33:40 +0000 (03:33 +0000)]
Auto merge of #102995 - JohnTitor:rollup-yomkwge, r=JohnTitor
Rollup of 7 pull requests
Successful merges:
- #102641 (Support casting boxes to dyn*)
- #102836 (rustc_target: Fix json target specs using LLD linker flavors in link args)
- #102949 (should-skip-this: add missing backslash)
- #102967 (Add test for issue 102964)
- #102971 (tidy: error if a lang feature is already present)
- #102974 (Fix small word dupe typos)
- #102980 (rustdoc: merge separate `.item-info` CSS)
Yuki Okushi [Thu, 13 Oct 2022 00:41:27 +0000 (09:41 +0900)]
Rollup merge of #102971 - est31:tidy_duplicate_lang_features, r=jyn514
tidy: error if a lang feature is already present
If a lang feature gets declared twice, like for example as a result of a mistake during stabilization, emit an error in tidy. Library features already have this logic.
Inspired by a mistake done during `half_open_range_patterns` stabilization: https://github.com/rust-lang/rust/pull/102275/files#r991292215
The PR requires #102883 to be merged before CI turns green because the check is doing its job.
For reviewers, I suggest [turning off whitespace changes](https://github.com/rust-lang/rust/pull/102971/files?w=1) in the diff by adding `?w=1` to the url, as a large part of the diff is just about removing one level of indentation.
Yuki Okushi [Thu, 13 Oct 2022 00:41:25 +0000 (09:41 +0900)]
Rollup merge of #102836 - petrochenkov:jsonspec, r=eholk
rustc_target: Fix json target specs using LLD linker flavors in link args
Fixes https://github.com/rust-lang/rust/pull/101988#issuecomment-1272407248 (a regression introduced by https://github.com/rust-lang/rust/pull/101988).
Yuki Okushi [Thu, 13 Oct 2022 00:41:25 +0000 (09:41 +0900)]
Rollup merge of #102641 - eholk:dyn-star-box, r=compiler-errors
Support casting boxes to dyn*
Boxes have a pointer type at codegen time which LLVM does not allow to be transparently converted to an integer. Work around this by inserting a `ptrtoint` instruction if the argument is a pointer.
bors [Thu, 13 Oct 2022 00:37:28 +0000 (00:37 +0000)]
Auto merge of #102372 - abrown:issue-102157, r=thomcc
Allow compiling the `wasm32-wasi` std library with atomics
The issue #102157 demonstrates how currently the `-Z build-std` option will fail when re-compiling the standard library with `RUSTFLAGS` like `RUSTFLAGS="-C target-feature=+atomics,+bulk-memory -C link-args=--shared-memory"`. This change attempts to resolve those build issues by depending on the the WebAssembly `futex` module and providing an implementation for `env_lock`. Fixes #102157.
est31 [Wed, 12 Oct 2022 15:57:05 +0000 (17:57 +0200)]
tidy: error if a lang feature is already present
If a lang feature gets declared twice, like for example as
a result of a mistake during stabilization, emit an error
in tidy. Library features already have this logic.
bors [Wed, 12 Oct 2022 21:03:47 +0000 (21:03 +0000)]
Auto merge of #101679 - compiler-errors:rpitit-default-body, r=nikomatsakis
Support default-body trait functions with return-position `impl Trait` in traits
Introduce a new `Trait` candidate kind for the `ImplTraitInTrait` projection candidate, which just projects an RPITIT down to its opaque type form.
This is a hack until we lower RPITITs to regular associated types, after which we will need to rework how these default bodies are type-checked, so comments are left in a few places for us to clean up later.