about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2024-11-26update crasheslcnr-15/+89
2024-11-26do not constrain infer vars in `find_best_leaf_obligation`lcnr-119/+12
2024-11-26Auto merge of #132894 - frank-king:feature/where-refactor, r=cjgillotbors-23/+23
Refactor `where` predicates, and reserve for attributes support Refactor `WherePredicate` to `WherePredicateKind`, and reserve for attributes support in `where` predicates. This is a part of #115590 and is split from #132388. r? petrochenkov
2024-11-25Refactor `where` predicates, and reserve for attributes supportFrank King-23/+23
2024-11-25Rollup merge of #132432 - davidlattimore:std-interposable, r=Mark-SimulacrumMatthias Krüger-0/+63
Add a test to verify that libstd doesn't use protected symbols
2024-11-25Rollup merge of #131664 - taiki-e:s390x-asm-vreg-inout, r=AmanieuMatthias Krüger-111/+1222
Support input/output in vector registers of s390x inline assembly (under asm_experimental_reg feature) This extends currently clobber-only vector registers (`vreg`) support to allow passing `#[repr(simd)]` types, floats (f32/f64/f128), and integers (i32/i64/i128) as input/output. This is unstable and gated under new `#![feature(asm_experimental_reg)]` (tracking issue: https://github.com/rust-lang/rust/issues/133416). If the feature is not enabled, only clober is supported as before. | Architecture | Register class | Target feature | Allowed types | | ------------ | -------------- | -------------- | -------------- | | s390x | `vreg` | `vector` | `i32`, `f32`, `i64`, `f64`, `i128`, `f128`, `i8x16`, `i16x8`, `i32x4`, `i64x2`, `f32x4`, `f64x2` | This matches the list of types that are supported by the vector registers in LLVM: https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/SystemZ/SystemZRegisterInfo.td#L301-L313 In addition to `core::simd` types and floats listed above, custom `#[repr(simd)]` types of the same size and type are also allowed. All allowed types other than i32/f32/i64/f64/i128, and relevant target features are currently unstable. Currently there is no SIMD type for s390x in `core::arch`, but this is tracked in https://github.com/rust-lang/rust/issues/130869. cc https://github.com/rust-lang/rust/issues/130869 about vector facility support in s390x cc https://github.com/rust-lang/rust/issues/125398 & https://github.com/rust-lang/rust/issues/116909 about f128 support in asm `@rustbot` label +O-SystemZ +A-inline-assembly
2024-11-25Rollup merge of #131523 - nbdd0121:asm, r=compiler-errorsMatthias Krüger-23/+109
Fix asm goto with outputs and move it to a separate feature gate Tracking issue: #119364 This PR addresses 3 aspects of asm goto with outputs: * Codegen is fixed. My initial implementation has an oversight which cause the output to be only stored in fallthrough path, but not in label blocks. * Outputs can now be used with `options(noreturn)` if a label block is given. * All of this is moved to a new feature gate, because we likely want to stabilise `asm_goto` before asm goto with outputs. `@rustbot` labels: +A-inline-assembly +F-asm
2024-11-25Rollup merge of #133384 - RalfJung:vector-abi-check-tests, r=jieyouxu许杰友 Jieyou Xu (Joe)-19/+92
add a test for target-feature-ABI warnings in closures and when calling extern fn Also update the comment regarding the inheritance of target features into closures, to make it more clear that we really shouldn't do this right now.
2024-11-25Rollup merge of #133260 - compiler-errors:deref, r=fee1-dead许杰友 Jieyou Xu (Joe)-21/+13
Constify the `Deref`/`DerefMut` traits, too One more constification. Rebased on that one commit that makes it so we don't need to provide stability on const impls. r? fee1-dead
2024-11-25Rollup merge of #133105 - bvanjoi:issue-132743, r=petrochenkov许杰友 Jieyou Xu (Joe)-0/+28
only store valid proc macro item for doc link Fixes #132743 The definition item can be detected if it is exported in the doc, so store these items rather than skipping. r? `@petrochenkov`
2024-11-24Make asm_goto_with_outputs a separate feature gateGary Guo-2/+28
2024-11-24Support use of asm goto with outputs and `options(noreturn)`Gary Guo-3/+33
When labels are present, the `noreturn` option really means that asm block won't fallthrough -- if labels are present, then outputs can still be meaningfully used.
2024-11-24Fix asm goto with outputsGary Guo-20/+50
When outputs are used together with labels, they are considered to be written for all destinations, not only when falling through.
2024-11-24Make s390x non-clobber-only vector register support unstableTaiki Endo-116/+674
2024-11-24Rollup merge of #133389 - eduardosm:stabilize-const_float_methods, r=RalfJungMatthias Krüger-1/+0
Stabilize `const_float_methods` Tracking issue: https://github.com/rust-lang/rust/issues/130843 Relnotes: #133383 Stabilized const API: ```rust // in `core` impl f32/f64 { pub const fn recip(self) -> Self; pub const fn to_degrees(self) -> Self; pub const fn to_radians(self) -> Self; pub const fn max(self, other: Self) -> Self; pub const fn min(self, other: Self) -> Self; pub const fn clamp(self, min: Self, max: Self) -> Self; pub const fn abs(self) -> Self; pub const fn signum(self) -> Self; pub const fn copysign(self, sign: Self) -> Self; } ``` Closes https://github.com/rust-lang/rust/issues/130843 r? libs-api cc `@RalfJung` -- I think the way const-stability attributes work have change a bit since the last time a wrote a const-stabilization PR, please make sure I got them right.
2024-11-24add vector ABI check test for calling extern fnRalf Jung-11/+61
2024-11-24add a test for target-feature-ABI warnings in closuresRalf Jung-10/+33
2024-11-24Constify Deref and DerefMutMichael Goulet-21/+13
2024-11-23Auto merge of #131859 - chriskrycho:update-trpl, r=onur-ozkanbors-137/+137
Update TRPL to add new Chapter 17: Async and Await - Add support to `rustbook` to pass through the `-L`/`--library-path` flag to `mdbook` so that references to the `trpl` crate - Build the `trpl` crate as part of the book tests. Make it straightforward to add other such book dependencies in the future if needed by implementing that in a fairly general way. - Update the submodule for the book to pull in the new chapter on async and await, as well as a number of other fixes. This will happen organically/automatically in a week, too, but this lets me group this change with the next one: - Update the compiler messages which reference the existing chapters 17–20, which are now chapters 18-21. There are only two, both previously referencing chapter 18. - Update the UI tests which reference the compiler message outputs.
2024-11-23Auto merge of #133379 - jieyouxu:rollup-00jxo71, r=jieyouxubors-69/+894
Rollup of 4 pull requests Successful merges: - #133217 ([AIX] Add option -X32_64 to the "strip" command) - #133237 (Minimally constify `Add`) - #133355 (Add language tests for aggregate types) - #133374 (show abi_unsupported_vector_types lint in future breakage reports) r? `@ghost` `@rustbot` modify labels: rollup
2024-11-23Auto merge of #133242 - lcnr:questionable-uwu, r=compiler-errors,BoxyUwUbors-12/+12
finish `Reveal` removal After #133212 changed the `TypingMode` to be the only source of truth, this entirely rips out `Reveal`. cc #132279 r? `@compiler-errors`
2024-11-23Stabilize `const_float_methods`Eduardo Sánchez Muñoz-1/+0
2024-11-23Update tests for new TRPL chapter orderChris Krycho-137/+137
2024-11-23remove remaining references to `Reveal`lcnr-12/+12
2024-11-23Rollup merge of #133374 - RalfJung:abi_unsupported_vector_types, r=jieyouxu许杰友 Jieyou Xu (Joe)-0/+623
show abi_unsupported_vector_types lint in future breakage reports The lint is now riding the train to 1.84. Given that crater found no case of this lint triggering at all, IMO it's fine to make it "report in deps" already for 1.85. Part of https://github.com/rust-lang/rust/issues/116558.
2024-11-23Rollup merge of #133355 - chorman0773:spec-layout-tests, r=jieyouxu许杰友 Jieyou Xu (Joe)-0/+265
Add language tests for aggregate types This adds some tests for struct and union types, ensuring that they satisfy the rules for all structs and unions - namely that fields of structs do not overlap, fields are well-aligned, and the size of the entire. The reference annotations used are from https://github.com/rust-lang/reference/pull/1654, though the rules tested here were FCPed in <https://github.com/rust-lang/reference/pull/1152>.
2024-11-23Rollup merge of #133237 - fee1-dead-contrib:constadd, r=compiler-errors许杰友 Jieyou Xu (Joe)-69/+6
Minimally constify `Add` * This PR removes the requirement for `impl const` to have a const stability attribute. cc ``@RalfJung`` I believe you mentioned that it would make much more sense to require `const_trait`s to have const stability instead. I agree with that sentiment but I don't think that is _required_ for a small scale experimentation like this PR. https://github.com/rust-lang/project-const-traits/issues/16 should definitely be prioritized in the future, but removing the impl check should be good for now as all callers need `const_trait_impl` enabled for any const impl to work. * This PR is intentionally minimal as constifying other traits can become more complicated (`PartialEq`, for example, would run into requiring implementing it for `str` as that is used in matches, which runs into the implementation for slice equality which uses specialization) Per the reasons above, anyone who is interested in making traits `const` in the standard library are **strongly encouraged** to reach out to us on the [Zulip channel](https://rust-lang.zulipchat.com/#narrow/channel/419616-t-compiler.2Fproject-const-traits) before proceeding with the work. cc ``@rust-lang/project-const-traits`` I believe there is prior approval from libs that we can experiment, so r? project-const-traits
2024-11-23Rollup merge of #133286 - jieyouxu:bug-ourselves, r=compiler-errors许杰友 Jieyou Xu (Joe)-0/+36
Re-delay a resolve `bug` related to `Self`-ctor in patterns For the code pattern reported in <https://github.com/rust-lang/rust/issues/133272>, ```rs impl Foo { fn fun() { let S { ref Self } = todo!(); } } ``` <https://github.com/rust-lang/rust/pull/121208> converted this to a `span_bug` from a `span_delayed_bug` because this specific self-ctor code pattern lacked test coverage. It turns out this can be hit but we just lacked test coverage, so change it back to a `span_delayed_bug` and add a targeted test case. Follow-up to #121208, cc ``@nnethercote`` (very good exercise to expose our test coverage gaps). Fixes #133272.
2024-11-23Rollup merge of #132949 - clubby789:macro-rules-attr-derive, r=fmease许杰友 Jieyou Xu (Joe)-2/+53
Add specific diagnostic for using macro_rules macro as attribute/derive Fixes #132928
2024-11-23Rollup merge of #127483 - BertalanD:no_sanitize-global-var, r=rcvalle许杰友 Jieyou Xu (Joe)-31/+55
Allow disabling ASan instrumentation for globals AddressSanitizer adds instrumentation to global variables unless the [`no_sanitize_address`](https://llvm.org/docs/LangRef.html#global-attributes) attribute is set on them. This commit extends the existing `#[no_sanitize(address)]` attribute to set this; previously it only had the desired effect on functions. (cc https://github.com/rust-lang/rust/issues/39699)
2024-11-23show abi_unsupported_vector_types lint in future breakage reportsRalf Jung-0/+623
2024-11-23Auto merge of #132915 - veluca93:unsafe-fields, r=jswrennbors-18/+415
Implement the unsafe-fields RFC. RFC: rust-lang/rfcs#3458 Tracking: - https://github.com/rust-lang/rust/issues/132922 r? jswrenn
2024-11-23only store valid proc marco item for doc linkbohan-0/+28
2024-11-23Auto merge of #133360 - compiler-errors:rollup-a2o38tq, r=compiler-errorsbors-217/+543
Rollup of 8 pull requests Successful merges: - #132090 (Stop being so bail-y in candidate assembly) - #132658 (Detect const in pattern with typo) - #132911 (Pretty print async fn sugar in opaques and trait bounds) - #133102 (aarch64 softfloat target: always pass floats in int registers) - #133159 (Don't allow `-Zunstable-options` to take a value ) - #133208 (generate-copyright: Now generates a library file too.) - #133215 (Fix missing submodule in `./x vendor`) - #133264 (implement OsString::truncate) r? `@ghost` `@rustbot` modify labels: rollup
2024-11-22Rollup merge of #133159 - Zalathar:unstable-options-no-value, r=jieyouxuMichael Goulet-7/+7
Don't allow `-Zunstable-options` to take a value Passing an explicit boolean value (`-Zunstable-options=on`, `off` etc.) sometimes appears to work, but actually puts the compiler into an unintended state where unstable _options_ are still forbidden, but unstable values of _some_ stable options are allowed. This is a result of `-Zunstable-options` being checked in multiple different places, in slightly different ways. Fixing the checks in `config::nightly_options` to understand boolean values would be non-trivial, so for now it's easier to make things consistent by forbidding values in the `-Z` parser. --- There were a few uses of this in tests, which happened to work because they were tests of unstable values.
2024-11-22Rollup merge of #133102 - RalfJung:aarch64-softfloat, r=davidtwco,wesleywiserMichael Goulet-0/+48
aarch64 softfloat target: always pass floats in int registers This is a part of https://github.com/rust-lang/rust/issues/131058: on softfloat aarch64 targets, the float registers may be unavailable. And yet, LLVM will happily use them to pass float types if the corresponding target features are enabled. That's a problem as it means enabling/disabling `neon` instructions can change the ABI. Other targets have a `soft-float` target feature that forces the use of the soft-float ABI no matter whether float registers are enabled or not; aarch64 has nothing like that. So we follow the aarch64 [softfloat ABI](https://github.com/rust-lang/rust/issues/131058#issuecomment-2385027423) and treat floats like integers for `extern "C"` functions. For the "Rust" ABI, we do the same for scalars, and then just do something reasonable for ScalarPair that avoids the pointer indirection. Cc ```@workingjubilee```
2024-11-22Rollup merge of #132911 - compiler-errors:async-fn-sugar, r=fmeaseMichael Goulet-7/+38
Pretty print async fn sugar in opaques and trait bounds sudo r? fmease
2024-11-22Rollup merge of #132658 - estebank:const-in-pattern-typo, r=NadrierilMichael Goulet-0/+123
Detect const in pattern with typo When writing a constant name incorrectly in a pattern, the pattern will be identified as a new binding. We look for consts in the current crate, consts that where imported in the current crate and for local `let` bindings in case someone got them confused with `const`s. ``` error: unreachable pattern --> $DIR/const-with-typo-in-pattern-binding.rs:30:9 | LL | GOOOD => {} | ----- matches any value LL | LL | _ => {} | ^ no value can reach this | help: you might have meant to pattern match against the value of similarly named constant `GOOD` instead of introducing a new catch-all binding | LL | GOOD => {} | ~~~~ ``` Fix #132582.
2024-11-22Rollup merge of #132090 - compiler-errors:baily, r=lcnrMichael Goulet-203/+327
Stop being so bail-y in candidate assembly A conceptual follow-up to #132084. We gotta stop bailing so much when there are errors; it's both unnecessary, leads to weird knock-on errors, and it's messing up the vibes lol
2024-11-22Remove `#[cfg(test)]` related stubsConnor Horman-57/+10
2024-11-23Auto merge of #132329 - compiler-errors:fn-and-destruct, r=lcnrbors-74/+237
Implement `~const Destruct` effect goal in the new solver This also fixed a subtle bug/limitation of the `NeedsConstDrop` check. Specifically, the "`Qualif`" API basically treats const drops as totally structural, even though dropping something that has an explicit `Drop` implementation cannot be structurally decomposed. For example: ```rust #![feature(const_trait_impl)] #[const_trait] trait Foo { fn foo(); } struct Conditional<T: Foo>(T); impl Foo for () { fn foo() { println!("uh oh"); } } impl<T> const Drop for Conditional<T> where T: ~const Foo { fn drop(&mut self) { T::foo(); } } const FOO: () = { let _ = Conditional(()); //~^ This should error. }; fn main() {} ``` In this example, when checking if the `Conditional(())` rvalue is const-drop, since `Conditional` has a const destructor, we would previously recurse into the `()` value and determine it has nothing to drop, which means that it is considered to *not* need a const drop -- even though dropping `Conditional(())` would mean evaluating the destructor which relies on that `T: const Foo` bound to hold! This could be fixed alternatively by banning any const conditions on `const Drop` impls, but that really sucks -- that means that basically no *interesting* const drop impls could be written. We have the capability to totally and intuitively support the right behavior, which I've implemented here.
2024-11-22Add language tests for aggregate typesConnor Horman-0/+312
2024-11-22Auto merge of #133349 - ehuss:stabilize-2024, r=traviscross,compiler-errorsbors-330/+304
Stabilize the 2024 edition This stabilizes the 2024 edition for Rust 1.85, scheduled to be released on February 20, 2025. 🎉 cc tracking issue: https://github.com/rust-lang/rust/issues/117258 There is a fair amount of follow-up work after this that I am working on (various docs, cargo, rustfmt, etc.), and this is will unblock those other changes.
2024-11-22Stabilize the 2024 editionEric Huss-330/+304
2024-11-22Check drop is trivial before checking ty needs dropMichael Goulet-177/+46
2024-11-22Pretty print AsyncFn traits tooMichael Goulet-6/+37
2024-11-22Deduplicate checking drop terminatorMichael Goulet-14/+15
2024-11-22Gate const drop behind const_destruct feature, and fix ↵Michael Goulet-26/+243
const_precise_live_drops post-drop-elaboration check
2024-11-22Implement ~const Destruct in new solverMichael Goulet-23/+99
2024-11-22Diagnostic for using macro_rules macro as attr/deriveclubby789-28/+18