From 934be9b63bd5d4801807125664aad702abf79070 Mon Sep 17 00:00:00 2001 From: uellenberg Date: Mon, 4 Nov 2024 14:22:23 -0800 Subject: [PATCH 1/3] Change some code blocks to quotes in rendered std doc Fixes #132564 --- library/std/src/lib.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index b5450d0a20c..5b94f036248 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. From 03a63fd4a48ff03e72efab4465ad52b516b4570f Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 6 Nov 2024 17:35:14 +0100 Subject: [PATCH 2/3] Remove unneeded fields in `scrape_examples::FindCalls` --- src/librustdoc/scrape_examples.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/librustdoc/scrape_examples.rs b/src/librustdoc/scrape_examples.rs index a59c43bfbf9..3134d25e544 100644 --- a/src/librustdoc/scrape_examples.rs +++ b/src/librustdoc/scrape_examples.rs @@ -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, 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 From da5102c17252d6296eb71ffe1adcdfef583fd183 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Wed, 6 Nov 2024 18:07:47 +0100 Subject: [PATCH 3/3] add note not to re-report crashes from `crashes` tests --- tests/crashes/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/crashes/README.md b/tests/crashes/README.md index 71ce9b2eca6..2dc81a115df 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!