about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
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-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-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-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-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-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`
2023-08-23Rollup merge of #114696 - g0djan:godjan/fix_114610, r=Mark-SimulacrumGuillaume Gomez-0/+8
Fix a pthread_t handle leak #114610 https://github.com/rust-lang/rust/issues/114610 Ran the tests as described in https://github.com/rust-lang/rust/blob/master/src/doc/rustc/src/platform-support/wasm32-wasi-preview1-threads.md?plain=1#L125
2023-08-23Use LLVM 17 as the host compilerJakub BerΓ‘nek-1/+1
2023-08-23predicates ofEric Mark Martin-12/+43
2023-08-23Update run-make/issue-88756-default-output testGuillaume Gomez-0/+2
2023-08-23Add test for `--no-html-source` flagGuillaume Gomez-0/+30
2023-08-23Add unstable `--no-html-source` rustdoc flagGuillaume Gomez-1/+9
2023-08-23stable types for predicatesEric Mark Martin-11/+269
2023-08-23Auto merge of #114790 - taiki-e:asm-maybe-uninit, r=Amanieubors-19/+61
Allow MaybeUninit in input and output of inline assembly **Motivation:** As part of the work to remove UBs from crossbeam's AtomicCell, I'm writing a library to implement atomic operations on MaybeUnint using inline assembly ([atomic-maybe-uninit](https://github.com/taiki-e/atomic-maybe-uninit), https://github.com/crossbeam-rs/crossbeam/pull/1015). However, currently, MaybeUnint cannot be used in input&output of inline assembly, so when processing MaybeUninit, values must be [passed through memory](https://github.com/taiki-e/atomic-maybe-uninit/blob/main/src/arch/aarch64.rs#L121-L122). It is inefficient and microbenchmarks have [actually shown significant performance degradation](https://github.com/crossbeam-rs/crossbeam/pull/1015#issuecomment-1676549870). It would be nice if we could allow MaybeUninit in input and output of inline assembly. --- This PR changed the type check in rustc_hir_analysis to allow `MaybeUnint<int | float | ptr | fn ptr | simd vector>` in input and output of inline assembly and added a simple test. To be honest, I'm not sure that this is the correct way to do it, because this is like doing transmute to integers/floats/etc from MaybeUninit on the compiler side. EDIT: [this seems fine](https://rust-lang.zulipchat.com/#narrow/stream/216763-project-inline-asm/topic/MaybeUninit.20in.20asm!/near/384662900) r? `@Amanieu` cc `@thomcc` (because you [had previously proposed this](https://rust-lang.zulipchat.com/#narrow/stream/216763-project-inline-asm/topic/MaybeUninit.20in.20asm!))
2023-08-23Allow MaybeUninit in input and output of inline assemblyTaiki Endo-19/+61
2023-08-23Auto merge of #115123 - cuviper:llvm-17-rc3, r=nikicbors-0/+0
Update LLVM submodule to 17.0.0-rc3
2023-08-23Improve note for the invalid_reference_casting lintUrgau-0/+62
Add link to the book interior mutability chapter, https://doc.rust-lang.org/book/ch15-05-interior-mutability.html.
2023-08-23Auto merge of #113986 - MaskRay:freebsd, r=nikicbors-3/+4
ci: Update FreeBSD and illumos binutils to 2.40 The current old 2.25 seems to cause trouble to #106511. Install texinfo to dist-x86_64-freebsd/Dockerfile like other containers to fix ``` MAKEINFO doc/bfd.info /binutils/binutils-2.40/missing: 81: /binutils/binutils-2.40/missing: makeinfo: not found WARNING: 'makeinfo' is missing on your system. ``` --- https://www.freshports.org/devel/binutils uses 2.40 for FreeBSD 12.x as well. `@nikic`
2023-08-23Auto merge of #115126 - Dylan-DPC:rollup-g6w3qjd, r=Dylan-DPCbors-46/+383
Rollup of 7 pull requests Successful merges: - #114930 (Automatically add OS labels to std PRs) - #115053 (docs: Add example, reference link for `type` keyword.) - #115092 (Add generics_of to smir) - #115096 (Add regression test for not `memcpy`ing padding bytes) - #115100 (Add support for `ptr::write`s for the `invalid_reference_casting` lint) - #115114 (Contents of reachable statics is reachable) - #115122 (Fix clippy lint for identical `if`/`else` contraining `?` expressions) r? `@ghost` `@rustbot` modify labels: rollup
2023-08-23Rollup merge of #115122 - estebank:fix-clippy, r=ManishearthDylan DPC-3/+23
Fix clippy lint for identical `if`/`else` contraining `?` expressions Follow up to #114819.
2023-08-23Rollup merge of #115114 - tmiasko:115052, r=compiler-errorsDylan DPC-7/+10
Contents of reachable statics is reachable Fixes #115052.
2023-08-23Rollup merge of #115100 - Urgau:invalid_ref_casting-ptr-writes, r=est31Dylan DPC-22/+106
Add support for `ptr::write`s for the `invalid_reference_casting` lint This PR adds support for `ptr::write` and others for the `invalid_reference_casting` lint. Detecting instances where instead of using the deref (`*`) operator to assign someone uses `ptr::write`, `ptr::write_unaligned` or `ptr::write_volatile`. ```rust let data_len = 5u64; std::ptr::write( std::mem::transmute::<*const u64, *mut u64>(&data_len), new_data_len, ); ``` r? ``@est31``
2023-08-23Rollup merge of #115096 - kadiwa4:no_memcpy_padding, r=cjgillotDylan DPC-0/+14
Add regression test for not `memcpy`ing padding bytes Closes #56297 See this comparison: https://rust.godbolt.org/z/jjzfonfcE I don't have any experience with codegen tests, I hope this is correct
2023-08-23Rollup merge of #115092 - ouz-a:smir_generic_of, r=spastorinoDylan DPC-13/+129
Add generics_of to smir Continuing our covering of smir. r? `@spastorino`