Skip to main content

Module always_applicable

Module always_applicable 

Source
Expand description

This module contains methods that assist in checking that impls are general enough, i.e. that they always apply to every valid instantaiton of the ADT they’re implemented for.

This is necessary for Drop and negative impls to be well-formed.

FunctionsΒ§

check_drop_impl πŸ”’
This function confirms that the Drop implementation identified by drop_impl_did is not any more specialized than the type it is attached to (Issue #8142).
check_drop_xor_pin_drop πŸ”’
This function checks at least and at most one of Drop::drop and Drop::pin_drop is implemented. It also checks that Drop::pin_drop must be implemented if #[pin_v2] is present on the type.
check_negative_auto_trait_impl πŸ”’
ensure_all_fields_are_const_destruct πŸ”’
ensure_impl_params_and_item_params_correspond πŸ”’
ensure_impl_predicates_are_implied_by_item_defn πŸ”’
Confirms that all predicates defined on the Drop impl (drop_impl_def_id) are able to be proven from within adt_def_id’s environment. I.e. all the predicates on the impl are implied by the ADT being well formed.