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
This commit is contained in:
bors 2024-11-06 18:53:35 +00:00
commit 8549802939
3 changed files with 10 additions and 14 deletions

View File

@ -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 <code>
//! <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> Summary</code> button near the
//! top of the page to collapse it into a more skimmable view.
//! development you may want to press the
//! "<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"
//! 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
//! <code>source</code> 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.

View File

@ -9,7 +9,6 @@
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) struct CallData {
/// 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<CrateNum>,
calls: &'a mut AllCallLocations,
@ -122,13 +119,13 @@ impl<'a, 'tcx> Visitor<'tcx> for FindCalls<'a, 'tcx>
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

View File

@ -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!