diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index b5450d0a20cf2..5b94f036248cb 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -32,14 +32,12 @@ //! //! Once you are familiar with the contents of the standard library you may //! begin to find the verbosity of the prose distracting. At this stage in your -//! development you may want to press the -//! -//! Summary button near the -//! top of the page to collapse it into a more skimmable view. +//! development you may want to press the +//! " Summary" +//! button near the top of the page to collapse it into a more skimmable view. //! //! While you are looking at the top of the page, also notice the -//! source link. Rust's API documentation comes with the source +//! "Source" link. Rust's API documentation comes with the source //! code and you are encouraged to read it. The standard library source is //! generally high quality and a peek behind the curtains is //! often enlightening. diff --git a/src/librustdoc/scrape_examples.rs b/src/librustdoc/scrape_examples.rs index a59c43bfbf904..3134d25e54403 100644 --- a/src/librustdoc/scrape_examples.rs +++ b/src/librustdoc/scrape_examples.rs @@ -9,7 +9,6 @@ use rustc_hir::intravisit::{self, Visitor}; use rustc_hir::{self as hir}; use rustc_interface::interface; use rustc_macros::{Decodable, Encodable}; -use rustc_middle::hir::map::Map; use rustc_middle::hir::nested_filter; use rustc_middle::ty::{self, TyCtxt}; use rustc_serialize::opaque::{FileEncoder, MemDecoder}; @@ -107,8 +106,6 @@ pub(crate) type AllCallLocations = FxIndexMap; /// Visitor for traversing a crate and finding instances of function calls. struct FindCalls<'a, 'tcx> { - tcx: TyCtxt<'tcx>, - map: Map<'tcx>, cx: Context<'tcx>, target_crates: Vec, calls: &'a mut AllCallLocations, @@ -122,13 +119,13 @@ where type NestedFilter = nested_filter::OnlyBodies; fn nested_visit_map(&mut self) -> Self::Map { - self.map + self.cx.tcx().hir() } fn visit_expr(&mut self, ex: &'tcx hir::Expr<'tcx>) { intravisit::walk_expr(self, ex); - let tcx = self.tcx; + let tcx = self.cx.tcx(); // If we visit an item that contains an expression outside a function body, // then we need to exit before calling typeck (which will panic). See @@ -294,8 +291,7 @@ pub(crate) fn run( // Run call-finder on all items let mut calls = FxIndexMap::default(); - let mut finder = - FindCalls { calls: &mut calls, tcx, map: tcx.hir(), cx, target_crates, bin_crate }; + let mut finder = FindCalls { calls: &mut calls, cx, target_crates, bin_crate }; tcx.hir().visit_all_item_likes_in_crate(&mut finder); // The visitor might have found a type error, which we need to diff --git a/tests/crashes/README.md b/tests/crashes/README.md index 71ce9b2eca6f7..2dc81a115df3e 100644 --- a/tests/crashes/README.md +++ b/tests/crashes/README.md @@ -8,7 +8,7 @@ A test will "pass" if rustc exits with something other than 1 or 0. When adding crashes from https://github.com/rust-lang/rust/issues, the issue number should be noted in the file name (12345.rs should suffice) -and perhaps also inside the file via `//@ known-bug #4321` +and also inside the file via `//@ known-bug #4321` if possible. If you happen to fix one of the crashes, please move it to a fitting subdirectory in `tests/ui` and give it a meaningful name. @@ -21,3 +21,5 @@ to the description of your pull request will ensure the corresponding tickets will be closed automatically upon merge. The ticket ids can be found in the file name or the `known-bug` annotation inside the testfile. + +Please do not re-report any crashes that you find here!