about summary refs log tree commit diff
path: root/compiler/rustc_mir_build/src/lints.rs
AgeCommit message (Collapse)AuthorLines
2025-01-18Consolidate ad-hoc MIR lints into real pass-manager-based MIR lintsMichael Goulet-261/+0
2024-11-19unconditional recursion, yeet `TypingEnv::from_param_env`lcnr-10/+5
2024-11-18use `TypingEnv` when no `infcx` is availablelcnr-4/+9
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-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-6/+4
2024-07-29Reformat `use` declarations.Nicholas Nethercote-4/+5
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-07Fix unconditional recursion lint wrt tail callsMaybe Waffle-2/+16
2024-07-07Support tail calls in mir via `TerminatorKind::TailCall`Maybe Waffle-0/+2
2024-07-02Instance::resolve -> Instance::try_resolve, and other nitsMichael Goulet-1/+1
2024-02-24Change InlineAsm to allow multiple targets insteadGary Guo-3/+4
2024-02-16Fix an ICE in the recursion lintOli Scherer-1/+3
2024-02-08Avoid ICE in drop recursion check in case of invalid drop implsOli Scherer-6/+5
2024-01-23Rename `TyCtxt::emit_spanned_lint` as `TyCtxt::emit_node_span_lint`.Nicholas Nethercote-1/+1
2023-11-26rustc: `hir().local_def_id_to_hir_id()` -> `tcx.local_def_id_to_hir_id()` ↵Vadim Petrochenkov-1/+1
cleanup
2023-10-20s/Generator/Coroutine/Oli Scherer-1/+1
2023-10-13Format all the let chains in compilerMichael Goulet-8/+13
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-22Make `unconditional_recursion` warning detect recursive dropsMartin Nordholts-18/+90
2023-07-20Add is_recursive_terminator() helper for `unconditional_recursion` lintMartin Nordholts-10/+13
2023-07-20Avoid unneeded `terminator()` call in `fn ignore_edge()`Martin Nordholts-3/+3
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-16/+16
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-04-06Refactor unwind from Option to a new enumGary Guo-2/+4
2023-03-21IdentitySubsts::identity_for_item takes Into<DefId>Michael Goulet-1/+1
2023-03-07Remove DropAndReplace terminatorGiacomo Pasini-1/+0
PR 107844 made DropAndReplace unused, let's remove it completely from the codebase.
2023-01-17Stop using `BREAK` & `CONTINUE` in compilerScott McMurray-3/+3
Switching them to `Break(())` and `Continue(())` instead. libs-api would like to remove these constants, so stop using them in compiler to make the removal PR later smaller.
2023-01-17Remove double spaces after dots in commentsMaybe Waffle-1/+1
2022-12-17Migrate "unsafe_op_in_unsafe_fn" lintsTheOddGarlic-4/+6
2022-12-17Migrate "function cannot return without recursing" diagnosticTheOddGarlic-14/+5
2022-10-01Refactor rustc lint APIMaybe Waffle-10/+14
2022-08-01Remove trait_of_item query.Camille GILLOT-1/+1
2022-08-01Remove DefId from AssocItemContainer.Camille GILLOT-6/+4
2022-07-29Use DefKind instead of FnKind for recursion lint.Camille GILLOT-7/+2
2022-07-28Remove guess_head_span.Camille GILLOT-1/+1
2022-07-07Make MIR basic blocks field publicTomasz Miąsko-3/+5
This makes it possible to mutably borrow different fields of the MIR body without resorting to methods like `basic_blocks_local_decls_mut_and_var_debug_info`. To preserve validity of control flow graph caches in the presence of modifications, a new struct `BasicBlocks` wraps together basic blocks and control flow graph caches. The `BasicBlocks` dereferences to `IndexVec<BasicBlock, BasicBlockData>`. On the other hand a mutable access requires explicit `as_mut()` call.
2022-05-20Remove `crate` visibility usage in compilerJacob Pratt-1/+1
2022-01-29Check the number of arguments first in `is_recursive_call`Tomasz Miąsko-4/+10
2022-01-26Ignore unwinding edges when checking for unconditional recursionTomasz Miąsko-4/+8
The unconditional recursion lint determines if all execution paths eventually lead to a self-recursive call. The implementation always follows unwinding edges which limits its practical utility. For example, it would not lint function `f` because a call to `g` might unwind. It also wouldn't lint function `h` because an overflow check preceding the self-recursive call might unwind: ```rust pub fn f() { g(); f(); } pub fn g() { /* ... */ } pub fn h(a: usize) { h(a + 1); } ``` To avoid the issue, assume that terminators that might continue execution along non-unwinding edges do so.
2022-01-15Reduce use of local_def_id_to_hir_id.Camille GILLOT-2/+1
2021-10-19Replace FnLikeNode by FnKind.Camille GILLOT-3/+2
2021-03-09Do not store attrs in FnKind.Camille GILLOT-1/+1
2020-10-22Don't re-export std::ops::ControlFlow in the compiler.Leonora Tindall-1/+2
2020-10-21Fix formattingbishtpawan-6/+7
2020-10-20Fix build failure of rustfmtbishtpawan-2/+3
2020-10-04Replace `(Body, DefId)` with `Body` where possibleDylan MacKenzie-12/+11
A `Body` now contains its `MirSource`, which in turn contains the `DefId` of the item associated with the `Body`.
2020-09-07Rollup merge of #76318 - scottmcm:one-control-flow, r=ecstatic-morseDylan DPC-3/+3
Use ops::ControlFlow in rustc_data_structures::graph::iterate Since I only know about this because you mentioned it, r? @ecstatic-morse If we're not supposed to use new `core` things in compiler for a while then feel free to close, but it felt reasonable to merge the two types since they're the same, and it might be convenient for people to use `?` in their traversal code. (This doesn't do the type parameter swap; NoraCodes has signed up to do that one.)
2020-09-04Change ty.kind to a methodLeSeulArtichaut-1/+1
2020-09-04Use ops::ControlFlow in graph::iterateScott McMurray-3/+3
2020-08-30mv compiler to compiler/mark-0/+161