Skip to content

Commit

Permalink
Rollup merge of #71254 - JOE1994:add_comment, r=jonas-schievink
Browse files Browse the repository at this point in the history
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 :)
  • Loading branch information
Dylan-DPC authored Apr 17, 2020
2 parents 029e930 + 5847c58 commit 4132642
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/librustc_middle/mir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2611,14 +2611,14 @@ impl<'a, 'b> graph::GraphSuccessors<'b> for Body<'a> {
type Iter = iter::Cloned<Successors<'b>>;
}

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

/// The location is the position of the start of the statement; or, if
/// `statement_index` equals the number of statements, then the start of the
/// terminator.
pub statement_index: usize,
}

Expand Down
1 change: 1 addition & 0 deletions src/librustc_mir/util/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ pub fn write_mir_pretty<'tcx>(
Ok(())
}

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

0 comments on commit 4132642

Please sign in to comment.