Skip to content

Commit 8549802

Browse files
committed
Auto merge of #132703 - GuillaumeGomez:rollup-tfuef34, r=GuillaumeGomez
Rollup of 3 pull requests Successful merges: - #132617 (Fix an extra newline in rendered std doc) - #132698 (Remove unneeded fields in `scrape_examples::FindCalls`) - #132700 (add note not to re-report crashes from `crashes` tests) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 116fc31 + 4c7e92f commit 8549802

File tree

3 files changed

+10
-14
lines changed

3 files changed

+10
-14
lines changed

library/std/src/lib.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,12 @@
3232
//!
3333
//! Once you are familiar with the contents of the standard library you may
3434
//! begin to find the verbosity of the prose distracting. At this stage in your
35-
//! development you may want to press the <code>
36-
//! <svg style="width:0.75rem;height:0.75rem" viewBox="0 0 12 12"
37-
//! stroke="currentColor" fill="none">
38-
//! <path d="M2,2l4,4l4,-4M2,6l4,4l4,-4"/></svg> Summary</code> button near the
39-
//! top of the page to collapse it into a more skimmable view.
35+
//! development you may want to press the
36+
//! "<svg style="width:0.75rem;height:0.75rem" viewBox="0 0 12 12" stroke="currentColor" fill="none"><path d="M2,2l4,4l4,-4M2,6l4,4l4,-4"/></svg>&nbsp;Summary"
37+
//! button near the top of the page to collapse it into a more skimmable view.
4038
//!
4139
//! While you are looking at the top of the page, also notice the
42-
//! <code>source</code> link. Rust's API documentation comes with the source
40+
//! "Source" link. Rust's API documentation comes with the source
4341
//! code and you are encouraged to read it. The standard library source is
4442
//! generally high quality and a peek behind the curtains is
4543
//! often enlightening.

src/librustdoc/scrape_examples.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use rustc_hir::intravisit::{self, Visitor};
99
use rustc_hir::{self as hir};
1010
use rustc_interface::interface;
1111
use rustc_macros::{Decodable, Encodable};
12-
use rustc_middle::hir::map::Map;
1312
use rustc_middle::hir::nested_filter;
1413
use rustc_middle::ty::{self, TyCtxt};
1514
use rustc_serialize::opaque::{FileEncoder, MemDecoder};
@@ -107,8 +106,6 @@ pub(crate) type AllCallLocations = FxIndexMap<DefPathHash, FnCallLocations>;
107106

108107
/// Visitor for traversing a crate and finding instances of function calls.
109108
struct FindCalls<'a, 'tcx> {
110-
tcx: TyCtxt<'tcx>,
111-
map: Map<'tcx>,
112109
cx: Context<'tcx>,
113110
target_crates: Vec<CrateNum>,
114111
calls: &'a mut AllCallLocations,
@@ -122,13 +119,13 @@ where
122119
type NestedFilter = nested_filter::OnlyBodies;
123120

124121
fn nested_visit_map(&mut self) -> Self::Map {
125-
self.map
122+
self.cx.tcx().hir()
126123
}
127124

128125
fn visit_expr(&mut self, ex: &'tcx hir::Expr<'tcx>) {
129126
intravisit::walk_expr(self, ex);
130127

131-
let tcx = self.tcx;
128+
let tcx = self.cx.tcx();
132129

133130
// If we visit an item that contains an expression outside a function body,
134131
// then we need to exit before calling typeck (which will panic). See
@@ -294,8 +291,7 @@ pub(crate) fn run(
294291

295292
// Run call-finder on all items
296293
let mut calls = FxIndexMap::default();
297-
let mut finder =
298-
FindCalls { calls: &mut calls, tcx, map: tcx.hir(), cx, target_crates, bin_crate };
294+
let mut finder = FindCalls { calls: &mut calls, cx, target_crates, bin_crate };
299295
tcx.hir().visit_all_item_likes_in_crate(&mut finder);
300296

301297
// The visitor might have found a type error, which we need to

tests/crashes/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ A test will "pass" if rustc exits with something other than 1 or 0.
88

99
When adding crashes from https://github.com/rust-lang/rust/issues, the
1010
issue number should be noted in the file name (12345.rs should suffice)
11-
and perhaps also inside the file via `//@ known-bug #4321`
11+
and also inside the file via `//@ known-bug #4321` if possible.
1212

1313
If you happen to fix one of the crashes, please move it to a fitting
1414
subdirectory in `tests/ui` and give it a meaningful name.
@@ -21,3 +21,5 @@ to the description of your pull request will ensure the
2121
corresponding tickets will be closed automatically upon merge.
2222
The ticket ids can be found in the file name or the `known-bug` annotation
2323
inside the testfile.
24+
25+
Please do not re-report any crashes that you find here!

0 commit comments

Comments
 (0)