diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2020-04-17 20:35:25 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-17 20:35:25 +0200 |
| commit | 4132642e8a485fff5b8aa1d68ae3d0c32b514eb5 (patch) | |
| tree | 34c8457090bd69c12170219b7b4a600814074924 | |
| parent | 029e930ab7bb3ee3b664b70d8243b7e042d16d6e (diff) | |
| parent | 5847c581d19526adca6db7a56c54eb0397a07370 (diff) | |
| download | rust-4132642e8a485fff5b8aa1d68ae3d0c32b514eb5.tar.gz rust-4132642e8a485fff5b8aa1d68ae3d0c32b514eb5.zip | |
Rollup merge of #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 :)
| -rw-r--r-- | src/librustc_middle/mir/mod.rs | 6 | ||||
| -rw-r--r-- | src/librustc_mir/util/pretty.rs | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/librustc_middle/mir/mod.rs b/src/librustc_middle/mir/mod.rs index 212061cfd82..4063d290993 100644 --- a/src/librustc_middle/mir/mod.rs +++ b/src/librustc_middle/mir/mod.rs @@ -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, } diff --git a/src/librustc_mir/util/pretty.rs b/src/librustc_mir/util/pretty.rs index 64221c41bff..efb84ef35f3 100644 --- a/src/librustc_mir/util/pretty.rs +++ b/src/librustc_mir/util/pretty.rs @@ -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>, |
