Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand doc comment on MIR validation. #115942

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions compiler/rustc_const_eval/src/transform/validate.rs
@@ -1,4 +1,14 @@
//! Validates the MIR to ensure that invariants are upheld.
//!
//! The checks are split in two visitors: CfgChecker and TypeChecker.
//!
//! CfgChecker is meant to verify MIR syntax: control flow of cleanup blocks, allowed/disallowed
//! statements and terminators...
//!
//! TypeChecker is meant to verify MIR types. It is used by the inliner to verify that type
//! instanciation do not mess things up (for instance #112332 and earlier instances).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//! instanciation do not mess things up (for instance #112332 and earlier instances).
//! instantiation do not mess things up (for instance #112332 and earlier instances).

typo?

//!
//! If a check depends on types, it should go in TypeChecker, otherwise it can go in CfgChecker.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You said it's "everything affected by substitution", not just types, right? E.g. if something depends on consts (which could be const generics) it also should go into TypeChecker?


use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_index::bit_set::BitSet;
Expand Down