summary refs log tree commit diff
path: root/compiler/rustc_mir_build/src/lints.rs
AgeCommit message (Collapse)AuthorLines
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