Skip to content

Commit ff6faab

Browse files
Add description for every module in check_consts
1 parent 713ec15 commit ff6faab

File tree

5 files changed

+17
-0
lines changed

5 files changed

+17
-0
lines changed

src/librustc_mir/transform/check_consts/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
//! Check the bodies of `const`s, `static`s and `const fn`s for illegal operations.
2+
//!
3+
//! This module will eventually replace the parts of `qualify_consts.rs` that check whether a local
4+
//! has interior mutability or needs to be dropped, as well as the visitor that emits errors when
5+
//! it finds operations that are invalid in a certain context.
6+
17
use rustc::hir::def_id::DefId;
28
use rustc::mir;
39
use rustc::ty::{self, TyCtxt};

src/librustc_mir/transform/check_consts/ops.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Concrete error types for all operations which may be invalid in a certain const context.
2+
13
use rustc::hir::def_id::DefId;
24
use rustc::mir::BorrowKind;
35
use rustc::session::config::nightly_options;

src/librustc_mir/transform/check_consts/qualifs.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! A copy of the `Qualif` trait in `qualify_consts.rs` that is suitable for the new validator.
2+
13
use rustc::mir::*;
24
use rustc::mir::interpret::ConstValue;
35
use rustc::ty::{self, Ty};

src/librustc_mir/transform/check_consts/resolver.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
//! Propagate `Qualif`s between locals and query the results.
2+
//!
3+
//! This also contains the dataflow analysis used to track `Qualif`s on complex control-flow
4+
//! graphs.
5+
16
use rustc::mir::visit::Visitor;
27
use rustc::mir::{self, BasicBlock, Local, Location};
38
use rustc_data_structures::bit_set::BitSet;

src/librustc_mir/transform/check_consts/validation.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! The `Visitor` responsible for actually checking a `mir::Body` for invalid operations.
2+
13
use rustc::hir::{self, def_id::DefId};
24
use rustc::mir::visit::{PlaceContext, Visitor, MutatingUseContext, NonMutatingUseContext};
35
use rustc::mir::*;

0 commit comments

Comments
 (0)