about summary refs log tree commit diff
path: root/compiler/rustc_middle/messages.ftl
AgeCommit message (Collapse)AuthorLines
2025-09-23Add an attribute to check the number of lanes in a SIMD vector after ↵Caleb Zulawski-0/+6
monomorphization Unify zero-length and oversized SIMD errors
2025-09-14Fix typo in error messageJules Bertholet-1/+1
2025-08-06Add support for shortening `Instance` and use itEsteban Küber-3/+1
Replace ad-hoc type path shortening logic for recursive mono instantiation errors to use `tcx.short_string()` instead.
2025-06-28Auto merge of #141759 - 1c3t3a:discriminants-query, r=saethlinbors-0/+3
Insert checks for enum discriminants when debug assertions are enabled Similar to the existing null-pointer and alignment checks, this checks for valid enum discriminants on creation of enums through unsafe transmutes. Essentially this sanitizes patterns like the following: ```rust let val: MyEnum = unsafe { std::mem::transmute<u32, MyEnum>(42) }; ``` An extension of this check will be done in a follow-up that explicitly sanitizes for extern enum values that come into Rust from e.g. C/C++. This check is similar to Miri's capabilities of checking for valid construction of enum values. This PR is inspired by saethlin@'s PR https://github.com/rust-lang/rust/pull/104862. Thank you so much for keeping this code up and the detailed comments! I also pair-programmed large parts of this together with vabr-g@. r? `@saethlin`
2025-06-27Insert checks for enum discriminants when debug assertions are enabledBastian Kersting-0/+3
Similar to the existing nullpointer and alignment checks, this checks for valid enum discriminants on creation of enums through unsafe transmutes. Essentially this sanitizes patterns like the following: ```rust let val: MyEnum = unsafe { std::mem::transmute<u32, MyEnum>(42) }; ``` An extension of this check will be done in a follow-up that explicitly sanitizes for extern enum values that come into Rust from e.g. C/C++. This check is similar to Miri's capabilities of checking for valid construction of enum values. This PR is inspired by saethlin@'s PR https://github.com/rust-lang/rust/pull/104862. Thank you so much for keeping this code up and the detailed comments! I also pair-programmed large parts of this together with vabr-g@.
2025-06-26const-eval: allow constants to refer to mutable/external memory, but reject ↵Ralf Jung-0/+7
such constants as patterns
2025-04-28AsyncDrop implementation using shim codegen of ↵Andrew Zhogin-0/+6
async_drop_in_place::{closure}, scoped async drop added.
2025-02-18clean up layout error diagnosticsLukas Markeffsky-14/+14
- group the fluent slugs together - reword (internal-only) "too generic" error to be more in line with the other errors
2025-02-17Move `rustc_middle::limits` to `rustc_interface`.Nicholas Nethercote-4/+0
It's always good to make `rustc_middle` smaller. `rustc_interface` is the best destination, because it's the only crate that calls `get_recursive_limit`.
2025-02-11compiler: Make middle errors `pub(crate)` and bury some dead codeJubilee Young-3/+0
2025-01-31Auto merge of #134424 - 1c3t3a:null-checks, r=saethlinbors-0/+3
Insert null checks for pointer dereferences when debug assertions are enabled Similar to how the alignment is already checked, this adds a check for null pointer dereferences in debug mode. It is implemented similarly to the alignment check as a `MirPass`. This inserts checks in the same places as the `CheckAlignment` pass and additionally also inserts checks for `Borrows`, so code like ```rust let ptr: *const u32 = std::ptr::null(); let val: &u32 = unsafe { &*ptr }; ``` will have a check inserted on dereference. This is done because null references are UB. The alignment check doesn't cover these places, because in `&(*ptr).field`, the exact requirement is that the final reference must be aligned. This is something to consider further enhancements of the alignment check. For now this is implemented as a separate `MirPass`, to make it easy to disable this check if necessary. This is related to a 2025H1 project goal for better UB checks in debug mode: https://github.com/rust-lang/rust-project-goals/pull/177. r? `@saethlin`
2025-01-31Insert null checks for pointer dereferences when debug assertions are enabledBastian Kersting-0/+3
Similar to how the alignment is already checked, this adds a check for null pointer dereferences in debug mode. It is implemented similarly to the alignment check as a MirPass. This is related to a 2025H1 project goal for better UB checks in debug mode: https://github.com/rust-lang/rust-project-goals/pull/177.
2025-01-29upstream rustc_codegen_ssa/rustc_middle changes for enzyme/autodiffManuel Drehwald-0/+4
2025-01-27Add `TooGeneric` variant to `LayoutError` and emit `Unknown` oneFedericoBruzzone-0/+3
- `check-pass` test for a MRE of #135020 - fail test for #135138 - switch to `TooGeneric` for checking CMSE fn signatures - switch to `TooGeneric` for compute `SizeSkeleton` (for transmute) - fix broken tests
2024-11-09Move some code from Compiler::enter to GlobalCtxt::finishbjorn3-0/+3
2024-11-05Tweak E0320 overflow error wordingEsteban Küber-2/+2
Surrount type with backticks as we should in every error.
2024-09-20TL note: current means targetJubilee Young-1/+1
2024-07-02Re-implement a type-size based limitMichael Goulet-0/+6
2024-05-21Port DeprecatedMacro to diag structsXiretza-0/+14
2023-10-30Add a custom panic message for resuming `gen` blocks after they panickedOli Scherer-0/+2
2023-10-20s/generator/coroutine/Oli Scherer-4/+4
2023-09-14don't point at const usage site for resolution-time errorsRalf Jung-0/+2
also share the code that emits the actual error
2023-07-27Don't attempt to compute layout of type referencing errorMichael Goulet-0/+3
2023-06-01Use translatable diagnostics in `rustc_const_eval`Deadbeef-0/+35
2023-05-25Ensure Fluent messages are in alphabetical orderclubby789-24/+24
2023-05-16Remove `LangItems::require`Nilstrieb-0/+2
It's just a short wrapper used by `tcx.require_lang_item`. Deleting it gives us a negative diff.
2023-05-02Avoid ICEing miri on layout query cyclesOli Scherer-0/+3
2023-04-03fix(middle): emit error rather than delay bug when reaching limitbohan-0/+4
2023-03-11Simplify message pathsest31-0/+36
This makes it easier to open the messages file while developing on features. The commit was the result of automatted changes: for p in compiler/rustc_*; do mv $p/locales/en-US.ftl $p/messages.ftl; rmdir $p/locales; done for p in compiler/rustc_*; do sed -i "s#\.\./locales/en-US.ftl#../messages.ftl#" $p/src/lib.rs; done