about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-08-25Rollup merge of #114754 - workingjubilee:gamma-ray-logger, r=thomccMatthias KrΓΌger-2/+6
Name what ln_gamma does The previous description omitted some important details.
2023-08-25Auto merge of #115193 - weihanglo:rollup-6s3mz06, r=weihanglobors-132/+753
Rollup of 9 pull requests Successful merges: - #114987 (elaborate a bit on the (lack of) safety in 'Mmap::map') - #115084 (Add smir `predicates_of`) - #115117 (Detect and report nix shell) - #115124 (kmc-solid: Import `std::sync::PoisonError` in `std::sys::solid::os`) - #115152 (refactor(lint): translate `RenamedOrRemovedLint`) - #115154 (Move some ui tests to subdirectories) - #115167 (Fix ub-int-array test for big-endian platforms) - #115172 (Add more tests for if_let_guard) - #115177 (Add symbols for Clippy usage) r? `@ghost` `@rustbot` modify labels: rollup
2023-08-25Auto merge of #114397 - sebastiantoh:issue-85222, r=Nadrierilbors-14/+276
Add note when matching on tuples/ADTs containing non-exhaustive types Fixes https://github.com/rust-lang/rust/issues/85222 r? `@Nadrieril`
2023-08-25Auto merge of #114201 - Centri3:explicit-repr-rust, r=WaffleLapkinbors-8/+24
Allow explicit `#[repr(Rust)]` This is identical to no `repr()` at all. For `Rust, packed` and `Rust, align(x)`, it should be the same as no `Rust` at all (as, afaik, `#[repr(align(16))]` uses the Rust ABI.) The main use case for this is being able to explicitly say "I want to use the Rust ABI" in very very rare circumstances where the first obvious choice would be the C ABI yet is undesirable, which is already possible with functions as `extern "Rust"`. This would be useful for silencing https://github.com/rust-lang/rust-clippy/pull/11253. It's also more consistent with `extern`. The lack of this also tripped me up a bit when I was new to Rust, as I expected this to be possible.
2023-08-24Rollup merge of #115177 - c410-f3r:symbols, r=compiler-errorsWeihang Lo-0/+8
Add symbols for Clippy usage The `arithmetic_side_effects` lint is always "interning" these non-existing symbols related to math operations causing a bit of a slowdown.
2023-08-24Rollup merge of #115172 - matthewjasper:if-let-guard-tests, r=cjgillotWeihang Lo-0/+298
Add more tests for if_let_guard Adds tests for borrow checking, name shadowing and interaction with macros. cc #51114
2023-08-24Rollup merge of #115167 - uweigand:ubintarray-endian-fix, r=RalfJungWeihang Lo-42/+10
Fix ub-int-array test for big-endian platforms As of commit 7767cbb3b0b332fd0a46e347ea7f68f20109d768, the tests/ui/consts/const-eval/ub-int-array.rs test is failing on big-endian platforms (in particular s390x), as the stderr output contains a hex dump that depends on endianness. Since this point intentionally verifies the hex dump to check the uninitialized byte markers, I think we should not simply standardize away the hex dump as is done with some of the other tests in this directory. However, most of the test is already endian-independent. The only exception is one line of hex dump, which can also be made endian-independent by choosing appropriate constants in the source code. Since the 32bit and 64bit stderr outputs were already (and remain) identical, I've merged them and removed the stderr-per-bitwidth marker. Fixes (again) https://github.com/rust-lang/rust/issues/105383.
2023-08-24Rollup merge of #115154 - olanti-p:move-issues-24-08-2023, r=compiler-errorsWeihang Lo-2/+2
Move some ui tests to subdirectories cc #73494 issue-2804 -> `macros/` (there's already the minified `issue-2804-2` there) issue-17431 -> `structs-enums/struct-rec` and new `structs-enums/enum-rec` (original issue pertains to detection of recursive enums and structs) issue-29181 and issue-66768 - moved according to the classifier tool
2023-08-24Rollup merge of #115152 - weihanglo:lint-refactor, r=compiler-errorsWeihang Lo-54/+85
refactor(lint): translate `RenamedOrRemovedLint` I was trying to address <https://github.com/rust-lang/cargo/issues/12495> and found that maybe I should refactor relevant lints a bit. This PR translates `RenamedOrRemovedLint` into fluent file. To make diagnostic types clearer and easier to organize, this PR splits it into two structs. The second commit adds lifetime annotations for removing unnecessary clones. If people feel too noisy, we can revert such change. ### Possibly relevant UI tests: * `tests/ui/lint-removed*` * `tests/ui/lint-renamed*` * `tests/ui/rustdoc-renamed.rs` * `tests/rustdoc-ui/lints/unknown-renamed-lints.rs`
2023-08-24Rollup merge of #115124 - ↡Weihang Lo-1/+1
solid-rs:patch/kmc-solid/import-poison-error-in-os, r=cuviper kmc-solid: Import `std::sync::PoisonError` in `std::sys::solid::os` Follow-up to #114968. Fixes a missing import in [`*-kmc-solid_*`](https://doc.rust-lang.org/nightly/rustc/platform-support/kmc-solid.html) Tier 3 targets. ``` error[E0433]: failed to resolve: use of undeclared type `PoisonError` C:\Users\xxxxx\.rustup\toolchains\nightly-2023-08-23-x86_64-pc-windows-gnu\lib\rustlib\src\rust\library\std\src\sys\solid\os.rs(85,36) | 85 | ENV_LOCK.read().unwrap_or_else(PoisonError::into_inner) | ^^^^^^^^^^^ use of undeclared type `PoisonError` | ```
2023-08-24Rollup merge of #115117 - pnkfelix:detect-and-report-nix-shell, r=albertlarsan68Weihang Lo-9/+31
Detect and report nix shell Better diagnostics for people using nix subshell on non-NixOS. 1. Turned patch-binaries-for-nix from a boolean into a ternary flag: true, false, and unset. 2. When patch-binaries-for-nix is unset, we continue with the existing NixOS detection heuristic (look for nixos in /etc/os-release, if present), but if we are not atop NixOS, then issue a note if we see the IN_NIX_SHELL environment variable telling the user to consider setting patch-binaries-for-nix explicitly. Fix #115073
2023-08-24Rollup merge of #115084 - ericmarkmartin:add-smir-cx-where-clauses, r=spastorinoWeihang Lo-23/+312
Add smir `predicates_of` r? `@spastorino`
2023-08-24Rollup merge of #114987 - RalfJung:unsound-mmap, r=cjgillotWeihang Lo-1/+6
elaborate a bit on the (lack of) safety in 'Mmap::map' Sadly none of the callers of this function even consider it worth mentioning in their unsafe block that what they are doing is completely unsound.
2023-08-24Auto merge of #113408 - petrochenkov:bindintern2, r=cjgillotbors-79/+133
resolve: Stop creating `NameBinding`s on every use, create them once per definition instead `NameBinding` values are supposed to be unique, use referential equality, and be created once for every name declaration. Before this PR many `NameBinding`s were created on name use, rather than on name declaration, because it's sufficiently cheap, and comparisons are not actually used in practice for some binding kinds. This PR makes `NameBinding`s consistently unique and created on name declaration. There are two special cases - for extern prelude names creating `NameBinding` requires loading the corresponding crate, which is expensive, so such bindings are created lazily on first use, but they still keep the uniqueness by being reused on further uses. - for legacy derive helpers (helper attributes written before derives that introduce them) the declaration and the use is basically the same thing (that's one of the reasons why they are deprecated), so they are still created on use, but we can still maybe do a bit better in a way that I described in FIXME in the last commit.
2023-08-24Move issue 29181, 2804, 17431, 66768Olanti-2/+2
2023-08-24Auto merge of #115082 - Zoxc:syntax-context-decode-race, r=cjgillotbors-35/+91
Fix races conditions with `SyntaxContext` decoding This changes `SyntaxContext` decoding to work with concurrent decoding. The `remapped_ctxts` field now only stores `SyntaxContext` which have completed decoding, while the new `decoding` and `local_in_progress` keeps track of `SyntaxContext`s which are in process of being decoding and on which threads. This fixes 2 issues with the current implementation. It can return an `SyntaxContext` which contains dummy data if another thread starts decoding before the first one has completely finished. Multiple threads could also allocate multiple `SyntaxContext`s for the same `raw_id`.
2023-08-24Add symbols for ClippyCaio-0/+8
2023-08-24Add more tests for if_let_guardMatthew Jasper-0/+298
2023-08-24Auto merge of #115147 - estebank:issue-114311, r=davidtwcobors-88/+167
Suggest mutable borrow on read only for-loop that should be mutable ``` error[E0596]: cannot borrow `*test` as mutable, as it is behind a `&` reference --> $DIR/suggest-mut-iterator.rs:22:9 | LL | for test in &tests { | ------ this iterator yields `&` references LL | test.add(2); | ^^^^ `test` is a `&` reference, so the data it refers to cannot be borrowed as mutable | help: use a mutable iterator instead | LL | for test in &mut tests { | +++ ``` Fix #114311.
2023-08-24Auto merge of #115131 - frank-king:feature/unnamed-fields-lite, r=petrochenkovbors-5/+650
Parse unnamed fields and anonymous structs or unions (no-recovery) It is part of #114782 which implements #49804. Only parse anonymous structs or unions in struct field definition positions. r? `@petrochenkov`
2023-08-24Auto merge of #115094 - Mark-Simulacrum:bootstrap-update, r=ozkanonurbors-472/+443
Update bootstrap compiler to 1.73.0 beta
2023-08-24resolve: Leave a comment about name bindings for legacy derive helpersVadim Petrochenkov-0/+5
2023-08-24resolve: Make bindings for derive helper attributes uniqueVadim Petrochenkov-28/+25
instead of creating them every time such attribute is used
2023-08-24resolve: Make bindings for crate roots uniqueVadim Petrochenkov-5/+23
instead of creating a new every time `crate` or `$crate` is used
2023-08-24resolve: Pre-intern tool module bindingsVadim Petrochenkov-2/+11
2023-08-24resolve: Make bindings from extern prelude uniqueVadim Petrochenkov-19/+38
instead of creating a new every time a name from extern prelude is accessed
2023-08-24Fix ub-int-array test for big-endian platformsUlrich Weigand-42/+10
As of commit 7767cbb3b0b332fd0a46e347ea7f68f20109d768, the tests/ui/consts/const-eval/ub-int-array.rs test is failing on big-endian platforms (in particular s390x), as the stderr output contains a hex dump that depends on endianness. Since this point intentionally verifies the hex dump to check the uninitialized byte markers, I think we should not simply standardize away the hex dump as is done with some of the other tests in this directory. However, most of the test is already endian-independent. The only exception is one line of hex dump, which can also be made endian-independent by choosing appropriate constants in the source code. Since the 32bit and 64bit stderr outputs were already (and remain) identical, I've merged them and removed the stderr-per-bitwidth marker. Fixes (again) https://github.com/rust-lang/rust/issues/105383.
2023-08-24resolve: Pre-intern builtin name bindingsVadim Petrochenkov-25/+31
2023-08-24Auto merge of #114297 - Kobzol:llvm-17-host, r=nikicbors-1/+1
Update x64 Linux host compiler to LLVM 17 This PR updates the LLVM host compiler on 64-bit Linux to version 17. r? `@ghost`
2023-08-24Auto merge of #115078 - camelid:tydef-to-alias, r=aDotInTheVoid,GuillaumeGomezbors-176/+179
rustdoc: Rename typedef to type alias This matches the name used by the [Rust Reference][1], which is also what people usually call these items. [1]: https://doc.rust-lang.org/reference/items/type-aliases.html r? `@GuillaumeGomez`
2023-08-23Accommodate tidy.Felix S. Klock II-11/+9
In addition: Incorporated some review feedback (namely, removed a useless initial assignment to True that was never read), and unified code a bit more between bootstrap.py and download.rs (by using the same variable name for the same concept).
2023-08-24Parse unnamed fields and anonymous structs or unionsFrank King-5/+650
Anonymous structs or unions are only allowed in struct field definitions. Co-authored-by: carbotaniuman <41451839+carbotaniuman@users.noreply.github.com>
2023-08-24Auto merge of #114860 - Zoxc:sharded-layout, r=SparrowLiibors-41/+49
Make `Sharded` an enum and specialize it for the single thread case This changes `Sharded` to use a single shard by an enum, reducing the size of `Sharded` for greater cache efficiency. Performance improvement with 1 thread and `cfg(parallel_compiler)`: <table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check</td><td align="right">1.7009s</td><td align="right">1.6748s</td><td align="right">πŸ’š -1.53%</td></tr><tr><td>🟣 <b>hyper</b>:check</td><td align="right">0.2525s</td><td align="right">0.2451s</td><td align="right">πŸ’š -2.90%</td></tr><tr><td>🟣 <b>regex</b>:check</td><td align="right">0.9519s</td><td align="right">0.9353s</td><td align="right">πŸ’š -1.74%</td></tr><tr><td>🟣 <b>syn</b>:check</td><td align="right">1.5504s</td><td align="right">1.5280s</td><td align="right">πŸ’š -1.45%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check</td><td align="right">5.9536s</td><td align="right">5.8873s</td><td align="right">πŸ’š -1.11%</td></tr><tr><td>Total</td><td align="right">10.4092s</td><td align="right">10.2706s</td><td align="right">πŸ’š -1.33%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9825s</td><td align="right">πŸ’š -1.75%</td></tr></table> I did see an unexpected 0.23% change for the serial compiler, so this could use a perf run to see if that reproduces. cc `@SparrowLii`
2023-08-24Auto merge of #115012 - Zoxc:thir-check-root, r=cjgillotbors-1/+2
Ensure that THIR unsafety check is done before stealing it This ensures that THIR unsafety check is done before stealing it by running it on the typeck root instead of on a closure, which does nothing. Fixes https://github.com/rust-lang/rust/issues/111520
2023-08-24refactor: use references to reduce unnecessary clonesWeihang Lo-28/+27
2023-08-24lint: translate `RenamedOrRemovedLint`Weihang Lo-37/+69
2023-08-23Bump cfg(bootstrap)Mark Rousskov-69/+38
2023-08-23Auto merge of #106511 - MaskRay:gotpcrelx, r=nikicbors-3/+2
Default relax_elf_relocations to true This option tells LLVM to emit relaxable relocation types R_X86_64_GOTPCRELX/R_X86_64_REX_GOTPCRELX/R_386_GOT32X in applicable cases. True matches Clang's CMake default since 2020-08 [1] and latest LLVM default[2]. This also works around a GNU ld<2.41 issue[2] when using general-dynamic/local-dynamic TLS models in `-Z plt=no` mode with latest LLVM. [1]: https://github.com/llvm/llvm-project/commit/c41a18cf61790fc898dcda1055c3efbf442c14c0 [2]: https://github.com/llvm/llvm-project/commit/2aedfdd9b82e6c72a28576d0e8ea854f1300ff4e [3]: https://sourceware.org/bugzilla/show_bug.cgi?id=24784
2023-08-23Suggest mutable borrow on read only for-loop that should be mutableEsteban KΓΌber-88/+167
``` error[E0596]: cannot borrow `*test` as mutable, as it is behind a `&` reference --> $DIR/suggest-mut-iterator.rs:22:9 | LL | for test in &tests { | ------ this iterator yields `&` references LL | test.add(2); | ^^^^ `test` is a `&` reference, so the data it refers to cannot be borrowed as mutable | help: use a mutable iterator instead | LL | for test in &mut tests { | +++ ``` Address #114311.
2023-08-23Fix rustdoc-json testsNoah Lev-97/+97
2023-08-23rustdoc: Rename typedef to type alias in jsondoclintNoah Lev-10/+10
2023-08-23Extend comment on assertionJohn KΓ₯re Alsaker-1/+5
2023-08-23Default relax_elf_relocations to trueFangrui Song-3/+2
This option tells LLVM to emit relaxable relocation types R_X86_64_GOTPCRELX/R_X86_64_REX_GOTPCRELX/R_386_GOT32X in applicable cases. True matches Clang's CMake default since 2020-08 [1] and latest LLVM default[2]. This also works around a GNU ld<2.41 issue[3] when using general-dynamic/local-dynamic TLS models in `-Z plt=no` mode with latest LLVM. [1]: https://github.com/llvm/llvm-project/commit/c41a18cf61790fc898dcda1055c3efbf442c14c0 [2]: https://github.com/llvm/llvm-project/commit/2aedfdd9b82e6c72a28576d0e8ea854f1300ff4e [3]: https://sourceware.org/bugzilla/show_bug.cgi?id=24784
2023-08-23Auto merge of #115112 - tmandry:backtrace-0369, r=compiler-errorsbors-37/+13
Bump backtrace to 0.3.69
2023-08-23Auto merge of #115137 - GuillaumeGomez:rollup-37jqoyg, r=GuillaumeGomezbors-2/+123
Rollup of 6 pull requests Successful merges: - #114696 (Fix a pthread_t handle leak #114610) - #115102 (Improve note for the `invalid_reference_casting` lint) - #115103 (Disable bootstrap rustc version check) - #115106 (ArchiveWrapper: handle LLVM API update) - #115109 (Skip ExpandYamlAnchors when the config is missing) - #115135 (Rustdoc: Add unstable --no-html-source flag) r? `@ghost` `@rustbot` modify labels: rollup
2023-08-23Rollup merge of #115135 - GuillaumeGomez:no-html-source-flag, r=notriddleGuillaume Gomez-1/+41
Rustdoc: Add unstable --no-html-source flag Fixes https://github.com/rust-lang/rust/issues/115060. This is the equivalent of `#![doc(no_html_source)]` but on the command-line. It disables the generation of the source pages (and of the links pointing to them as well). The motivation behind this is to enable to reduce documentation size when generating it in some locations without enforcing this to end users or adding a new feature to enable/disable the crate attribute. r? `@notriddle`
2023-08-23Rollup merge of #115109 - cuviper:yaml-404, r=albertlarsan68Guillaume Gomez-0/+5
Skip ExpandYamlAnchors when the config is missing The dist-src tarball does not include `.github/` at all, so we can't check whether it needs to be regenerated.
2023-08-23Rollup merge of #115106 - durin42:llvm-18-symtabwritingmode, r=nikicGuillaume Gomez-0/+5
ArchiveWrapper: handle LLVM API update In llvm/llvm-project@f740bcb3707a17ed4ccd52157089011a586cc2a6 a boolean parameter changed to an enum. r? ``@nikic`` ``@rustbot`` label: +llvm-main
2023-08-23Rollup merge of #115103 - djkoloski:disable_bootstrap_version_check, ↡Guillaume Gomez-1/+2
r=compiler-errors Disable bootstrap rustc version check Mitigates #115065
2023-08-23Rollup merge of #115102 - Urgau:invalid_ref_casting-book-note, r=est31Guillaume Gomez-0/+62
Improve note for the `invalid_reference_casting` lint This PR add link to the book interior mutability chapter, https://doc.rust-lang.org/book/ch15-05-interior-mutability.html; this is done to guide peoples to a place with many useful information and context. *Note that this isn't the first occurrence of a link to the book in [tests outputs](https://github.com/search?q=repo%3Arust-lang%2Frust+book+path%3A%2F%5Etests%5C%2Fui%5C%2F%2F&type=code).* r? `@est31`