implement checks for tail calls

this implements checks necessary to guarantee that we can actually
perform a tail call. while extremely restrictive, this is what is
documented in the RFC, and all these checks are needed for one reason or
another.
This commit is contained in:
Maybe Waffle
2023-05-11 11:43:09 +00:00
committed by Maybe Lapkin
parent c1cfab230e
commit cfb78419cd
18 changed files with 848 additions and 0 deletions

View File

@@ -12,6 +12,7 @@
// tidy-alphabetical-end
mod build;
mod check_tail_calls;
mod check_unsafety;
mod errors;
pub mod lints;
@@ -28,6 +29,7 @@ pub fn provide(providers: &mut Providers) {
providers.closure_saved_names_of_captured_variables =
build::closure_saved_names_of_captured_variables;
providers.check_unsafety = check_unsafety::check_unsafety;
providers.check_tail_calls = check_tail_calls::check_tail_calls;
providers.thir_body = thir::cx::thir_body;
providers.hooks.thir_tree = thir::print::thir_tree;
providers.hooks.thir_flat = thir::print::thir_flat;