about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-07-17Rollup merge of #127859 - RalfJung:ptr-dyn-metadata, r=scottmcmTrevor Gross-6/+10
ptr::metadata: avoid references to extern types References to `extern types` are somewhat dubious entities, since generally we say that references must be dereferenceable for their size as determined via `size_of_val`, but with `extern type` that is an ill-defined statement. I'd like to make Miri warn for such cases since it interacts poorly with Stacked Borrows. To avoid warnings people can't fix, this requires not using references to `extern type` in the standard library, and I think `DynMetadata` is the only currently remaining use. so this changes `DynMetadata` to use a NonNull raw pointer instead. Given that the alignment was 1, this shouldn't really change anything meaningful. I also updated a comment added by `@scottmcm` in https://github.com/rust-lang/rust/pull/125479, since I think the old comment is wrong. The `DynMetadata` type itself is not special, it is a normal aggregate. But computing field types for wide pointers (including references) is special.
2024-07-17Rollup merge of #127845 - ↵Trevor Gross-90/+119
workingjubilee:actually-break-up-big-ass-stack-overflow-fn, r=joboet unix: break `stack_overflow::install_main_guard` into smaller fn This was one big deeply-indented function for no reason. This made it hard to reason about the boundaries of its safety. Or just, y'know, read. Simplify it by splitting it into platform-specific functions, but which are still asked to keep compiling (a desirable property, since all of these OS use a similar API). This is mostly a whitespace change, so I suggest reviewing it only after setting Files changed -> (the options gear) -> [x] Hide whitespace as that will make it easier to see how the code was actually broken up instead of raw line diffs.
2024-07-17Rollup merge of #127828 - tgross35:docker-aarch64-uname, r=onur-ozkanTrevor Gross-4/+7
Commonize `uname -m` results for `aarch64` in docker runner `uname -m` on Linux reports `aarch64`, but on MacOS reports `arm64`. Commonize this to `aarch64`. With this fix, it is now possible to run aarch64 CI docker images on Arm MacOS.
2024-07-17Rollup merge of #127806 - nnethercote:parser-improvements, r=spastorinoTrevor Gross-122/+92
Some parser improvements I was looking closely at attribute handling in the parser while debugging some issues relating to #124141, and found a few small improvements. ``@spastorino``
2024-07-17Rollup merge of #127664 - ↵Trevor Gross-17/+170
compiler-errors:precise-capturing-better-sugg-apit, r=oli-obk Fix precise capturing suggestion for hidden regions when we have APITs Suggests to turn APITs into type parameters so they can be named in precise capturing syntax for hidden type lifetime errors. We also note that it may change the API. This is currently done via a note *and* a suggestion, which feels a bit redundant, but I wasn't totally sure of a better alternative for the presentation. Code is kind of a mess but there's a lot of cases to consider. Happy to iterate on this if you think the approach is too messy. Based on #127619, only the last commit is relevant. r? oli-obk Tracking: - https://github.com/rust-lang/rust/issues/123432
2024-07-17Rollup merge of #127652 - GuillaumeGomez:cg-gcc-fmt, r=UrgauTrevor Gross-55/+24
Unignore cg_gcc fmt `rustc_codegen_gcc` uses `rustfmt` now so it can be unignored. r? ``@Urgau``
2024-07-17Rollup merge of #127542 - c410-f3r:concat-again, r=petrochenkovTrevor Gross-38/+302
[`macro_metavar_expr_concat`] Add support for literals Adds support for literals in macro parameters. ```rust macro_rules! with_literal { ($literal:literal) => { const ${concat(FOO, $literal)}: i32 = 1; } } fn main() { with_literal!("_BAR"); assert_eq!(FOO_BAR, 1); } ``` cc #124225 r? ``@petrochenkov``
2024-07-17Auto merge of #127865 - matthiaskrgr:rollup-8m49dlg, r=matthiaskrgrbors-387/+717
Rollup of 8 pull requests Successful merges: - #125042 (Use ordinal number in argument error) - #127229 (rustdoc: click target for sidebar items flush left) - #127337 (Move a few intrinsics to Rust abi) - #127472 (MIR building: Stop using `unpack!` for `BlockAnd<()>`) - #127579 (Solve a error `.clone()` suggestion when moving a mutable reference) - #127769 (Don't use implicit features in `Cargo.toml` in `compiler/`) - #127844 (Remove invalid further restricting suggestion for type bound) - #127855 (Add myself to review rotation) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-17Add support for literalsCaio-38/+302
2024-07-17Auto merge of #125942 - timokroeger:windows-once-futex, r=ChrisDentonbors-0/+1
Windows: Use futex implementation for `Once` Keep the queue implementation for win7. Inspired by PR #121956 <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r​? <reviewer name> -->
2024-07-17Format cg_gcc with same formatting parametersGuillaume Gomez-54/+18
2024-07-17Ignore files in cg_gcc example folderGuillaume Gomez-0/+1
2024-07-17Align cg_gcc rustfmt.toml with rust'sGuillaume Gomez-0/+2
2024-07-17Unignore cg_gcc fmtGuillaume Gomez-1/+3
2024-07-17Commonize `uname -m` results for `aarch64` in docker runnerTrevor Gross-4/+7
`uname -m` on Linux reports `aarch64`, but on MacOS reports `arm64`. Commonize this to `aarch64`. With this fix, it is now possible to run aarch64 CI docker images on Arm MacOS.
2024-07-17Auto merge of #127760 - jieyouxu:rmake-support-reorganize, r=Kobzolbors-904/+1063
Reorganize the `run-make-support` library The `run_make_support` library has a kitchen sink `lib.rs` that make discovery/learning very difficult. Let's try to improve that by breaking up `lib.rs` into smaller more organized modules. This is a precursor to improving the documentation and learnability of the `run_make_support` library. ### Changes - Breakup `lib.rs` into smaller modules according to functionality - Rename `recursive_diff` -> `assert_dirs_are_equal` - Rename one of the `read_dir` with callback interface as `read_dir_entries` - Coalesced fs-related stuff onto a `fs` module, re-exported to tests as `rfs` - Minor doc improvements / fixes in a few places (I have a follow-up documentation PR planned) This PR is best reviewed commit-by-commit. r? `@Kobzol` (or Mark, or T-compiler or T-bootstrap) try-job: x86_64-msvc try-job: aarch64-apple try-job: test-various try-job: armhf-gnu try-job: dist-x86_64-linux
2024-07-17Fix precise capturing suggestion for hidden type when APITs are involvedMichael Goulet-17/+170
2024-07-17Rollup merge of #127855 - chenyukang:yukang-add-triagebot, r=jieyouxuMatthias Krüger-0/+3
Add myself to review rotation r? `@wesleywiser`
2024-07-17Rollup merge of #127844 - chenyukang:yukang-fix-type-bound-127555, r=jieyouxuMatthias Krüger-33/+70
Remove invalid further restricting suggestion for type bound This PR partially addresses #127555, it will remove the obvious error suggestion: ```console | ^^^^ required by this bound in `<Baz as Foo>::bar` help: consider further restricting this bound | 12 | F: FnMut() + Send + std::marker::Send, | +++++++++++++++++++ ``` I may create another PR to get a better diagnostic for `impl has stricter requirements than trait` scenario.
2024-07-17Rollup merge of #127769 - compiler-errors:ed-2024-dep, r=oli-obkMatthias Krüger-33/+42
Don't use implicit features in `Cargo.toml` in `compiler/` Fixes compiler crates to stop using implicit features (https://github.com/rust-lang/cargo/issues/12826) which are denied in in edition 2024.
2024-07-17Rollup merge of #127579 - surechen:fix_127285, r=lcnrMatthias Krüger-41/+128
Solve a error `.clone()` suggestion when moving a mutable reference If the moved value is a mut reference, it is used in a generic function and it's type is a generic param, suggest it can be reborrowed to avoid moving. for example: ```rust struct Y(u32); // x's type is '& mut Y' and it is used in `fn generic<T>(x: T) {}`. fn generic<T>(x: T) {} ``` fixes #127285
2024-07-17Rollup merge of #127472 - Zalathar:block-and-unit, r=fmeaseMatthias Krüger-73/+86
MIR building: Stop using `unpack!` for `BlockAnd<()>` This is a subset of #127416, containing only the parts related to `BlockAnd<()>`. The first patch removes the non-assigning form of the `unpack!` macro, because it is frustratingly inconsistent with the main form. We can replace it with an ordinary method that discards the `()` and returns the block. The second patch then finds all of the remaining code that was using `unpack!` with `BlockAnd<()>`, and updates it to use that new method instead. --- Changes since original review of #127416: - Renamed `fn unpack_block` → `fn into_block` - Removed `fn unpack_discard`, replacing it with `let _: BlockAnd<()> = ...` (2 occurrences) - Tweaked `arm_end_blocks` to unpack earlier and build `Vec<BasicBlock>` instead of `Vec<BlockAnd<()>>`
2024-07-17Rollup merge of #127337 - celinval:intrinsics-fallback, r=oli-obkMatthias Krüger-63/+166
Move a few intrinsics to Rust abi Move a few more intrinsic functions to the convention added in #121192. In the second commit, I added documentation about their safety requirements. Let me know if you would like me to move the second commit to a different PR. Note: I kept the same signature of `pref_align_of`, but I was wondering why this function is considered unsafe?
2024-07-17Rollup merge of #127229 - notriddle:notriddle/mile-wide-bar, r=GuillaumeGomezMatthias Krüger-7/+71
rustdoc: click target for sidebar items flush left This change adjusts the clickable area of sidebar links to touch the leftmost edge of the canvas, making them [much easier](https://www.nngroup.com/articles/fitts-law/) to click (when the browser window is maximized or tiled left, but those cases are common enough to matter). [Screencast from 2024-07-15 15-31-07.webm](https://github.com/user-attachments/assets/1e952d3a-e9e7-476b-b211-44a17c190b38) <details><summary>old screencast</summary> [Screencast from 2024-07-01 17-23-34.webm](https://github.com/rust-lang/rust/assets/1593513/dc6f9c2e-5904-403d-b353-d233e6e1afbc) </details>
2024-07-17Rollup merge of #125042 - long-long-float:suggest-move-arg-outside, r=fmeaseMatthias Krüger-137/+151
Use ordinal number in argument error Add an ordinal number to two argument errors ("unexpected" and "missing") for ease of understanding error. ``` error[E0061]: this function takes 3 arguments but 2 arguments were supplied --> test.rs:11:5 | 11 | f(42, 'a'); | ^ --- 2nd argument of type `f32` is missing | (snip) error[E0061]: this function takes 3 arguments but 4 arguments were supplied --> test.rs:12:5 | 12 | f(42, 42, 1.0, 'a'); | ^ ---- | | | | | unexpected 2nd argument of type `{integer}` | help: remove the extra argument ``` To get an ordinal number, I copied `ordinalize` from other crate `rustc_resolve` because I think it is too much to link `rustc_resolve` for this small function. Please let me know if there is a better way.
2024-07-17tests: update for `rfs` rename许杰友 Jieyou Xu (Joe)-82/+80
2024-07-17run_make_support: use `fs` internally, but `rfs` to tests许杰友 Jieyou Xu (Joe)-21/+30
2024-07-17tests: update rustdoc test for renamed `assert_dirs_are_equal`许杰友 Jieyou Xu (Joe)-2/+2
2024-07-17run_make_support: rename `assert_recursive_eq` to `assert_dirs_are_equal`许杰友 Jieyou Xu (Joe)-3/+3
2024-07-17run_make_support: moved some helpers into `string` module许杰友 Jieyou Xu (Joe)-46/+54
2024-07-17run_make_support: move some helpers from assertion to path许杰友 Jieyou Xu (Joe)-53/+53
2024-07-17tests: update for renamed `fs` module in run_make_support许杰友 Jieyou Xu (Joe)-239/+225
2024-07-17run_make_support: coalesce fs helpers into single `fs` module许杰友 Jieyou Xu (Joe)-117/+104
There were *two* `read_dir` helpers, one being a simple `std::fs::read_dir` wrapper, the other has a different callback-based signature. We also rename the callback-based `read_dir` as `read_dir_entries`. Also don't top-level re-export most `fs::*` helpers.
2024-07-17Auto merge of #127851 - tgross35:rollup-i39um74, r=tgross35bors-97/+121
Rollup of 4 pull requests Successful merges: - #127763 (Make more Windows functions `#![deny(unsafe_op_in_unsafe_fn)]`) - #127813 (Prevent double reference in generic futex) - #127847 (Reviewer on vacation) - #127850 (bootstrap: open `llvm-config` as r+w) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-17run_make_support: rename `cygpath_windows` to `get_windows_path` and move ↵许杰友 Jieyou Xu (Joe)-42/+45
under `external_deps` as private
2024-07-17run_make_support: rename `env_checked` -> `env`许杰友 Jieyou Xu (Joe)-11/+10
2024-07-17run_make_support: move `build_native_static_lib` under `external_deps`许杰友 Jieyou Xu (Joe)-50/+30
And fix some `ar`-related rebase mishaps.
2024-07-17run_make_support: make `set_host_rpath` private and move into `util`许杰友 Jieyou Xu (Joe)-24/+28
2024-07-17run_make_support: move `handle_failed_output` into `util` module许杰友 Jieyou Xu (Joe)-24/+31
2024-07-17run_make_support: move `assert_recursive_eq` into `assertion_helpers`许杰友 Jieyou Xu (Joe)-27/+28
2024-07-17tests: update rustdoc test for renamed `assert_recursive_eq`许杰友 Jieyou Xu (Joe)-2/+2
2024-07-17run_make_support: rename `recursive_diff` to `assert_recursive_eq`许杰友 Jieyou Xu (Joe)-3/+3
2024-07-17run_make_support: move assertions and helpers into own module许杰友 Jieyou Xu (Joe)-134/+150
2024-07-17run_make_support: move `run_in_tmpdir` and `test_while_readonly` to ↵许杰友 Jieyou Xu (Joe)-54/+75
`scoped_run` module
2024-07-17run_make_support: move fs helpers to own module许杰友 Jieyou Xu (Joe)-65/+75
2024-07-17run_make_support: move path-related helpers into own module许杰友 Jieyou Xu (Joe)-34/+75
2024-07-17run_make_support: move artifact name helpers into `artifact_names` module许杰友 Jieyou Xu (Joe)-76/+87
2024-07-17run_make_support: move `ar` into own module许杰友 Jieyou Xu (Joe)-14/+30
2024-07-17run_make_support: cleanup and document some lib.rs reexports许杰友 Jieyou Xu (Joe)-1/+10
2024-07-17run_make_support: move external deps to `external_deps` module许杰友 Jieyou Xu (Joe)-24/+49