about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-09-28Make use of `wait-for*-false` commandsGuillaume Gomez-12/+6
2024-09-28Update `browser-ui-test` version to `0.18.1`Guillaume Gomez-1/+1
2024-09-28Auto merge of #130964 - matthiaskrgr:rollup-suriuub, r=matthiaskrgrbors-264/+483
Rollup of 8 pull requests Successful merges: - #125404 (Fix `read_buf` uses in `std`) - #130866 (Allow instantiating object trait binder when upcasting) - #130922 (Reference UNSPECIFIED instead of INADDR_ANY in join_multicast_v4) - #130924 (Make clashing_extern_declarations considering generic args for ADT field) - #130939 (rustdoc: update `ProcMacro` docs section on helper attributes) - #130940 (Revert space-saving operations) - #130944 (Allow instantiating trait object binder in ptr-to-ptr casts) - #130953 (Rename a few tests to make tidy happier) r? `@ghost` `@rustbot` modify labels: rollup
2024-09-28Auto merge of #130897 - workingjubilee:dump-hexes-with-class, r=thomccbors-1/+1
library: Compute `RUST_EXCEPTION_CLASS` from native-endian bytes This makes it appear correctly in hexdumps on both LE and BE platforms.
2024-09-28Rollup merge of #130953 - workingjubilee:rename-a-few-ctypes-tests, r=fee1-deadMatthias Krüger-14/+20
Rename a few tests to make tidy happier A somewhat random smattering of tests that I have recently looked at, and thus had cause to research and write down the reason for their existence.
2024-09-28Rollup merge of #130944 - lukas-code:ptr-ptr-sub, r=compiler-errorsMatthias Krüger-7/+65
Allow instantiating trait object binder in ptr-to-ptr casts For unsizing coercions between trait objects with the same principal, we already allow instantiating the for binder. For example, coercing `Box<dyn for<'a> Trait<'a>` to `Box<dyn Trait<'static>>` is allowed. Since ptr-to-ptr casts will insert an unsizing coercion before the cast if possible, this has the consequence that the following compiles already: ```rust // This compiles today. fn cast<'b>(x: *mut dyn for<'a> Trait<'a>) -> *mut dyn Trait<'b> { // lowered as (roughly) // tmp: *mut dyn Trait<'?0> = Unsize(x) // requires dyn for<'a> Trait<'a> <: dyn Trait<'?0> // ret: *mut dyn Trait<'b> = PtrToPtr(tmp) // requires dyn Trait<'?0> == dyn Trait<'b> x as _ } ``` However, if no unsizing coercion is inserted then this currently fails to compile as one type is more general than the other. This PR will allow this code to compile, too, by changing ptr-to-ptr casts of pointers with vtable metadata to use sutyping instead of type equality. ```rust // This will compile after this PR. fn cast<'b>(x: *mut dyn for<'a> Trait<'a>) -> *mut Wrapper<dyn Trait<'b>> { // lowered as (roughly) // no Unsize here! // ret: *mut Wrapper<dyn Trait<'b>> = PtrToPtr(x) // requires dyn for<'a> Trait<'a> == dyn Trait<'b> x as _ } ``` Note that it is already possible to work around the current restrictions and make the code compile before this PR by splitting the cast in two, so this shouldn't allow a new class of programs to compile: ```rust // Workaround that compiles today. fn cast<'b>(x: *mut dyn for<'a> Trait<'a>) -> *mut Wrapper<dyn Trait<'b>> { x as *mut dyn Trait<'_> as _ } ``` r? `@compiler-errors` cc `@WaffleLapkin`
2024-09-28Rollup merge of #130940 - workingjubilee:remove-space-saving-operations, ↵Matthias Krüger-20/+3
r=Kobzol Revert space-saving operations The "all of our artifacts" `mv` seems like it may save enough space to matter sometimes, since it can range up to a gigabyte of difference, if memory serves. For the rest, I think we're good. try-job: dist-aarch64-apple
2024-09-28Rollup merge of #130939 - obi1kenobi:patch-2, r=aDotInTheVoidMatthias Krüger-1/+1
rustdoc: update `ProcMacro` docs section on helper attributes I believe the mention of attribute macros in the section on proc macro helper attributes is erroneous. As far as I can tell, attribute macros cannot define helper attributes. The following attribute macro is not valid (fails to build), no matter how I try to define (or skip defining) the helpers: ```rust #[proc_macro_attribute(attributes(helper))] pub fn attribute_helpers(_attr: TokenStream, item: TokenStream) -> TokenStream { item } ``` The [language reference](https://doc.rust-lang.org/reference/procedural-macros.html#attribute-macros) also doesn't seem to mention attribute macro helpers. The helpers subsection is inside the section on derive macros.
2024-09-28Rollup merge of #130924 - surechen:fix_130851, r=compiler-errorsMatthias Krüger-3/+76
Make clashing_extern_declarations considering generic args for ADT field In following example, G<u16> should be recognized as different from G<u32> : ```rust #[repr(C)] pub struct G<T> { g: [T; 4] } pub mod x { extern "C" { pub fn g(_: super::G<u16>); } } pub mod y { extern "C" { pub fn g(_: super::G<u32>); } } ``` fixes #130851
2024-09-28Rollup merge of #130922 - tyilo:udp-unspecified, r=ibraheemdevMatthias Krüger-2/+2
Reference UNSPECIFIED instead of INADDR_ANY in join_multicast_v4
2024-09-28Rollup merge of #130866 - compiler-errors:dyn-instantiate-binder, r=lcnrMatthias Krüger-201/+228
Allow instantiating object trait binder when upcasting This PR fixes two bugs (that probably need an FCP). ### We use equality rather than subtyping for upcasting dyn conversions This code should be valid: ```rust #![feature(trait_upcasting)] trait Foo: for<'h> Bar<'h> {} trait Bar<'a> {} fn foo(x: &dyn Foo) { let y: &dyn Bar<'static> = x; } ``` But instead: ``` error[E0308]: mismatched types --> src/lib.rs:7:32 | 7 | let y: &dyn Bar<'static> = x; | ^ one type is more general than the other | = note: expected existential trait ref `for<'h> Bar<'h>` found existential trait ref `Bar<'_>` ``` And so should this: ```rust #![feature(trait_upcasting)] fn foo(x: &dyn for<'h> Fn(&'h ())) { let y: &dyn FnOnce(&'static ()) = x; } ``` But instead: ``` error[E0308]: mismatched types --> src/lib.rs:4:39 | 4 | let y: &dyn FnOnce(&'static ()) = x; | ^ one type is more general than the other | = note: expected existential trait ref `for<'h> FnOnce<(&'h (),)>` found existential trait ref `FnOnce<(&(),)>` ``` Specifically, both of these fail because we use *equality* when comparing the supertrait to the *target* of the unsize goal. For the first example, since our supertrait is `for<'h> Bar<'h>` but our target is `Bar<'static>`, there's a higher-ranked type mismatch even though we *should* be able to instantiate that supertrait binder when upcasting. Similarly for the second example. ### New solver uses equality rather than subtyping for no-op (i.e. non-upcasting) dyn conversions This code should be valid in the new solver, like it is with the old solver: ```rust // -Znext-solver fn foo<'a>(x: &mut for<'h> dyn Fn(&'h ())) { let _: &mut dyn Fn(&'a ()) = x; } ``` But instead: ``` error: lifetime may not live long enough --> <source>:2:11 | 1 | fn foo<'a>(x: &mut dyn for<'h> Fn(&'h ())) { | -- lifetime `'a` defined here 2 | let _: &mut dyn Fn(&'a ()) = x; | ^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static` | = note: requirement occurs because of a mutable reference to `dyn Fn(&())` ``` Specifically, this fails because we try to coerce `&mut dyn for<'h> Fn(&'h ())` to `&mut dyn Fn(&'a ())`, which registers an `dyn for<'h> Fn(&'h ()): dyn Fn(&'a ())` goal. This fails because the new solver uses *equating* rather than *subtyping* in `Unsize` goals. This is *mostly* not a problem... You may wonder why the same code passes on the new solver for immutable references: ``` // -Znext-solver fn foo<'a>(x: &dyn Fn(&())) { let _: &dyn Fn(&'a ()) = x; // works } ``` That's because in this case, we first try to coerce via `Unsize`, but due to the leak check the goal fails. Then, later in coercion, we fall back to a simple subtyping operation, which *does* work. Since `&T` is covariant over `T`, but `&mut T` is invariant, that's where the discrepancy between these two examples crops up. --- r? lcnr or reassign :D
2024-09-28Rollup merge of #125404 - a1phyr:fix-read_buf-uses, r=workingjubileeMatthias Krüger-16/+88
Fix `read_buf` uses in `std` Following lib-team decision here: https://github.com/rust-lang/rust/issues/78485#issuecomment-2122992314 Guard against the pathological behavior of both returning an error and performing a read.
2024-09-28Auto merge of #130874 - klensy:bumpme, r=jieyouxubors-79/+36
bump few deps Bumps cargo_metadata, thorin-dwp, windows. Should dedupe some crates around.
2024-09-28Auto merge of #130948 - GuillaumeGomez:subtree-update, r=GuillaumeGomezbors-366/+943
GCC backend subtree update We just finished the [last sync](https://github.com/rust-lang/rustc_codegen_gcc/pull/556) so time to sync back. cc `@antoyo`
2024-09-28Auto merge of #130929 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo 19 commits in eaee77dc1584be45949b75e4c4c9a841605e3a4b..80d82ca22abbee5fb7b51fa1abeb1ae34e99e88a 2024-09-19 21:10:23 +0000 to 2024-09-27 17:56:01 +0000 - Update cc to 1.1.22 (rust-lang/cargo#14607) - feat: lockfile path implies --locked on cargo install (rust-lang/cargo#14556) - feat(toml): Add `autolib` (rust-lang/cargo#14591) - fix: correct error count for `cargo check --message-format json` (rust-lang/cargo#14598) - test: relax panic output assertion (rust-lang/cargo#14602) - feat(timings): support dark color scheme in HTML output (rust-lang/cargo#14588) - feat: add CARGO_MANIFEST_PATH env variable (rust-lang/cargo#14404) - fix(config): Don't double-warn about `$CARGO_HOME/config` (rust-lang/cargo#14579) - fix(cargo-rustc): give trailing flags higher precedence on nightly (rust-lang/cargo#14587) - feat: make lockfile v4 the default (rust-lang/cargo#14595) - perf: Improve quality of completion performance traces (rust-lang/cargo#14592) - test: Remove completion tests (rust-lang/cargo#14590) - feat: Add support for completing `cargo update &lt;TAB&gt;` (rust-lang/cargo#14552) - test: Migrate remaining with_stdout/with_stderr calls (rust-lang/cargo#14577) - fix(resolve): Improve multi-MSRV workspaces (rust-lang/cargo#14569) - chore: Bump MSRV to 1.81 (rust-lang/cargo#14585) - Add a `--dry-run` flag to the `install` command (rust-lang/cargo#14280) - fix(resolve): Don't list transitive, incompatible dependencies as available (rust-lang/cargo#14568) - feat(complete): Upgrade clap_complete (rust-lang/cargo#14573)
2024-09-27tests: issue-34798.rs => allow-phantomdata-in-ffi.rsJubilee Young-1/+2
2024-09-27Auto merge of #130946 - matthiaskrgr:rollup-ia4mf0y, r=matthiaskrgrbors-547/+727
Rollup of 6 pull requests Successful merges: - #130718 (Cleanup some known-bug issues) - #130730 (Reorganize Test Headers) - #130826 (Compiler: Rename "object safe" to "dyn compatible") - #130915 (fix typo in triagebot.toml) - #130926 (Update cc to 1.1.22 in library/) - #130932 (etc: Add sample rust-analyzer configs for eglot & helix) r? `@ghost` `@rustbot` modify labels: rollup
2024-09-27tests: issue-14309.* => repr-rust-is-undefined.*Jubilee Young-12/+15
2024-09-27tests: issue-69488.rs => load-preserves-partial-init-issue-69488.rsJubilee Young-1/+3
2024-09-27Update libgccjit version used in CIGuillaume Gomez-1/+1
2024-09-27FmtGuillaume Gomez-3/+2
2024-09-27Merge commit '3187d32079b817522cc17413ec9185b130daf693' into subtree-updateGuillaume Gomez-365/+943
2024-09-27Update cargoWeihang Lo-0/+0
2024-09-27Get rid of a_is_expected from ToTraceMichael Goulet-112/+36
2024-09-27Instantiate binders when checking supertrait upcastingMichael Goulet-48/+132
2024-09-27Rollup merge of #130932 - mrkajetanp:editors, r=jieyouxuMatthias Krüger-0/+79
etc: Add sample rust-analyzer configs for eglot & helix LSP configuration in editors like Emacs (eglot) and helix does not use the same JSON format as vscode and vim do. It is not obvious how to set up LSP for rustc in those editors and the dev guide currently does not cover them. Adding sample configuration files for those editors alongside the currently existing JSON one would be helpful. I figured having those included in the repo like the JSON one might save someone some time and frustration otherwise spent on trying to get the more niche editors' LSP to work properly. I'll add a section in the dev guide too.
2024-09-27Rollup merge of #130926 - ChrisDenton:cc-1-1-22, r=tgross35Matthias Krüger-2/+12
Update cc to 1.1.22 in library/ r? `@ghost` try-job: x86_64-msvc
2024-09-27Rollup merge of #130915 - naskya:fix/typo, r=jieyouxuMatthias Krüger-1/+1
fix typo in triagebot.toml This pull request fixes a minor typo in the triagebot config file.
2024-09-27Rollup merge of #130826 - fmease:compiler-mv-obj-safe-dyn-compat, ↵Matthias Krüger-510/+523
r=compiler-errors Compiler: Rename "object safe" to "dyn compatible" Completed T-lang FCP: https://github.com/rust-lang/lang-team/issues/286#issuecomment-2338905118. Tracking issue: https://github.com/rust-lang/rust/issues/130852 Excludes `compiler/rustc_codegen_cranelift` (to be filed separately). Includes Stable MIR. Regarding https://github.com/rust-lang/rust/labels/relnotes, I guess I will manually open a https://github.com/rust-lang/rust/labels/relnotes-tracking-issue since this change affects everything (compiler, library, tools, docs, books, everyday language). r? ghost
2024-09-27Rollup merge of #130730 - veera-sivarajan:clean-test-headers, r=compiler-errorsMatthias Krüger-11/+12
Reorganize Test Headers This PR moves the test headers to the top in a couple of test files to maintain consistent style. Based on this comment: https://github.com/rust-lang/rust/pull/130665#discussion_r1770506261
2024-09-27Rollup merge of #130718 - jackh726:known-bug-cleanup, r=compiler-errorsMatthias Krüger-23/+100
Cleanup some known-bug issues I went through most of the known-bug tests (except those under `tests/crashes`) and made sure the issue had the `S-bug-has-test` label and checked that the linked issue was open. This is a bunch of cleanups, mainly issues that have been closed and the tests should have been updated. Importantly, there are many known-bug tests linking to #110395. This *probably* isn't right - that is a tracking issue. But I don't really know what the "right" thing to do here. Probably, most that are actually *supposed* to be tests for const trait need to be linked to *that* tracking issue. And any other tests that were mislabeled need to be handled accordingly e.g. #130482. cc `@fee1-dead`
2024-09-27Merge pull request #556 from GuillaumeGomez/sync_2024-08-12Guillaume Gomez-474/+1009
Sync 2024-08-12
2024-09-27borrowck: use subtyping instead of equality for ptr-to-ptr castsLukas Markeffsky-29/+2
2024-09-27add even more tests for ptr-to-ptr casts on trait objectsLukas Markeffsky-7/+92
2024-09-27Partially revert "ci: Use mv instead of cp in upload step"Jubilee Young-3/+3
This partially reverts commit fe7c97c2e732de8dfc93ef21ee84ccfbc04c7d0c. I kept a mv, not a cp, for the one that shuffles major artifacts around, because the size of those artifacts are big enough to matter, sometimes. I don't think the diagnostic info will be that heavy, by comparison.
2024-09-27Revert "ci: Try to remove unused Xcode dirs"Jubilee Young-17/+0
This reverts commit 06f49f6d5326440192b8d31d69fa490dbfe01cfe.
2024-09-27rustdoc: update `ProcMacro` docs section on helper attributesPredrag Gruevski-1/+1
I believe the mention of attribute macros in the section on proc macro helper attributes is erroneous. As far as I can tell, attribute macros cannot define helper attributes. The following attribute macro is not valid (fails to build), no matter how I try to define (or skip defining) the helpers: ```rust #[proc_macro_attribute(attributes(helper))] pub fn attribute_helpers(_attr: TokenStream, item: TokenStream) -> TokenStream { item } ``` The [language reference](https://doc.rust-lang.org/reference/procedural-macros.html#attribute-macros) also doesn't seem to mention attribute macro helpers. The helpers subsection is inside the section on derive macros.
2024-09-27Cleanup some known-bug issuesJack Huey-23/+100
2024-09-27CleanupAntoni Boucher-30/+12
2024-09-27Auto merge of #130934 - matthiaskrgr:rollup-4puticr, r=matthiaskrgrbors-159/+226
Rollup of 7 pull requests Successful merges: - #129087 (Stabilize `option_get_or_insert_default`) - #130435 (Move Apple linker args from `rustc_target` to `rustc_codegen_ssa`) - #130459 (delete sub build directory "debug" to not delete the change-id file) - #130873 (rustc_target: Add powerpc64 atomic-related features) - #130916 (Use `&raw` in the compiler) - #130917 (Fix error span if arg to `asm!()` is a macro call) - #130927 (update outdated comments) r? `@ghost` `@rustbot` modify labels: rollup
2024-09-27Rollup merge of #130927 - lcnr:normalizes-to-comments, r=compiler-errorsMatthias Krüger-8/+8
update outdated comments r? `@compiler-errors` cc `@gavinleroy`
2024-09-27Rollup merge of #130917 - gurry:129503-ice-wrong-span-in-macros, r=chenyukangMatthias Krüger-8/+63
Fix error span if arg to `asm!()` is a macro call Fixes #129503 When the argument to `asm!()` is a macro call, e.g. `asm!(concat!("abc", "{} pqr"))`, and there's an error in the resulting template string, we do not take into account the presence of this macro call while computing the error span. This PR fixes that. Now we will use the entire thing between the parenthesis of `asm!()` as the error span in this situation e.g. for `asm!(concat!("abc", "{} pqr"))` the error span will be `concat!("abc", "{} pqr")`.
2024-09-27Rollup merge of #130916 - cuviper:compiler-raw_ref_op, r=compiler-errorsMatthias Krüger-13/+13
Use `&raw` in the compiler Like #130865 did for the standard library, we can use `&raw` in the compiler now that stage0 supports it. Also like the other issue, I did not make any doc or test changes at this time.
2024-09-27Rollup merge of #130873 - taiki-e:ppc64-atomic, r=AmanieuMatthias Krüger-2/+4
rustc_target: Add powerpc64 atomic-related features This adds the following two target features to unstable powerpc_target_feature. - `partword-atomics`: 8-bit and 16-bit atomic instructions (`l{b,h}arx` and `st{b,h}cx.`) ([definition in LLVM](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/PowerPC/PPC.td#L170-L172)) - `quadword-atomics`: 128-bit atomic instructions (`lqarx` and `stqcx.`) ([definition in LLVM](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/PowerPC/PPC.td#L173-L175)) Both features are [available on power8+](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/PowerPC/PPC.td#L408-L422), so enabled by default for `powerpc64le-*` targets. r? `@Amanieu` `@rustbot` label +O-PowerPC
2024-09-27Rollup merge of #130459 - onur-ozkan:#130449, r=albertlarsan68Matthias Krüger-3/+3
delete sub build directory "debug" to not delete the change-id file Fixes #130449
2024-09-27Rollup merge of #130435 - madsmtm:move-apple-link-args, r=petrochenkovMatthias Krüger-121/+134
Move Apple linker args from `rustc_target` to `rustc_codegen_ssa` They are dependent on the deployment target and SDK version, but having these in `rustc_target` makes it hard to introduce that dependency. Part of the work needed to do https://github.com/rust-lang/rust/issues/118204, see https://github.com/rust-lang/rust/pull/129342 for some discussion. Tested using: ```console ./x test tests/run-make/apple-deployment-target --target="aarch64-apple-darwin,aarch64-apple-ios,aarch64-apple-ios-macabi,aarch64-apple-ios-sim,aarch64-apple-tvos,aarch64-apple-tvos-sim,aarch64-apple-visionos,aarch64-apple-visionos-sim,aarch64-apple-watchos,aarch64-apple-watchos-sim,arm64_32-apple-watchos,armv7k-apple-watchos,armv7s-apple-ios,x86_64-apple-darwin,x86_64-apple-ios,x86_64-apple-ios-macabi,x86_64-apple-tvos,x86_64-apple-watchos-sim,x86_64h-apple-darwin" IPHONEOS_DEPLOYMENT_TARGET=10.0 ./x test tests/run-make/apple-deployment-target --target=i386-apple-ios ``` `arm64e-apple-darwin` and `arm64e-apple-ios` have not been tested, see https://github.com/rust-lang/rust/issues/130085, neither is `i686-apple-darwin`, since that requires using an x86_64 macbook, and I currently can't get mine to work, see https://github.com/rust-lang/rust/issues/130434. CC `@petrochenkov`
2024-09-27Rollup merge of #129087 - slanterns:option_get_or_insert_default, r=dtolnayMatthias Krüger-4/+1
Stabilize `option_get_or_insert_default` Closes: https://github.com/rust-lang/rust/issues/82901. `@rustbot` label: +T-libs-api r? libs-api
2024-09-27gitignore: Add eglot LSP config fileKajetan Puchalski-0/+1
2024-09-27etc: Add rust-analyzer configs for eglot & helixKajetan Puchalski-0/+78
LSP configuration in editors like Emacs (eglot) and helix does not use the same JSON format as vscode and vim do. It is not obvious how to set up LSP for rustc in those editors and the dev guide currently does not cover them. Adding sample configuration files for those editors alongside the currently existing JSON one would be helpful.
2024-09-27Fix for libgccjit 12Antoni Boucher-0/+3