Skip to content

Commit

Permalink
Auto merge of rust-lang#107451 - matthiaskrgr:rollup-m4ucfu8, r=matth…
Browse files Browse the repository at this point in the history
…iaskrgr

Rollup of 11 pull requests

Successful merges:

 - rust-lang#96763 (Fix maintainer validation message)
 - rust-lang#106540 (Insert whitespace to avoid ident concatenation in suggestion)
 - rust-lang#106763 (print why a test was ignored if its the only test specified)
 - rust-lang#106769 (libtest: Print why a test was ignored if it's the only test specified.)
 - rust-lang#106798 (Implement `signum` with `Ord`)
 - rust-lang#107006 (Output tree representation on thir-tree)
 - rust-lang#107078 (Update wording of invalid_doc_attributes docs.)
 - rust-lang#107169 (Pass `--locked` to the x test tidy call)
 - rust-lang#107431 (docs: remove colon from time header)
 - rust-lang#107432 (rustdoc: remove unused class `has-srclink`)
 - rust-lang#107448 (When stamp doesn't exist, should say Error, and print path to stamp file)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
  • Loading branch information
bors committed Jan 29, 2023
2 parents c7bf469 + 97e6aba commit e972bc8
Show file tree
Hide file tree
Showing 79 changed files with 1,553 additions and 233 deletions.
15 changes: 15 additions & 0 deletions compiler/rustc_driver/src/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,21 @@ fn print_with_analysis(tcx: TyCtxt<'_>, ppm: PpMode) -> Result<(), ErrorGuarante
out
}

ThirFlat => {
let mut out = String::new();
abort_on_err(rustc_hir_analysis::check_crate(tcx), tcx.sess);
debug!("pretty printing THIR flat");
for did in tcx.hir().body_owners() {
let _ = writeln!(
out,
"{:?}:\n{}\n",
did,
tcx.thir_flat(ty::WithOptConstParam::unknown(did))
);
}
out
}

_ => unreachable!(),
};

Expand Down
12 changes: 9 additions & 3 deletions compiler/rustc_lint_defs/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3531,9 +3531,15 @@ declare_lint! {
///
/// ### Explanation
///
/// Previously, there were very like checks being performed on `#[doc(..)]`
/// unlike the other attributes. It'll now catch all the issues that it
/// silently ignored previously.
/// Previously, incorrect usage of the `#[doc(..)]` attribute was not
/// being validated. Usually these should be rejected as a hard error,
/// but this lint was introduced to avoid breaking any existing
/// crates which included them.
///
/// This is a [future-incompatible] lint to transition this to a hard
/// error in the future. See [issue #82730] for more details.
///
/// [issue #82730]: https://github.com/rust-lang/rust/issues/82730
pub INVALID_DOC_ATTRIBUTES,
Warn,
"detects invalid `#[doc(...)]` attributes",
Expand Down
7 changes: 7 additions & 0 deletions compiler/rustc_middle/src/query/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,13 @@ rustc_queries! {
desc { |tcx| "constructing THIR tree for `{}`", tcx.def_path_str(key.did.to_def_id()) }
}

/// Create a list-like THIR representation for debugging.
query thir_flat(key: ty::WithOptConstParam<LocalDefId>) -> String {
no_hash
arena_cache
desc { |tcx| "constructing flat THIR representation for `{}`", tcx.def_path_str(key.did.to_def_id()) }
}

/// Set of all the `DefId`s in this crate that have MIR associated with
/// them. This includes all the body owners, but also things like struct
/// constructors.
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_middle/src/thir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ use rustc_target::asm::InlineAsmRegOrRegClass;
use std::fmt;
use std::ops::Index;

pub mod print;
pub mod visit;

macro_rules! thir_with_elements {
Expand Down
Loading

0 comments on commit e972bc8

Please sign in to comment.