File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ //! Analysis of Rust MIR to generate a CHC system.
2+ //!
3+ //! The [`Analyzer`] generates subtyping constraints in the form of CHCs ([`chc::System`]).
4+ //! The entry point is [`crate_::Analyzer::run`], followed by [`local_def::Analyzer::run`]
5+ //! and [`basic_block::Analyzer::run`], while accumulating the necessary information in
6+ //! [`Analyzer`]. Once [`chc::System`] is collected for the entire input, it invokes an external
7+ //! CHC solver with the [`Analyzer::solve`] and subsequently reports the result.
8+
19use std:: cell:: RefCell ;
210use std:: collections:: HashMap ;
311use std:: rc:: Rc ;
Original file line number Diff line number Diff line change 1+ //! Core logic of refinement typing.
2+ //!
3+ //! This module includes the definition of the refinement typing environment along with the template
4+ //! type generation from MIR types.
5+ //!
6+ //! This module is used by the [`crate::analyze`] module. There is currently no clear boundary between
7+ //! the `analyze` and `refine` modules, so it is a TODO to integrate this into the `analyze`
8+ //! module and remove this one.
9+
110mod template;
211pub use template:: { TemplateScope , TemplateTypeGenerator , UnrefinedTypeGenerator } ;
312
Original file line number Diff line number Diff line change 1+ //! The refinement type for a basic block.
2+
13use pretty:: { termcolor, Pretty } ;
24use rustc_index:: IndexVec ;
35use rustc_middle:: mir:: Local ;
46use rustc_middle:: ty as mir_ty;
57
68use crate :: rty;
79
8- /// `BasicBlockType` is a special case of `FunctionType` whose parameters are
9- /// associated with `Local`s.
10+ /// A special case of [`rty::FunctionType`] whose parameters are
11+ /// associated with [`Local`]s.
12+ ///
13+ /// Thrust essentially handles basic blocks as functions, but it needs to associate function
14+ /// parameters with MIR [`Local`]s during its analysis. [`BasicBlockType`] includes the mapping
15+ /// from function parameters to [`Local`]s along with the underlying function type.
1016#[ derive( Debug , Clone ) ]
1117pub struct BasicBlockType {
1218 // TODO: make this completely private by exposing appropriate ctor
You can’t perform that action at this time.
0 commit comments