Skip to content

Commit 4132642

Browse files
authored
Rollup merge of rust-lang#71254 - JOE1994:add_comment, r=jonas-schievink
Minor fix and addition to doc comments 1. Fixed doc comment of struct 'rustc_middle::mir::Location' Currently, the general explanation of the struct appears at the field explanation section. I moved and changed the doc comments slightly, so that the general explanation would appear in the proper location in docs. 2. Added doc comment explaining 'rustc_mir::util::pretty::write_mir_fn' Unlike other counterparts, brief explanation for this function was missing, so I added one. Thank you for reviewing this PR :)
2 parents 029e930 + 5847c58 commit 4132642

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/librustc_middle/mir/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2611,14 +2611,14 @@ impl<'a, 'b> graph::GraphSuccessors<'b> for Body<'a> {
26112611
type Iter = iter::Cloned<Successors<'b>>;
26122612
}
26132613

2614+
/// `Location` represents the position of the start of the statement; or, if
2615+
/// `statement_index` equals the number of statements, then the start of the
2616+
/// terminator.
26142617
#[derive(Copy, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, HashStable)]
26152618
pub struct Location {
26162619
/// The block that the location is within.
26172620
pub block: BasicBlock,
26182621

2619-
/// The location is the position of the start of the statement; or, if
2620-
/// `statement_index` equals the number of statements, then the start of the
2621-
/// terminator.
26222622
pub statement_index: usize,
26232623
}
26242624

src/librustc_mir/util/pretty.rs

+1
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ pub fn write_mir_pretty<'tcx>(
254254
Ok(())
255255
}
256256

257+
/// Write out a human-readable textual representation for the given function.
257258
pub fn write_mir_fn<'tcx, F>(
258259
tcx: TyCtxt<'tcx>,
259260
src: MirSource<'tcx>,

0 commit comments

Comments
 (0)