about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-02-10Add regression test for reexported macros docsGuillaume Gomez-0/+23
2023-02-10Also get current import attributesGuillaume Gomez-3/+5
2023-02-10Correctly handle reexports for macrosGuillaume Gomez-1/+1
2023-02-09Auto merge of #107840 - matthiaskrgr:rollup-e6v7x0a, r=matthiaskrgrbors-405/+696
Rollup of 5 pull requests Successful merges: - #107446 (Migrate some of `rustc_parse` to derive diagnostics) - #107752 (Specify dlltool prefix when generating import libs) - #107808 (bootstrap.py: fix build-failure message) - #107834 (create symlink for legacy rustfmt path) - #107835 (use idiomatic formatting) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-02-09Rollup merge of #107835 - tshepang:fmt, r=WaffleLapkinMatthias Krüger-12/+13
use idiomatic formatting Also, remove needless `else`
2023-02-09Rollup merge of #107834 - zephaniahong:issue-107547-fix, r=albertlarsan68Matthias Krüger-12/+17
create symlink for legacy rustfmt path Fixes #107547 . Main change is in the `download.rs` file. Created a symlink for the legacy rustfmt path to the new rustfmt path. Other file changes are simply as a result of porting over the symlink_file function from the Build struct to the config Struct
2023-02-09Rollup merge of #107808 - kadiwa4:built-unsuccessfully, r=albertlarsan68Matthias Krüger-1/+3
bootstrap.py: fix build-failure message A small mistake I did. Corrects #107470, fixes #107804 r? `@albertlarsan68` (since you reviewed the last one)
2023-02-09Rollup merge of #107752 - riverar:rafael/gnu_dlltool_temp_prefix, r=petrochenkovMatthias Krüger-0/+8
Specify dlltool prefix when generating import libs Ref: https://github.com/rust-lang/rust/pull/106610#issuecomment-1418221274 tl;dr: This PR adds an explicit dlltool temporary filename prefix. The prefix resolves a race condition by ensuring dlltool temporary files are siloed in an appropriate/unique Rust temporary directory. --- GNU dlltool, as part of its import library generation logic, uses a bunch of temporary files on disk. In the interest of deterministic build runs, dlltool supports deterministic temporary filenames. The temporary filename prefix is automatically generated internally or can be explicitly specified via a `--temp-prefix` argument. GNU dlltool **2.38** (that ships with `x86_64-12.2.0-release-posix-seh-rt_v10-rev0` [installed during CI](https://github.com/rust-lang/rust/blob/master/src/ci/scripts/install-mingw.sh)) generates a prefix based on the target library name ([source](https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=binutils/dlltool.c;h=d95bf3f5470b999fa3b30bc887791859f48d81d1;hb=20756b0fbe065a84710aa38f2457563b57546440#l3992)). The tool writes to files such as `target_dll_h.s` and `target_dll_s00203.o` in the current working directory. This presents a problem when multiple instances of rustc_codegen_llvm are running to generate an import library (as part of the raw_dylib feature) for the same target library (e.g. kernel32) ([source](https://github.com/rust-lang/rust/blob/master/compiler/rustc_codegen_llvm/src/back/archive.rs#L185-L196)). That is, dlltool instances race and may overwrite or delete files belonging to each other. GNU dlltool **2.39**+ (not used in Rust CI) generates a prefix based on the output library path ([source](https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=binutils/dlltool.c;h=e2af20847009945b4c61a6fef08268fbb4429715;hb=b51c2fec1da205ea3e7354cbb3e253018d64873c#l3992)). The tool, when invoked as part of rustc_codegen_llvm, writes to files at paths such as `C_Users_Foo_AppData_Local_Temp_rustcOFqhXZ_target_lib_h.s`. (The output library path is normalized and non-alphanumeric characters are replaced with underscores.)
2023-02-09Rollup merge of #107446 - clubby789:rustc-parse-diag-migrate, r=compiler-errorsMatthias Krüger-380/+655
Migrate some of `rustc_parse` to derive diagnostics `@rustbot` label +A-translation r? rust-lang/diagnostics cc #100717
2023-02-09use idiomatic formattingTshepang Mbambo-12/+13
Also, remove needless else
2023-02-09port over symlink_file function from Build to Config and create symlink for ↵Zephaniah Ong-12/+17
legacy rustfmt path
2023-02-09Auto merge of #106938 - GuillaumeGomez:normalize-projection-field-ty, r=oli-obkbors-1/+81
Add missing normalization for union fields types Overshadows https://github.com/rust-lang/rust/pull/106808. From the experiment https://github.com/rust-lang/rust/pull/103985. In short, it allows to use projections as a type for union's fields. cc `@compiler-errors` r? `@oli-obk`
2023-02-09Auto merge of #107828 - compiler-errors:rollup-gyj6dgj, r=compiler-errorsbors-94/+227
Rollup of 9 pull requests Successful merges: - #107317 (Implement `AsFd` and `AsRawFd` for `Rc`) - #107429 (Stabilize feature `cstr_from_bytes_until_nul`) - #107713 (Extend `BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE`.) - #107761 (Replace a command line flag with an env var to allow tools to initialize the tracing loggers at their own discretion) - #107790 ( x.py fails all downloads that use a tempdir with snap curl #107722) - #107799 (correctly update goals in the cache) - #107813 (Do not eagerly recover for bad `impl Trait` types in macros) - #107817 (rustdoc: use svgo to shrink `wheel.svg`) - #107819 (Set `rust-analyzer.check.invocationLocation` to `root`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-02-08Rollup merge of #107819 - clubby789:x-py-root, r=jyn514Michael Goulet-3/+7
Set `rust-analyzer.check.invocationLocation` to `root` Add ```json "rust-analyzer.check.invocationLocation": "root", "rust-analyzer.check.invocationStrategy": "once", ``` to the bundled VS code config. This prevents an error with r-a invoking `python3 x.py` in `src/bootstrap` where `x.py` does not exist. r? ``@jyn514``
2023-02-08Rollup merge of #107817 - notriddle:notriddle/wheel-svg, r=GuillaumeGomezMichael Goulet-1/+1
rustdoc: use svgo to shrink `wheel.svg` use [svgo] to shrink `wheel.svg` [svgo]: https://github.com/svg/svgo $ du -bs src/librustdoc/html/static/images/wheel.svg wheel-old.svg 2972 src/librustdoc/html/static/images/wheel.svg 3764 wheel-old.svg 100*((2972-3764)/3764) = -21.04%
2023-02-08Rollup merge of #107813 - compiler-errors:bad-impl-trait-in-macro-is-ok, ↵Michael Goulet-2/+35
r=estebank Do not eagerly recover for bad `impl Trait` types in macros Fixes #107796 cc #106712, ```@estebank``` and ```@Ezrashaw``` please make sure to use [`Parser::may_recover`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_parse/parser/struct.Parser.html#method.may_recover) for all eager-token-consuming parser recoveries. This also fixes a separate regression from #99915, that was introduced before we added `may_recover` though.
2023-02-08Rollup merge of #107799 - lcnr:update-provisional-result, r=oli-obkMichael Goulet-5/+51
correctly update goals in the cache we may want to actually write the response for our goal into the provisional or global cache instead of simply using the result from the last iteration '^^ r? ```@rust-lang/initiative-trait-system-refactor```
2023-02-08Rollup merge of #107790 - tharunsuresh-code:snap_curl, r=jyn514Michael Goulet-8/+10
x.py fails all downloads that use a tempdir with snap curl #107722 Have used the open() library from python to capture the binary output of the curl command and write it to a file using stdout of the subprocess. Added a single-line comment mentioning the redirect operator.
2023-02-08Rollup merge of #107761 - oli-obk:miri_🪵, r=TaKO8KiMichael Goulet-37/+8
Replace a command line flag with an env var to allow tools to initialize the tracing loggers at their own discretion fixes https://github.com/rust-lang/miri/issues/2778 this was introduced in https://github.com/rust-lang/rust/pull/104645, so this PR reverts the flag-part and uses an env var instead.
2023-02-08Rollup merge of #107713 - ↵Michael Goulet-25/+81
nnethercote:extend-BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE, r=RalfJung Extend `BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE`. To temporarily allow a `str` field in a packed struct using `derive`, along with `[u8]`. r? ``@RalfJung``
2023-02-08Rollup merge of #107429 - tgross35:from-bytes-until-null-stabilization, ↵Michael Goulet-13/+18
r=dtolnay Stabilize feature `cstr_from_bytes_until_nul` This PR seeks to stabilize `cstr_from_bytes_until_nul`. Partially addresses #95027 This function has only been on nightly for about 10 months, but I think it is simple enough that there isn't harm discussing stabilization. It has also had at least a handful of mentions on both the user forum and the discord, so it seems like it's already in use or at least known. This needs FCP still. Comment on potential discussion points: - eventual conversion of `CStr` to be a single thin pointer: this function will still be useful to provide a safe way to create a `CStr` after this change. - should this return a length too, to address concerns about the `CStr` change? I don't see it as being particularly useful, and it seems less ergonomic (i.e. returning `Result<(&CStr, usize), FromBytesUntilNulError>`). I think users that also need this length without the additional `strlen` call are likely better off using a combination of other methods, but this is up for discussion - `CString::from_vec_until_nul`: this is also useful, but it doesn't even have a nightly implementation merged yet. I propose feature gating that separately, as opposed to blocking this `CStr` implementation on that Possible alternatives: A user can use `from_bytes_with_nul` on a slice up to `my_slice[..my_slice.iter().find(|c| c == 0).unwrap()]`. However; that is significantly less ergonomic, and is a bit more work for the compiler to optimize compared the direct `memchr` call that this wraps. ## New stable API ```rs // both in core::ffi pub struct FromBytesUntilNulError(()); impl CStr { pub const fn from_bytes_until_nul( bytes: &[u8] ) -> Result<&CStr, FromBytesUntilNulError> } ``` cc ```@ericseppanen``` original author, ```@Mark-Simulacrum``` original reviewer, ```@m-ou-se``` brought up some issues on the thin pointer CStr ```@rustbot``` modify labels: +T-libs-api +needs-fcp
2023-02-08Rollup merge of #107317 - ids1024:asfd-rc, r=dtolnayMichael Goulet-0/+16
Implement `AsFd` and `AsRawFd` for `Rc` Fixes https://github.com/rust-lang/rust/issues/105931.
2023-02-09Extend `BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE`.Nicholas Nethercote-25/+81
To temporarily allow a `str` field in a packed struct using `derive`, along with `[u8]`.
2023-02-09Auto merge of #107717 - nnethercote:opt-TyKind-eq, r=compiler-errorsbors-41/+45
Optimize `TyKind::eq`. r? `@ghost`
2023-02-08Set `rust-analyzer.check.invocationLocation` to `root`clubby789-3/+7
2023-02-08rustdoc: use [svgo] to shrink `wheel.svg`Michael Howell-1/+1
[svgo]: https://github.com/svg/svgo $ du -bs src/librustdoc/html/static/images/wheel.svg wheel-old.svg 2972 src/librustdoc/html/static/images/wheel.svg 3764 wheel-old.svg 100*((2972-3764)/3764) = -21.04%
2023-02-08Auto merge of #107811 - matthiaskrgr:rollup-rpjzshk, r=matthiaskrgrbors-210/+1248
Rollup of 8 pull requests Successful merges: - #105641 (Implement cursors for BTreeMap) - #107271 (Treat Drop as a rmw operation) - #107710 (Update strip-ansi-escapes and vte) - #107758 (Change `arena_cache` to not alter the declared query result) - #107777 (Make `derive_const` derive properly const-if-const impls) - #107780 (Rename `replace_bound_vars_with_*` to `instantiate_binder_with_*`) - #107793 (Add missing tracking issue for `RawOsError`) - #107807 (Fix small debug typo) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-02-08bootstrap.py: fix build-failure messageKaDiWa-1/+3
2023-02-08add (currently ICEing) testlcnr-0/+43
2023-02-08correctly update goals in the cachelcnr-5/+8
2023-02-08Do not eagerly recover for bad impl-trait in macrosMichael Goulet-2/+35
2023-02-08Rollup merge of #107807 - GuillaumeGomez:fix-small-debug-typo, r=notriddleMatthias Krüger-1/+1
Fix small debug typo r? ``@notriddle``
2023-02-08Rollup merge of #107793 - joboet:raw_os_error_ty_tracking, r=Dylan-DPCMatthias Krüger-2/+2
Add missing tracking issue for `RawOsError` I forgot to add it in the original PR… See #107792. ```@rustbot``` label +T-libs-api -T-libs
2023-02-08Rollup merge of #107780 - compiler-errors:instantiate-binder, r=lcnrMatthias Krüger-60/+67
Rename `replace_bound_vars_with_*` to `instantiate_binder_with_*` Mentioning "binder" rather than "bound vars", imo, makes it clearer that we're doing something to the binder as a whole. Also, "instantiate" is the verb that I'm always reaching for when I'm looking for these functions, and the name that we use in the new solver anyways. r? types
2023-02-08Rollup merge of #107777 - ↵Matthias Krüger-17/+69
compiler-errors:derive_const-actually-derive-const, r=fee1-dead Make `derive_const` derive properly const-if-const impls Fixes #107774 Fixes #107666 Also fixes rendering of const-if-const bounds in pretty printing. r? ```@oli-obk``` or ```@fee1-dead```
2023-02-08Rollup merge of #107758 - Zoxc:arena-enref, r=cjgillotMatthias Krüger-70/+78
Change `arena_cache` to not alter the declared query result This makes the return types a bit clearer, limiting `arena_cache`'s effect to just the computation side. It also makes it easier to potentially remove `arena_cache`. r? ```@cjgillot```
2023-02-08Rollup merge of #107710 - ehuss:update-strip-ansi-escapes, r=Mark-SimulacrumMatthias Krüger-10/+28
Update strip-ansi-escapes and vte This updates strip-ansi-escapes from 0.1.0 to 0.1.1 (and consequently vte). Changes: https://github.com/luser/strip-ansi-escapes/compare/0.1.0...0.1.1 The only change really is updating vte which fixes some parsing issues (and drops the vendored source size by several megabytes). Closes #107708
2023-02-08Rollup merge of #107271 - Zeegomo:drop-rmw, r=oli-obkMatthias Krüger-9/+46
Treat Drop as a rmw operation Previously, a Drop terminator was considered a move in MIR. This commit changes the behavior to only treat Drop as a mutable access to the dropped place. In order for this change to be correct, we need to guarantee that 1. A dropped value won't be used again 2. Places that appear in a drop won't be used again before a subsequent initialization. We can ensure this to be correct at MIR construction because Drop will only be emitted when a variable goes out of scope, thus having: * (1) as there is no way of reaching the old value. drop-elaboration will also remove any uninitialized drop. * (2) as the place can't be named following the end of the scope. However, the initialization status, previously tracked by moves, should also be tied to the execution of a Drop, hence the additional logic in the dataflow analyses. From discussion in [this thread](https://rust-lang.zulipchat.com/#narrow/stream/233931-t-compiler.2Fmajor-changes/topic/.60DROP.60.20to.20.60DROP_IF.60.20compiler-team.23558), originating from https://github.com/rust-lang/compiler-team/issues/558. See also https://github.com/rust-lang/rust/pull/104488#discussion_r1085556010
2023-02-08Rollup merge of #105641 - Amanieu:btree_cursor, r=m-ou-seMatthias Krüger-41/+957
Implement cursors for BTreeMap See the ACP for an overview of the API: https://github.com/rust-lang/libs-team/issues/141 The implementation is split into 2 commits: - The first changes the internal insertion functions to return a handle to the newly inserted element. The lifetimes involved are a bit hairy since we need a mutable handle to both the `BTreeMap` itself (which holds the root) and the nodes allocated in memory. I have tested that this passes the standard library testsuite under miri. - The second commit implements the cursor API itself. This is more straightforward to follow but still involves some unsafe code to deal with simultaneous mutable borrows of the tree root and the node that is currently being iterated.
2023-02-08Auto merge of #107644 - Zoxc:query-cache-tweak, r=cjgillotbors-37/+4
Remove QueryStorage::store_nocache This method was added in https://github.com/rust-lang/rust/pull/70674 but it doesn't seem to serve any purpose.
2023-02-08Fix small debug typoGuillaume Gomez-1/+1
2023-02-08std: add tracking issue for `RawOsError`joboet-2/+2
2023-02-08Auto merge of #107529 - Zoxc:inline-tweak-profile, r=cjgillotbors-28/+26
Optimize query_cache_hit to reduce code size of the query hot path. A small tweak which improves performance on check builds by 0.33% and reduces `rustc_driver` size by 1%. <table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><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><td align="right">Time</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check</td><td align="right">1.7978s</td><td align="right">1.7980s</td><td align="right"> 0.01%</td><td align="right">1.7930s</td><td align="right"> -0.27%</td></tr><tr><td>🟣 <b>hyper</b>:check</td><td align="right">0.2594s</td><td align="right">0.2591s</td><td align="right"> -0.12%</td><td align="right">0.2592s</td><td align="right"> -0.09%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check</td><td align="right">6.2522s</td><td align="right">6.2540s</td><td align="right"> 0.03%</td><td align="right">6.2358s</td><td align="right"> -0.26%</td></tr><tr><td>🟣 <b>syn</b>:check</td><td align="right">1.5889s</td><td align="right">1.5880s</td><td align="right"> -0.05%</td><td align="right">1.5799s</td><td align="right"> -0.57%</td></tr><tr><td>🟣 <b>regex</b>:check</td><td align="right">0.9941s</td><td align="right">0.9939s</td><td align="right"> -0.02%</td><td align="right">0.9893s</td><td align="right"> -0.49%</td></tr><tr><td>Total</td><td align="right">10.8925s</td><td align="right">10.8930s</td><td align="right"> 0.01%</td><td align="right">10.8572s</td><td align="right"> -0.32%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9997s</td><td align="right"> -0.03%</td><td align="right">0.9967s</td><td align="right"> -0.33%</td></tr></table> r? `@cjgillot`
2023-02-08Change `arena_cache` to not alter the declared query resultJohn Kåre Alsaker-70/+78
2023-02-08 x.py fails all downloads that use a tempdir with snap curl #107722Tharun Suresh-8/+10
2023-02-08Auto merge of #107788 - matthiaskrgr:rollup-mw10sli, r=matthiaskrgrbors-164/+374
Rollup of 8 pull requests Successful merges: - #107656 (Bump rust-installer) - #107757 (Allow automatically creating vscode `settings.json` with `x setup`) - #107769 (Rename `PointerSized` to `PointerLike`) - #107770 (rustdoc: use a newline instead of `<br>` to format code headers) - #107771 (Tweak ICE message) - #107773 (Clearly signal purpose of the yaml template) - #107776 (Docs: Fix format of headings in String::reserve) - #107779 (Remove astconv usage in diagnostic) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-02-08Rollup merge of #107779 - compiler-errors:issue-107775, r=jackh726Matthias Krüger-10/+67
Remove astconv usage in diagnostic Fixes #107775 Location of the test sucks, I know, but I needed to put it somewhere :sweat: The issue here is that the root cause of the issue has nothing to do with what's being tested, so I couldn't really give it a better name. Oh well.
2023-02-08Rollup merge of #107776 - dbrgn:docs-string-reserve-headings, r=cuviperMatthias Krüger-2/+2
Docs: Fix format of headings in String::reserve It was inconsistent with other doc comments in the same module (and the rest of the rust std docs).
2023-02-08Rollup merge of #107773 - Mark-Simulacrum:rename-auto-template, r=estebankMatthias Krüger-1/+1
Clearly signal purpose of the yaml template Following up on https://github.com/rust-lang/rust/pull/106898#issuecomment-1383238532
2023-02-08Rollup merge of #107771 - estebank:ice-msg, r=compiler-errorsMatthias Krüger-16/+9
Tweak ICE message Modify main message to be more conversational and emit one fewer note.