about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/macros.rs
AgeCommit message (Collapse)AuthorLines
2025-03-15Fold visit into tyMichael Goulet-3/+3
2025-03-15Squash fold into tyMichael Goulet-3/+3
2025-02-19Make fewer crates depend on rustc_ast_irMichael Goulet-1/+1
2025-01-31Don't export the `Trivial*` macros.Nicholas Nethercote-3/+0
They're only used within the crate.
2025-01-31Simplify `bug!` and `span_bug!`.Nicholas Nethercote-20/+8
Three rules can be combined into one. I based this change on the definition of `print!`.
2024-10-02Improve const traits diagnostics for new desugaringDeadbeef-1/+1
2024-07-17lift_to_tcx -> lift_to_internerMichael Goulet-1/+1
2024-06-18Use a dedicated type instead of a reference for the diagnostic contextOli Scherer-4/+4
This paves the way for tracking more state (e.g. error tainting) in the diagnostic context handle
2024-05-10Lift `Lift`Michael Goulet-1/+1
2024-03-21Remove unnecessary braces from span_bugMichael Goulet-9/+19
2024-03-05Convert `TypeVisitor` and `DefIdVisitor` to use `VisitorResult`Jason Newcomb-2/+2
2023-12-24Remove `Session` methods that duplicate `DiagCtxt` methods.Nicholas Nethercote-4/+4
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-4/+6
Because the corresponding `Level` is `DelayedBug` and `span_delayed_bug` follows the pattern used everywhere else: `span_err`, `span_warning`, etc.
2023-09-18Rename `CloneLiftImpls` as `TrivialLiftImpls`.Nicholas Nethercote-2/+2
To match `TrivialTypeTraversalImpls` and `TrivialTypeTraversalAndLiftImpls`, and because the `Clone` doesn't mean anything.
2023-07-25Make everything builtin!Michael Goulet-2/+2
2023-04-16Simplify `CloneLiftImpls` and `TrivialTypeTraversalImpls`.Nicholas Nethercote-25/+9
They both allow for a lifetime other than `'tcx`, but this isn't needed.
2023-04-10Fix typos in compilerDaniPopes-1/+1
2023-02-22Remove type-traversal trait aliasesAlan Egerton-5/+5
2023-02-13Move folding and visiting traits into type libraryAlan Egerton-170/+4
2023-02-13Make atomic structural impls generic over InternerAlan Egerton-8/+32
2023-02-13Make folding traits generic over the InternerAlan Egerton-2/+2
2023-02-13Make visiting traits generic over the InternerAlan Egerton-2/+2
2023-02-13Alias folding/visiting traits instead of re-exportAlan Egerton-8/+8
2023-01-17Stop using `BREAK` & `CONTINUE` in compilerScott McMurray-4/+4
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.
2022-12-30Add some docs to `bug`, `span_bug` and `delay_span_bug`Nilstrieb-0/+18
2022-10-17add inline to `TrivialTypeTraversalImpls`lcnr-2/+11
2022-07-05impl TypeVisitable in type traversal macrosAlan Egerton-18/+28
2022-06-08Folding revamp.Nicholas Nethercote-4/+4
This commit makes type folding more like the way chalk does it. Currently, `TypeFoldable` has `fold_with` and `super_fold_with` methods. - `fold_with` is the standard entry point, and defaults to calling `super_fold_with`. - `super_fold_with` does the actual work of traversing a type. - For a few types of interest (`Ty`, `Region`, etc.) `fold_with` instead calls into a `TypeFolder`, which can then call back into `super_fold_with`. With the new approach, `TypeFoldable` has `fold_with` and `TypeSuperFoldable` has `super_fold_with`. - `fold_with` is still the standard entry point, *and* it does the actual work of traversing a type, for all types except types of interest. - `super_fold_with` is only implemented for the types of interest. Benefits of the new model. - I find it easier to understand. The distinction between types of interest and other types is clearer, and `super_fold_with` doesn't exist for most types. - With the current model is easy to get confused and implement a `super_fold_with` method that should be left defaulted. (Some of the precursor commits fixed such cases.) - With the current model it's easy to call `super_fold_with` within `TypeFolder` impls where `fold_with` should be called. The new approach makes this mistake impossible, and this commit fixes a number of such cases. - It's potentially faster, because it avoids the `fold_with` -> `super_fold_with` call in all cases except types of interest. A lot of the time the compile would inline those away, but not necessarily always.
2021-12-02Rename TypeFolderFallible to FallibleTypeFolderAlan Egerton-2/+2
2021-12-02Reduce boilerplate around infallible foldersAlan Egerton-3/+3
2021-11-26Make `TypeFoldable` implementors short-circuit on errorLeSeulArtichaut-7/+7
Co-authored-by: Alan Egerton <eggyal@gmail.com>
2020-11-17Auto merge of #78779 - LeSeulArtichaut:ty-visitor-return, r=oli-obkbors-2/+2
Introduce `TypeVisitor::BreakTy` Implements MCP rust-lang/compiler-team#383. r? `@ghost` cc `@lcnr` `@oli-obk` ~~Blocked on FCP in rust-lang/compiler-team#383.~~
2020-11-16wordslcnr-4/+4
2020-11-16compiler: fold by valueBastian Kauschke-3/+3
2020-11-14Introduce `TypeVisitor::BreakTy`LeSeulArtichaut-2/+2
2020-10-30Remove implicit `Continue` typeLeSeulArtichaut-2/+2
2020-10-30TypeVisitor: use `std::ops::ControlFlow` instead of `bool`LeSeulArtichaut-8/+10
2020-10-21Lift: take self by valueBastian Kauschke-2/+2
2020-08-30mv compiler to compiler/mark-0/+220