Skip to content

Commit 7afb325

Browse files
committed
Enforce that query results implement Debug
1 parent 492b83c commit 7afb325

File tree

22 files changed

+45
-33
lines changed

22 files changed

+45
-33
lines changed

compiler/rustc_attr/src/builtin.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,21 +67,21 @@ fn handle_errors(sess: &ParseSess, span: Span, error: AttrError) {
6767
}
6868
}
6969

70-
#[derive(Copy, Clone, PartialEq, Encodable, Decodable)]
70+
#[derive(Copy, Clone, PartialEq, Encodable, Decodable, Debug)]
7171
pub enum InlineAttr {
7272
None,
7373
Hint,
7474
Always,
7575
Never,
7676
}
7777

78-
#[derive(Clone, Encodable, Decodable)]
78+
#[derive(Clone, Encodable, Decodable, Debug)]
7979
pub enum InstructionSetAttr {
8080
ArmA32,
8181
ArmT32,
8282
}
8383

84-
#[derive(Clone, Encodable, Decodable)]
84+
#[derive(Clone, Encodable, Decodable, Debug)]
8585
pub enum OptimizeAttr {
8686
None,
8787
Speed,

compiler/rustc_data_structures/src/stable_hasher.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,7 @@ pub fn hash_stable_hashmap<HCX, K, V, R, SK, F>(
552552

553553
/// A vector container that makes sure that its items are hashed in a stable
554554
/// order.
555+
#[derive(Debug)]
555556
pub struct StableVec<T>(Vec<T>);
556557

557558
impl<T> StableVec<T> {

compiler/rustc_data_structures/src/steal.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ use crate::sync::{MappedReadGuard, ReadGuard, RwLock};
2121
/// -- once the value is stolen -- it will never be read from again.
2222
//
2323
// FIXME(#41710): what is the best way to model linear queries?
24+
#[derive(Debug)]
2425
pub struct Steal<T> {
2526
value: RwLock<Option<T>>,
2627
}

compiler/rustc_feature/src/active.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ macro_rules! declare_features {
3636
),+];
3737

3838
/// A set of features to be used by later passes.
39-
#[derive(Clone, Default)]
39+
#[derive(Clone, Default, Debug)]
4040
pub struct Features {
4141
/// `#![feature]` attrs for language features, for error reporting.
4242
pub declared_lang_features: Vec<(Symbol, Span, Option<Symbol>)>,

compiler/rustc_hir/src/lang_items.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ macro_rules! language_item_table {
6767
}
6868
}
6969

70-
#[derive(HashStable_Generic)]
70+
#[derive(HashStable_Generic, Debug)]
7171
pub struct LanguageItems {
7272
/// Mappings from lang items to their possibly found `DefId`s.
7373
/// The index corresponds to the order in `LangItem`.

compiler/rustc_middle/src/hir/map/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,13 @@ fn is_body_owner<'hir>(node: Node<'hir>, hir_id: HirId) -> bool {
8686
}
8787
}
8888

89+
#[derive(Debug)]
8990
pub(super) struct HirOwnerData<'hir> {
9091
pub(super) signature: Option<&'hir Owner<'hir>>,
9192
pub(super) with_bodies: Option<&'hir mut OwnerNodes<'hir>>,
9293
}
9394

95+
#[derive(Debug)]
9496
pub struct IndexedHir<'hir> {
9597
/// The SVH of the local crate.
9698
pub crate_hash: Svh,

compiler/rustc_middle/src/hir/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use rustc_hir::def_id::{LocalDefId, LOCAL_CRATE};
1616
use rustc_hir::*;
1717
use rustc_index::vec::IndexVec;
1818

19+
#[derive(Debug)]
1920
pub struct Owner<'tcx> {
2021
parent: HirId,
2122
node: Node<'tcx>,
@@ -31,12 +32,13 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for Owner<'tcx> {
3132
}
3233
}
3334

34-
#[derive(Clone)]
35+
#[derive(Clone, Debug)]
3536
pub struct ParentedNode<'tcx> {
3637
parent: ItemLocalId,
3738
node: Node<'tcx>,
3839
}
3940

41+
#[derive(Debug)]
4042
pub struct OwnerNodes<'tcx> {
4143
hash: Fingerprint,
4244
nodes: IndexVec<ItemLocalId, Option<ParentedNode<'tcx>>>,

compiler/rustc_middle/src/lint.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use rustc_span::source_map::{DesugaringKind, ExpnKind, MultiSpan};
1212
use rustc_span::{symbol, Span, Symbol, DUMMY_SP};
1313

1414
/// How a lint level was set.
15-
#[derive(Clone, Copy, PartialEq, Eq, HashStable)]
15+
#[derive(Clone, Copy, PartialEq, Eq, HashStable, Debug)]
1616
pub enum LintLevelSource {
1717
/// Lint is at the default level as declared
1818
/// in rustc or a plugin.
@@ -48,11 +48,13 @@ impl LintLevelSource {
4848
/// A tuple of a lint level and its source.
4949
pub type LevelAndSource = (Level, LintLevelSource);
5050

51+
#[derive(Debug)]
5152
pub struct LintLevelSets {
5253
pub list: Vec<LintSet>,
5354
pub lint_cap: Level,
5455
}
5556

57+
#[derive(Debug)]
5658
pub enum LintSet {
5759
CommandLine {
5860
// -A,-W,-D flags, a `Symbol` for the flag itself and `Level` for which
@@ -139,6 +141,7 @@ impl LintLevelSets {
139141
}
140142
}
141143

144+
#[derive(Debug)]
142145
pub struct LintLevelMap {
143146
pub sets: LintLevelSets,
144147
pub id_to_set: FxHashMap<HirId, u32>,

compiler/rustc_middle/src/middle/codegen_fn_attrs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use rustc_attr::{InlineAttr, InstructionSetAttr, OptimizeAttr};
33
use rustc_session::config::SanitizerSet;
44
use rustc_span::symbol::Symbol;
55

6-
#[derive(Clone, TyEncodable, TyDecodable, HashStable)]
6+
#[derive(Clone, TyEncodable, TyDecodable, HashStable, Debug)]
77
pub struct CodegenFnAttrs {
88
pub flags: CodegenFnAttrFlags,
99
/// Parsed representation of the `#[inline]` attribute

compiler/rustc_middle/src/middle/cstore.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ pub struct NativeLib {
9696
pub wasm_import_module: Option<Symbol>,
9797
}
9898

99-
#[derive(Clone, TyEncodable, TyDecodable, HashStable)]
99+
#[derive(Clone, TyEncodable, TyDecodable, HashStable, Debug)]
100100
pub struct ForeignModule {
101101
pub foreign_items: Vec<DefId>,
102102
pub def_id: DefId,

0 commit comments

Comments
 (0)