about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src/check_unsafety.rs
AgeCommit message (Collapse)AuthorLines
2024-04-03Remove MIR unsafe checkMatthew Jasper-615/+0
This also remove safety information from MIR.
2024-02-14Use fewer delayed bugs.Nicholas Nethercote-4/+5
For some cases where it's clear that an error has already occurred, e.g.: - there's a comment stating exactly that, or - things like HIR lowering, where we are lowering an error kind The commit also tweaks some comments around delayed bug sites.
2024-02-06Add CoroutineClosure to TyKind, AggregateKind, UpvarArgsMichael Goulet-1/+3
2024-01-23Rename `TyCtxt::emit_spanned_lint` as `TyCtxt::emit_node_span_lint`.Nicholas Nethercote-2/+2
2024-01-05Stabilize THIR unsafeckMatthew Jasper-5/+6
2023-12-28Remove movability from TyKind::CoroutineMichael Goulet-1/+1
2023-12-24Remove `Session` methods that duplicate `DiagCtxt` methods.Nicholas Nethercote-2/+2
Also add some `dcx` methods to types that wrap `TyCtxt`, for easier access.
2023-12-02Rename `HandlerInner::delay_span_bug` as `HandlerInner::span_delayed_bug`.Nicholas Nethercote-1/+1
Because the corresponding `Level` is `DelayedBug` and `span_delayed_bug` follows the pattern used everywhere else: `span_err`, `span_warning`, etc.
2023-11-29Rollup merge of #118333 - eduardosm:print-missing-target-features, r=est31Matthias Krüger-7/+22
Print list of missing target features when calling a function with target features outside an unsafe block Fixes https://github.com/rust-lang/rust/issues/108680 Supersedes https://github.com/rust-lang/rust/pull/109710. I used the same wording for the messages, but the implementation is different. r? `@est31`
2023-11-27Address unused tuple struct fields in the compilerJake Goulding-3/+3
2023-11-27Print list of missing target features when calling a function with target ↵Eduardo Sánchez Muñoz-7/+22
features outside an unsafe block
2023-11-26rustc: `hir().local_def_id_to_hir_id()` -> `tcx.local_def_id_to_hir_id()` ↵Vadim Petrochenkov-2/+2
cleanup
2023-11-21Fix `clippy::needless_borrow` in the compilerNilstrieb-1/+1
`x clippy compiler -Aclippy::all -Wclippy::needless_borrow --fix`. Then I had to remove a few unnecessary parens and muts that were exposed now.
2023-10-20s/Generator/Coroutine/Oli Scherer-2/+2
2023-10-13Format all the let chains in compilerMichael Goulet-2/+1
2023-10-04Remove mir::LocalDecl::internal.Camille GILLOT-1/+1
2023-09-21rename mir::Constant -> mir::ConstOperand, mir::ConstKind -> mir::ConstRalf Jung-3/+3
2023-09-06fix #115348mojave2-1/+1
2023-08-24when terminating during unwinding, show the reason whyRalf Jung-1/+1
2023-08-20give some unwind-related terminators a more clear nameRalf Jung-2/+2
2023-07-14Introduce ExtentUnord trait for collections that can safely consume UnordItems.Michael Woerister-1/+1
2023-06-13Auto merge of #112017 - Nemo157:unsafe-block-rustfix, r=eholkbors-6/+25
Add MVP suggestion for `unsafe_op_in_unsafe_fn` Rebase of https://github.com/rust-lang/rust/pull/99827 cc tracking issue https://github.com/rust-lang/rust/issues/71668 No real changes since the original PR, just migrated the new suggestion to use fluent messages and added a couple more testcases, AFAICT from the discussion there were no outstanding changes requested.
2023-06-13Add note about unsafe functions body not being unsafeWim Looman-1/+6
2023-06-13Add MVP suggestion for `unsafe_op_in_unsafe_fn`Léo Lanteri Thauvin-6/+20
Nemo157 rebase notes: Migrated the changes to the lint into fluent
2023-06-02Separate AnonConst from ConstBlock in HIR.Camille GILLOT-4/+2
2023-05-15Move expansion of query macros in rustc_middle to rustc_middle::queryJohn Kåre Alsaker-1/+1
2023-05-02Migrate `mir_transform` to translatable diagnosticsclubby789-45/+23
2023-04-20Remove WithOptconstParam.Camille GILLOT-25/+7
2023-04-06Rename `Abort` terminator to `Terminate`Gary Guo-1/+1
Unify terminology used in unwind action and terminator, and reflect the fact that a nounwind panic is triggered instead of an immediate abort is triggered for this terminator.
2023-03-14Wrap the whole LocalInfo in ClearCrossCrate.Camille GILLOT-1/+1
2023-03-09Pacify tidy.Camille GILLOT-2/+2
2023-03-09Ignore AscribeUserType in unsafeck to avoid duplicate diagnostics.Camille GILLOT-1/+3
2023-03-09Introduce a no-op PlaceMention statement for `let _ =`.Camille GILLOT-0/+1
2023-03-08Rollup merge of #108856 - Zeegomo:remove-drop-and-rep, r=tmiaskoMatthias Krüger-1/+0
Remove DropAndReplace terminator #107844 made DropAndReplace unused, let's remove it completely from the codebase.
2023-03-07Remove DropAndReplace terminatorGiacomo Pasini-1/+0
PR 107844 made DropAndReplace unused, let's remove it completely from the codebase.
2023-03-01Remove last instances of HashSet in query result types.Michael Woerister-12/+10
2023-02-02Put a DefId in AggregateKind.Camille GILLOT-0/+1
2023-01-29Auto merge of #106227 - bryangarza:ctfe-limit, r=oli-obkbors-0/+1
Use stable metric for const eval limit instead of current terminator-based logic This patch adds a `MirPass` that inserts a new MIR instruction `ConstEvalCounter` to any loops and function calls in the CFG. This instruction is used during Const Eval to count against the `const_eval_limit`, and emit the `StepLimitReached` error, replacing the current logic which uses Terminators only. The new method of counting loops and function calls should be more stable across compiler versions (i.e., not cause crates that compiled successfully before, to no longer compile when changes to the MIR generation/optimization are made). Also see: #103877
2023-01-28Take a LocalDefId in hir::Visitor::visit_fn.Camille GILLOT-1/+1
2023-01-23Create stable metric to measure long computation in Const EvalBryan Garza-0/+1
This patch adds a `MirPass` that tracks the number of back-edges and function calls in the CFG, adds a new MIR instruction to increment a counter every time they are encountered during Const Eval, and emit a warning if a configured limit is breached.
2022-12-20rustc: Remove needless lifetimesJeremy Stucki-3/+3
2022-12-14Fix unsafetyck disabling for custom MIRJakob Degen-1/+1
2022-12-13Allow unsafe through inline constGary Guo-3/+32
This is handled similar to closures
2022-11-08Add support for custom MIR parsingJakob Degen-0/+8
2022-11-04Formatting changes + add UI testclubby789-10/+9
2022-11-04Give a specific lint for unsafety not being inheritedclubby789-9/+35
2022-10-31Remove bounds check with enum castouz-a-3/+1
2022-10-27Accept `TyCtxt` instead of `TyCtxtAt` in `Ty::is_*` functionsMaybe Waffle-1/+1
Functions in answer: - `Ty::is_freeze` - `Ty::is_sized` - `Ty::is_unpin` - `Ty::is_copy_modulo_regions`
2022-10-01Refactor rustc lint APIMaybe Waffle-15/+7
2022-09-06Generalize the Assume intrinsic statement to a general Intrinsic statementOli Scherer-3/+1