summary refs log tree commit diff
path: root/tests/ui/layout
AgeCommit message (Collapse)AuthorLines
2024-10-08Dont ICE when encountering post-mono layout cycle errorMichael Goulet-0/+123
2024-09-20TL note: current means targetJubilee Young-4/+4
2024-09-17get rid of an old hackLukas Markeffsky-0/+65
For structs that cannot be unsized, the layout algorithm sometimes moves unsized fields to the end of the struct, which circumvented the error for unexpected unsized fields and returned an unsized layout anyway. This commit makes it so that the unexpected unsized error is always returned for structs that cannot be unsized, allowing us to remove an old hack and fixing some old ICE.
2024-09-16layout computation: eagerly error for unexpected unsized fieldsLukas Markeffsky-1/+141
2024-09-09Ban non-array SIMDScott McMurray-1/+1
2024-07-24Rollup merge of #126152 - RalfJung:size_of_val_raw, r=saethlinMatthias Krüger-0/+22
size_of_val_raw: for length 0 this is safe to call For motivation, see https://github.com/rust-lang/unsafe-code-guidelines/issues/465, specifically around [here](https://github.com/rust-lang/unsafe-code-guidelines/issues/465#issuecomment-2136401114). Cc `@rust-lang/opsem`
2024-07-11Always use a colon in `//@ normalize-*:` headersZalathar-11/+11
2024-07-10size_of_val_raw: for length 0 this is safe to callRalf Jung-0/+22
2024-06-25Auto merge of #125740 - RalfJung:transmute-size-check, r=oli-obkbors-1/+1
transmute size check: properly account for alignment Fixes another place where ZST alignment was ignored when checking whether something is a newtype. I wonder how many more of these there are... Fixes https://github.com/rust-lang/rust/issues/101084
2024-05-30transmute size check: properly account for alignmentRalf Jung-1/+1
2024-05-28Allow type_of to return partially non-error types if the type was already ↵Oli Scherer-4/+35
tainted
2024-04-23Rollup merge of #124057 - gurry:124031-ice-layout-errored, r=compiler-errorsMatthias Krüger-0/+32
Fix ICE when ADT tail has type error Fixes #124031
2024-04-22Stabilize generic `NonZero`.Markus Reiter-6/+4
2024-04-22Fix ICE when ADT tail has type errorGurinder Singh-0/+32
2024-04-06add test for ICE: Unexpected unsized type tail: &ReStatic [u8] #122488Matthias Krüger-0/+37
Fixes https://github.com/rust-lang/rust/issues/122488
2024-04-06add test for ICE: !base.layout().is_sized() #123078Matthias Krüger-0/+48
Fixes https://github.com/rust-lang/rust/issues/123078
2024-04-04Error out of layout calculation if a non-last struct field is unsizedGurinder Singh-0/+185
Fixes an ICE that occurs when a struct with an unsized field at a non-last position is const evaluated.
2024-03-25add test for ICE: failed to get layout for [type error] #92979Matthias Krüger-0/+94
Fixes https://github.com/rust-lang/rust/issues/92979
2024-03-25add test for Compiler panic using fn_traits #81974Matthias Krüger-0/+137
Fixes https://github.com/rust-lang/rust/issues/81974
2024-03-13Auto merge of #121668 - erikdesjardins:commonprim, r=scottmcm,oli-obkbors-1/+51
Represent `Result<usize, Box<T>>` as ScalarPair(i64, ptr) This allows types like `Result<usize, std::io::Error>` (and integers of differing sign, e.g. `Result<u64, i64>`) to be passed in a pair of registers instead of through memory, like `Result<u64, u64>` or `Result<Box<T>, Box<U>>` are today. Fixes #97540. r? `@ghost`
2024-03-06Check that return type is WF in typeckGurinder Singh-1/+12
Without it non-WF types could pass typeck and then later fail in MIR/const eval
2024-02-28fix test failure due to differing u64 alignment on different targetsErik Desjardins-3/+3
2024-02-27allow using scalarpair with a common prim of ptr/ptr-sized-intErik Desjardins-1/+51
2024-02-25Use generic `NonZero` in tests.Markus Reiter-20/+23
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-29/+29
2024-02-14Continue compilation after check_mod_type_wf errorsOli Scherer-4/+13
2024-01-27Update tests.Markus Reiter-1/+1
2024-01-19Remove feature(offset_of) from testsGeorge Bateman-1/+0
2024-01-18Remove no-longer-needed `allow(dead_code)` from the testsJake Goulding-1/+1
`repr(transparent)` now silences the lint.
2024-01-11Silence follow up errors if astconv already erroredOli Scherer-23/+3
2024-01-05Auto merge of #118297 - shepmaster:warn-dead-tuple-fields, r=WaffleLapkinbors-2/+2
Merge `unused_tuple_struct_fields` into `dead_code` This implicitly upgrades the lint from `allow` to `warn` and places it into the `unused` lint group. [Discussion on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Moving.20.60unused_tuple_struct_fields.60.20from.20allow.20to.20warn)
2024-01-02Adjust compiler tests for unused_tuple_struct_fields -> dead_codeJake Goulding-2/+2
2024-01-02Reorder `check_item_type` diagnostics so they occur next to the ↵Oli Scherer-9/+9
corresponding `check_well_formed` diagnostics
2023-11-24Show number in error message even for one errorNilstrieb-4/+4
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-10-27fix failure to detect a too-big-type after adding paddingRalf Jung-0/+26
2023-10-25Work around the fact that `check_mod_type_wf` may spuriously return ↵Oli Scherer-3/+23
`ErrorGuaranteed`, even if that error is only emitted by `check_modwitem_types`
2023-10-20Avoid a `track_errors` by bubbling up most errors from `check_well_formed`Oli Scherer-13/+4
2023-09-11Rollup merge of #115708 - RalfJung:homogeneous, r=davidtwcoMatthias Krüger-0/+76
fix homogeneous_aggregate not ignoring some ZST This is an ABI-breaking change, because it fixes bugs in our ABI code. I'm not sure what that means for this PR, we don't really have a process for such changes, do we? I can only hope nobody relied on the old buggy behavior. Fixes https://github.com/rust-lang/rust/issues/115664
2023-09-11Disentangle `Debug` and `Display` for `Ty`.Nicholas Nethercote-5/+5
The `Debug` impl for `Ty` just calls the `Display` impl for `Ty`. This is surprising and annoying. In particular, it means `Debug` doesn't show as much information as `Debug` for `TyKind` does. And `Debug` is used in some user-facing error messages, which seems bad. This commit changes the `Debug` impl for `Ty` to call the `Debug` impl for `TyKind`. It also does a number of follow-up changes to preserve existing output, many of which involve inserting `with_no_trimmed_paths!` calls. It also adds `Display` impls for `UserType` and `Canonical`. Some tests have changes to expected output: - Those that use the `rustc_abi(debug)` attribute. - Those that use the `EMIT_MIR` annotation. In each case the output is slightly uglier than before. This isn't ideal, but it's pretty weird (particularly for the attribute) that the output is using `Debug` in the first place. They're fairly obscure attributes (I hadn't heard of them) so I'm not worried by this. For `async-is-unwindsafe.stderr`, there is one line that now lacks a full path. This is a consistency improvement, because all the other mentions of `Context` in this test lack a path.
2023-09-10fix homogeneous_aggregate not ignoring some 1-ZSTRalf Jung-0/+76
2023-09-09better spans for WF errorsRalf Jung-2/+2
2023-09-09use hir_crate_items(()).definitions() instead of hir().items()Ralf Jung-6/+6
2023-09-09rustc_layout, rustc_abi: make sure the types are well-formedRalf Jung-1/+14
2023-09-06rustc_layout/abi: error when attribute is applied to the wrong thingRalf Jung-12/+31
2023-08-29Rollup merge of #111580 - atsuzaki:layout-ice, r=oli-obkMatthias Krüger-0/+42
Don't ICE on layout computation failure Fixes #111176 regression. r? `@oli-obk`
2023-08-29there seems to be no reason to treat ZST specially in these casesRalf Jung-2/+2
2023-08-29rustc_abi: audit uses of is_zst; fix a case of giving an enum insufficient ↵Ralf Jung-0/+58
alignment
2023-08-28Don't ICE on layout computation failureKatherine Philip-0/+42
2023-08-27add rustc_abi debugging attributeRalf Jung-19/+19
2023-07-29Change default panic handler message format.Mara Bos-0/+1