1
Fork 0

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
No known key found for this signature in database
18 changed files with 848 additions and 0 deletions

View file

@ -916,6 +916,12 @@ rustc_queries! {
cache_on_disk_if { true }
}
/// Checks well-formedness of tail calls (`become f()`).
query check_tail_calls(key: LocalDefId) -> Result<(), rustc_errors::ErrorGuaranteed> {
desc { |tcx| "tail-call-checking `{}`", tcx.def_path_str(key) }
cache_on_disk_if { true }
}
/// Returns the types assumed to be well formed while "inside" of the given item.
///
/// Note that we've liberated the late bound regions of function signatures, so