about summary refs log tree commit diff
path: root/tests/ui/structs-enums
AgeCommit message (Collapse)AuthorLines
2025-06-26Better recoveryMichael Goulet-6/+13
2025-06-26Make recovery for enum with struct field a bit more accurateMichael Goulet-0/+16
2025-06-12intrinsics: rename min_align_of to align_ofRalf Jung-8/+8
2025-06-05Use non-2015 edition paths in tests that do not test for their resolutionLukas Wirth-2/+2
2025-02-14Rollup merge of #135778 - ferrocene:ja-gh135777, r=workingjubileeMatthias Krüger-1/+11
account for `c_enum_min_bits` in `multiple-reprs` UI test fixes #135777
2025-02-10Show diff suggestion format on verbose replacementEsteban Küber-4/+6
``` error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> $DIR/attempted-access-non-fatal.rs:7:15 | LL | let _ = 2.l; | ^ | help: if intended to be a floating point literal, consider adding a `0` after the period and a `f64` suffix | LL - let _ = 2.l; LL + let _ = 2.0f64; | ```
2025-02-06Remove some unnecessary parens in `assert!` conditionsEsteban Küber-9/+9
While working on #122661, some of these started triggering our "unnecessary parens" lints due to a change in the `assert!` desugaring. A cursory search identified a few more. Some of these have been carried from before 1.0, were a bulk rename from the previous name of `assert!` left them in that state. I went and removed as many of these unnecessary parens as possible in order to have fewer annoyances in the future if we make the lint smarter.
2025-01-23tests: use `needs-threads` instead of `ignore-emscripten`许杰友 Jieyou Xu (Joe)-1/+1
2025-01-20account for `c_enum_min_bits` in `multiple-reprs` UI testJorge Aparicio-1/+11
fixes #135777
2024-12-16add alignment info for testHenry Jiang-0/+1
2024-11-30add tests for niches in pointersThe 8472-0/+7
2024-11-26tests: remove `//@ pretty-expanded` usages许杰友 Jieyou Xu (Joe)-31/+0
Done with ```bash sd '//@ pretty-expanded.*\n' '' tests/ui/**/*.rs ``` and ``` sd '//@pretty-expanded.*\n' '' tests/ui/**/*.rs ```
2024-11-15make UI test OS-agnosticJorge Aparicio-11/+9
the internal representation of `std::sync::Mutex` depends on the compilation target. due to this, the compiler produces different number of errors for UI test `issue-17431-6.rs` depending on the compilation target. for example, when compiling the UI test to an `*-apple-*` or `*-qnx7*` target, the "cycle detected" error is not reported ``` console $ cat src/lib.rs use std::sync::Mutex; enum Foo { X(Mutex<Option<Foo>>), } impl Foo { fn bar(self) {} } fn main() {} $ cargo check --target x86_64-apple-ios 2>&1 | rg '^error\[' error[E0072]: recursive type `Foo` has infinite size ``` whereas rustc produces two errors for other OSes, like Linux, which is what the UI test expects ``` console $ cargo check --target x86_64-unknown-linux-gnu 2>&1 | rg '^error\[' error[E0072]: recursive type `Foo` has infinite size error[E0391]: cycle detected when computing when `Foo` needs drop ``` this commit replaces the problematic `Mutex` with `UnsafeCell`, which has the same internal representation regardless of the compilation target. with that change, rustc reports two errors for all compilation targets. ``` console $ cat src/lib.rs use std::cell::UnsafeCell; enum Foo { X(UnsafeCell<Option<Foo>>), } impl Foo { fn bar(self) {} } fn main() {} $ cargo check --target x86_64-apple-ios 2>&1 | rg '^error\[' error[E0072]: recursive type `Foo` has infinite size error[E0391]: cycle detected when computing when `Foo` needs drop ``` with this change, we can remove the `ignore-apple` directive as the UI test now also passes on apple targets.
2024-11-08remove support for rustc_safe_intrinsic attribute; use rustc_intrinsic ↵Ralf Jung-22/+8
functions instead
2024-10-21move strict provenance lints to new feature gate, remove old feature gatesRalf Jung-1/+0
2024-10-15Fix most ui tests on emscripten targetHood Chatham-1/+0
To fix the linker errors, we need to set the output extension to `.js` instead of `.wasm`. Setting the output to a `.wasm` file puts Emscripten into standalone mode which is effectively a distinct target. We need to set the runner to be `node` as well. This fixes most of the ui tests. I fixed a few more tests with simple problems: - `intrinsics/intrinsic-alignment.rs` and `structs-enums/rec-align-u64.rs` -- Two `#[cfg]` macros match for Emscripten so we got a duplicate definition of `mod m`. - `issues/issue-12699.rs` -- Seems to hang so I disabled it - `process/process-sigpipe.rs` -- Not expected to work on Emscripten so I disabled it
2024-09-18Get rid of niche selection's dependence on fields's orderAdwin White-0/+20
2024-08-31ignore/fix layout-sensitive testsThe 8472-0/+1
2024-08-03Revert "Rollup merge of #125572 - mu001999-contrib:dead/enhance, r=pnkfelix"Michael Goulet-4/+1
This reverts commit 13314df21b0bb0cdd02c6760581d1b9f1052fa7e, reversing changes made to 6e534c73c35f569492ed5fb5f349075d58ed8b7e.
2024-06-05Detect pub structs never constructed and unused associated constants in traitsr0cky-1/+4
2024-05-28Make more of the test suite run on Mac CatalystMads Marquart-16/+16
This adds the `only-apple`/`ignore-apple` compiletest directive, and uses that basically everywhere instead of `only-macos`/`ignore-macos`. Some of the updates in `run-make` are a bit redundant, as they use `ignore-cross-compile` and won't run on iOS - but using Apple in these is still more correct, so I've made that change anyhow.
2024-04-27tests: remove some trailing wsklensy-3/+3
2024-04-22Stabilize generic `NonZero`.Markus Reiter-3/+1
2024-03-29stabilize ptr.is_aligned, move ptr.is_aligned_to to a new feature gateAria Beingessner-1/+1
This is an alternative to #121920
2024-03-11Update test directives for `wasm32-wasip1`Alex Crichton-1/+8
* The WASI targets deal with the `main` symbol a bit differently than native so some `codegen` and `assembly` tests have been ignored. * All `ignore-emscripten` directives have been updated to `ignore-wasm32` to be more clear that all wasm targets are ignored and it's not just Emscripten. * Most `ignore-wasm32-bare` directives are now gone. * Some ignore directives for wasm were switched to `needs-unwind` instead. * Many `ignore-wasm32*` directives are removed as the tests work with WASI as opposed to `wasm32-unknown-unknown`.
2024-03-06compiletest: Add a `//@ needs-threads` directiveAlex Crichton-1/+1
This commit is extracted from #122036 and adds a new directive to the `compiletest` test runner, `//@ needs-threads`. This is intended to capture the need that a target must implement threading to execute a specific test, typically one that uses `std::thread`. This is primarily done for WebAssembly targets which currently do not have threads by default. This enables transitioning a lot of `//@ ignore-wasm*`-style ignores into a more self-documenting `//@ needs-threads` directive. Additionally the `wasm32-wasi-preview1-threads` target, for example, does actually have threads, but isn't tested in CI at this time. This change enables running these tests for that target, but not other wasm targets.
2024-02-25Use generic `NonZero` in tests.Markus Reiter-15/+17
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-187/+187
2024-02-08Continue to borrowck even if there were previous errorsOli Scherer-3/+17
2024-02-07Update testsr0cky-1/+13
2024-01-02Adjust compiler tests for unused_tuple_struct_fields -> dead_codeJake Goulding-7/+7
2023-12-15Stabilize `ptr::{from_ref, from_mut}`Maybe Waffle-1/+0
2023-12-10remove redundant importssurechen-4/+0
detects redundant imports that can be eliminated. for #117772 : In order to facilitate review and modification, split the checking code and removing redundant imports code into two PR.
2023-11-24Show number in error message even for one errorNilstrieb-15/+15
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-09-25Gate and validate #[rustc_safe_intrinsic]León Orell Valerian Liehr-2/+2
2023-09-21added support for GNU/HurdSamuel Thibault-0/+1
2023-08-24Move issue 29181, 2804, 17431, 66768Olanti-0/+159
2023-05-29Address commentCaio-0/+73
2023-05-08suggest struct when we get colon in fileds in enumyukang-0/+43
2023-04-28layout-alignment-promotion logic should depend on the niche-biasThe 8472-0/+19
For start-biased layout we want to avoid overpromoting so that the niche doesn't get pushed back. For end-biased layout we want to avoid promoting fields that may contain one of the niches of interest.
2023-04-27don't promote large fields to higher alignments if that would affect niche ↵The 8472-0/+18
placement
2023-04-27try two different niche-placement strategies when layouting univariant structsThe 8472-1/+29
2023-03-03Add unuseless `#[allow(unused_allocation)]`Maybe Waffle-15/+11
2023-02-28Add QNX Neutrino support to libstdFlorian Bartels-1/+3
Co-authored-by: gh-tr <troach@qnx.com>
2023-02-02Recover _ as .. in field patternMichael Goulet-19/+7
2023-01-11Move /src/test to /testsAlbert Larsan-0/+5393