Skip to main content

Module check_consts

Module check_consts 

Source
Expand description

Check the bodies of consts, statics and const fns for illegal operations.

This module will eventually replace the parts of qualify_consts.rs that check whether a local has interior mutability or needs to be dropped, as well as the visitor that emits errors when it finds operations that are invalid in a certain context.

Re-exportsΒ§

use rustc_attr_ir::find_attr; πŸ”’
use rustc_errors::DiagCtxtHandle; πŸ”’
use rustc_hir as hir; πŸ”’
use rustc_hir::def_id::DefId; πŸ”’
use rustc_hir::def_id::LocalDefId; πŸ”’
use rustc_middle::mir; πŸ”’
use rustc_middle::ty; πŸ”’
use rustc_middle::ty::PolyFnSig; πŸ”’
use rustc_middle::ty::TyCtxt; πŸ”’
use rustc_span::Symbol; πŸ”’
use rustc_span::bug; πŸ”’
pub use self::qualifs::Qualif;

ModulesΒ§

check
The Visitor responsible for actually checking a mir::Body for invalid operations.
ops πŸ”’
Concrete error types for all operations which may be invalid in a certain const context.
post_drop_elaboration
qualifs
Structural const qualification.
resolver πŸ”’
Propagate Qualifs between locals and query the results.

StructsΒ§

ConstCx
Information about the item currently being const-checked, as well as a reference to the global context.

FunctionsΒ§

is_fn_or_trait_safe_to_expose_on_stable
Returns true if the given def_id (trait or function) is β€œsafe to expose on stable”.
rustc_allow_const_fn_unstable