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:
commit
8549802939
@ -32,14 +32,12 @@
|
|||||||
//!
|
//!
|
||||||
//! Once you are familiar with the contents of the standard library you may
|
//! 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
|
//! begin to find the verbosity of the prose distracting. At this stage in your
|
||||||
//! development you may want to press the <code>
|
//! development you may want to press the
|
||||||
//! <svg style="width:0.75rem;height:0.75rem" viewBox="0 0 12 12"
|
//! "<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"
|
||||||
//! stroke="currentColor" fill="none">
|
//! button near the top of the page to collapse it into a more skimmable view.
|
||||||
//! <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.
|
|
||||||
//!
|
//!
|
||||||
//! While you are looking at the top of the page, also notice the
|
//! 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
|
//! code and you are encouraged to read it. The standard library source is
|
||||||
//! generally high quality and a peek behind the curtains is
|
//! generally high quality and a peek behind the curtains is
|
||||||
//! often enlightening.
|
//! often enlightening.
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
use rustc_hir::{self as hir};
|
use rustc_hir::{self as hir};
|
||||||
use rustc_interface::interface;
|
use rustc_interface::interface;
|
||||||
use rustc_macros::{Decodable, Encodable};
|
use rustc_macros::{Decodable, Encodable};
|
||||||
use rustc_middle::hir::map::Map;
|
|
||||||
use rustc_middle::hir::nested_filter;
|
use rustc_middle::hir::nested_filter;
|
||||||
use rustc_middle::ty::{self, TyCtxt};
|
use rustc_middle::ty::{self, TyCtxt};
|
||||||
use rustc_serialize::opaque::{FileEncoder, MemDecoder};
|
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.
|
/// Visitor for traversing a crate and finding instances of function calls.
|
||||||
struct FindCalls<'a, 'tcx> {
|
struct FindCalls<'a, 'tcx> {
|
||||||
tcx: TyCtxt<'tcx>,
|
|
||||||
map: Map<'tcx>,
|
|
||||||
cx: Context<'tcx>,
|
cx: Context<'tcx>,
|
||||||
target_crates: Vec<CrateNum>,
|
target_crates: Vec<CrateNum>,
|
||||||
calls: &'a mut AllCallLocations,
|
calls: &'a mut AllCallLocations,
|
||||||
@ -122,13 +119,13 @@ impl<'a, 'tcx> Visitor<'tcx> for FindCalls<'a, 'tcx>
|
|||||||
type NestedFilter = nested_filter::OnlyBodies;
|
type NestedFilter = nested_filter::OnlyBodies;
|
||||||
|
|
||||||
fn nested_visit_map(&mut self) -> Self::Map {
|
fn nested_visit_map(&mut self) -> Self::Map {
|
||||||
self.map
|
self.cx.tcx().hir()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn visit_expr(&mut self, ex: &'tcx hir::Expr<'tcx>) {
|
fn visit_expr(&mut self, ex: &'tcx hir::Expr<'tcx>) {
|
||||||
intravisit::walk_expr(self, ex);
|
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,
|
// 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
|
// 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
|
// Run call-finder on all items
|
||||||
let mut calls = FxIndexMap::default();
|
let mut calls = FxIndexMap::default();
|
||||||
let mut finder =
|
let mut finder = FindCalls { calls: &mut calls, cx, target_crates, bin_crate };
|
||||||
FindCalls { calls: &mut calls, tcx, map: tcx.hir(), cx, target_crates, bin_crate };
|
|
||||||
tcx.hir().visit_all_item_likes_in_crate(&mut finder);
|
tcx.hir().visit_all_item_likes_in_crate(&mut finder);
|
||||||
|
|
||||||
// The visitor might have found a type error, which we need to
|
// The visitor might have found a type error, which we need to
|
||||||
|
@ -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
|
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)
|
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
|
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.
|
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.
|
corresponding tickets will be closed automatically upon merge.
|
||||||
The ticket ids can be found in the file name or the `known-bug` annotation
|
The ticket ids can be found in the file name or the `known-bug` annotation
|
||||||
inside the testfile.
|
inside the testfile.
|
||||||
|
|
||||||
|
Please do not re-report any crashes that you find here!
|
||||||
|
Loading…
Reference in New Issue
Block a user