Skip to content

Commit e972bc8

Browse files
committed
Auto merge of #107451 - matthiaskrgr:rollup-m4ucfu8, r=matthiaskrgr
Rollup of 11 pull requests Successful merges: - #96763 (Fix maintainer validation message) - #106540 (Insert whitespace to avoid ident concatenation in suggestion) - #106763 (print why a test was ignored if its the only test specified) - #106769 (libtest: Print why a test was ignored if it's the only test specified.) - #106798 (Implement `signum` with `Ord`) - #107006 (Output tree representation on thir-tree) - #107078 (Update wording of invalid_doc_attributes docs.) - #107169 (Pass `--locked` to the x test tidy call) - #107431 (docs: remove colon from time header) - #107432 (rustdoc: remove unused class `has-srclink`) - #107448 (When stamp doesn't exist, should say Error, and print path to stamp file) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents c7bf469 + 97e6aba commit e972bc8

File tree

79 files changed

+1553
-233
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+1553
-233
lines changed

compiler/rustc_driver/src/pretty.rs

+15
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,21 @@ fn print_with_analysis(tcx: TyCtxt<'_>, ppm: PpMode) -> Result<(), ErrorGuarante
498498
out
499499
}
500500

501+
ThirFlat => {
502+
let mut out = String::new();
503+
abort_on_err(rustc_hir_analysis::check_crate(tcx), tcx.sess);
504+
debug!("pretty printing THIR flat");
505+
for did in tcx.hir().body_owners() {
506+
let _ = writeln!(
507+
out,
508+
"{:?}:\n{}\n",
509+
did,
510+
tcx.thir_flat(ty::WithOptConstParam::unknown(did))
511+
);
512+
}
513+
out
514+
}
515+
501516
_ => unreachable!(),
502517
};
503518

compiler/rustc_lint_defs/src/builtin.rs

+9-3
Original file line numberDiff line numberDiff line change
@@ -3531,9 +3531,15 @@ declare_lint! {
35313531
///
35323532
/// ### Explanation
35333533
///
3534-
/// Previously, there were very like checks being performed on `#[doc(..)]`
3535-
/// unlike the other attributes. It'll now catch all the issues that it
3536-
/// silently ignored previously.
3534+
/// Previously, incorrect usage of the `#[doc(..)]` attribute was not
3535+
/// being validated. Usually these should be rejected as a hard error,
3536+
/// but this lint was introduced to avoid breaking any existing
3537+
/// crates which included them.
3538+
///
3539+
/// This is a [future-incompatible] lint to transition this to a hard
3540+
/// error in the future. See [issue #82730] for more details.
3541+
///
3542+
/// [issue #82730]: https://github.com/rust-lang/rust/issues/82730
35373543
pub INVALID_DOC_ATTRIBUTES,
35383544
Warn,
35393545
"detects invalid `#[doc(...)]` attributes",

compiler/rustc_middle/src/query/mod.rs

+7
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,13 @@ rustc_queries! {
361361
desc { |tcx| "constructing THIR tree for `{}`", tcx.def_path_str(key.did.to_def_id()) }
362362
}
363363

364+
/// Create a list-like THIR representation for debugging.
365+
query thir_flat(key: ty::WithOptConstParam<LocalDefId>) -> String {
366+
no_hash
367+
arena_cache
368+
desc { |tcx| "constructing flat THIR representation for `{}`", tcx.def_path_str(key.did.to_def_id()) }
369+
}
370+
364371
/// Set of all the `DefId`s in this crate that have MIR associated with
365372
/// them. This includes all the body owners, but also things like struct
366373
/// constructors.

compiler/rustc_middle/src/thir.rs

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ use rustc_target::asm::InlineAsmRegOrRegClass;
2929
use std::fmt;
3030
use std::ops::Index;
3131

32+
pub mod print;
3233
pub mod visit;
3334

3435
macro_rules! thir_with_elements {

0 commit comments

Comments
 (0)