about summary refs log tree commit diff
path: root/compiler/rustc_passes/src/abi_test.rs
AgeCommit message (Collapse)AuthorLines
2025-07-13Generalize TyCtxt::item_name.Camille GILLOT-2/+2
2025-04-17Replace infallible `name_or_empty` methods with fallible `name` methods.Nicholas Nethercote-10/+10
I'm removing empty identifiers everywhere, because in practice they always mean "no identifier" rather than "empty identifier". (An empty identifier is impossible.) It's better to use `Option` to mean "no identifier" because you then can't forget about the "no identifier" possibility. Some specifics: - When testing an attribute for a single name, the commit uses the `has_name` method. - When testing an attribute for multiple names, the commit uses the new `has_any_name` method. - When using `match` on an attribute, the match arms now have `Some` on them. In the tests, we now avoid printing empty identifiers by not printing the identifier in the `error:` line at all, instead letting the carets point out the problem.
2025-02-10compiler: die immediately instead of handling unknown target codegenJubilee Young-9/+0
We cannot produce anything useful if asked to compile unknown targets. We should handle the error immediately at the point of discovery instead of propagating it upward, and preferably in the simplest way: Die. This allows cleaning up our "error-handling" spread across 5 crates.
2025-02-07compiler: remove rustc_target::abi entirelyJubilee Young-1/+1
2024-12-18Re-export more `rustc_span::symbol` things from `rustc_span`.Nicholas Nethercote-1/+1
`rustc_span::symbol` defines some things that are re-exported from `rustc_span`, such as `Symbol` and `sym`. But it doesn't re-export some closely related things such as `Ident` and `kw`. So you can do `use rustc_span::{Symbol, sym}` but you have to do `use rustc_span::symbol::{Ident, kw}`, which is inconsistent for no good reason. This commit re-exports `Ident`, `kw`, and `MacroRulesNormalizedIdent`, and changes many `rustc_span::symbol::` qualifiers in `compiler/` to `rustc_span::`. This is a 200+ net line of code reduction, mostly because many files with two `use rustc_span` items can be reduced to one.
2024-12-15Add hir::AttributeJonathan Dönszelmann-1/+1
2024-11-18use `TypingEnv` when no `infcx` is availablelcnr-17/+19
the behavior of the type system not only depends on the current assumptions, but also the currentnphase of the compiler. This is mostly necessary as we need to decide whether and how to reveal opaque types. We track this via the `TypingMode`.
2024-10-23nightly feature tracking: get rid of the per-feature bool fieldsRalf Jung-1/+1
2024-08-09Shrink `TyKind::FnPtr`.Nicholas Nethercote-6/+11
By splitting the `FnSig` within `TyKind::FnPtr` into `FnSigTys` and `FnHeader`, which can be packed more efficiently. This reduces the size of the hot `TyKind` type from 32 bytes to 24 bytes on 64-bit platforms. This reduces peak memory usage by a few percent on some benchmarks. It also reduces cache misses and page faults similarly, though this doesn't translate to clear cycles or wall-time improvements on CI.
2024-07-02Instance::resolve -> Instance::try_resolve, and other nitsMichael Goulet-1/+1
2024-04-29Remove `extern crate rustc_middle` from numerous crates.Nicholas Nethercote-0/+1
2023-12-24Remove `Session` methods that duplicate `DiagCtxt` methods.Nicholas Nethercote-8/+8
Also add some `dcx` methods to types that wrap `TyCtxt`, for easier access.
2023-09-26Don't store lazyness in DefKindMichael Goulet-1/+1
2023-09-11Disentangle `Debug` and `Display` for `Ty`.Nicholas Nethercote-0/+1
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-09better spans for WF errorsRalf Jung-1/+1
2023-09-09use hir_crate_items(()).definitions() instead of hir().items()Ralf Jung-29/+14
2023-09-09rustc_layout, rustc_abi: make sure the types are well-formedRalf Jung-6/+7
2023-09-08turns out Layout has some more things to worry about -- move ABI comparison ↵Ralf Jung-17/+3
into helper function like is_bool, and some special magic extra fields
2023-09-08also ensure that size and alignment are the sameRalf Jung-3/+7
2023-09-08accept some differences for rustc_abi(assert_eq), so that we can test more ↵Ralf Jung-3/+1
things to be compatible
2023-09-07add support for rustc_abi(assert_eq) and use it to test some ↵Ralf Jung-2/+76
repr(transparent) cases
2023-09-06rustc_layout/abi: error when attribute is applied to the wrong thingRalf Jung-13/+18
2023-09-06rustc_abi: also support debugging function pointersRalf Jung-37/+87
2023-08-27add rustc_abi debugging attributeRalf Jung-0/+93