Skip to content

Commit c5af061

Browse files
committed
Auto merge of rust-lang#118126 - Nilstrieb:rollup-5ogh896, r=Nilstrieb
Rollup of 7 pull requests Successful merges: - rust-lang#117790 (CFI: Add missing use core::ffi::c_int) - rust-lang#118059 (Explicitly unset $CARGO for compiletest) - rust-lang#118081 (`rustc_ty_utils` cleanups) - rust-lang#118094 (feat: specialize `SpecFromElem` for `()`) - rust-lang#118097 (Update books) - rust-lang#118115 (Fix occurrences of old fn names in comment and tracing) - rust-lang#118121 (`rustc_hir` cleanups) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 85c42b7 + f13f980 commit c5af061

File tree

25 files changed

+177
-510
lines changed

25 files changed

+177
-510
lines changed

compiler/rustc_hir/src/arena.rs

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ macro_rules! arena_types {
55
($macro:path) => (
66
$macro!([
77
// HIR types
8-
[] hir_krate: rustc_hir::Crate<'tcx>,
98
[] asm_template: rustc_ast::InlineAsmTemplatePiece,
109
[] attribute: rustc_ast::Attribute,
1110
[] owner_info: rustc_hir::OwnerInfo<'tcx>,

compiler/rustc_hir/src/def.rs

+7-10
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ use std::array::IntoIter;
1313
use std::fmt::Debug;
1414

1515
/// Encodes if a `DefKind::Ctor` is the constructor of an enum variant or a struct.
16-
#[derive(Clone, Copy, PartialEq, Eq, Encodable, Decodable, Hash, Debug)]
17-
#[derive(HashStable_Generic)]
16+
#[derive(Clone, Copy, PartialEq, Eq, Encodable, Decodable, Hash, Debug, HashStable_Generic)]
1817
pub enum CtorOf {
1918
/// This `DefKind::Ctor` is a synthesized constructor of a tuple or unit struct.
2019
Struct,
@@ -23,8 +22,7 @@ pub enum CtorOf {
2322
}
2423

2524
/// What kind of constructor something is.
26-
#[derive(Clone, Copy, PartialEq, Eq, Encodable, Decodable, Hash, Debug)]
27-
#[derive(HashStable_Generic)]
25+
#[derive(Clone, Copy, PartialEq, Eq, Encodable, Decodable, Hash, Debug, HashStable_Generic)]
2826
pub enum CtorKind {
2927
/// Constructor function automatically created by a tuple struct/variant.
3028
Fn,
@@ -33,8 +31,7 @@ pub enum CtorKind {
3331
}
3432

3533
/// An attribute that is not a macro; e.g., `#[inline]` or `#[rustfmt::skip]`.
36-
#[derive(Clone, Copy, PartialEq, Eq, Encodable, Decodable, Hash, Debug)]
37-
#[derive(HashStable_Generic)]
34+
#[derive(Clone, Copy, PartialEq, Eq, Encodable, Decodable, Hash, Debug, HashStable_Generic)]
3835
pub enum NonMacroAttrKind {
3936
/// Single-segment attribute defined by the language (`#[inline]`)
4037
Builtin(Symbol),
@@ -48,8 +45,7 @@ pub enum NonMacroAttrKind {
4845
}
4946

5047
/// What kind of definition something is; e.g., `mod` vs `struct`.
51-
#[derive(Clone, Copy, PartialEq, Eq, Encodable, Decodable, Hash, Debug)]
52-
#[derive(HashStable_Generic)]
48+
#[derive(Clone, Copy, PartialEq, Eq, Encodable, Decodable, Hash, Debug, HashStable_Generic)]
5349
pub enum DefKind {
5450
// Type namespace
5551
Mod,
@@ -299,8 +295,7 @@ impl DefKind {
299295
/// - the call to `str_to_string` will resolve to [`Res::Def`], with the [`DefId`]
300296
/// pointing to the definition of `str_to_string` in the current crate.
301297
//
302-
#[derive(Clone, Copy, PartialEq, Eq, Encodable, Decodable, Hash, Debug)]
303-
#[derive(HashStable_Generic)]
298+
#[derive(Clone, Copy, PartialEq, Eq, Encodable, Decodable, Hash, Debug, HashStable_Generic)]
304299
pub enum Res<Id = hir::HirId> {
305300
/// Definition having a unique ID (`DefId`), corresponds to something defined in user code.
306301
///
@@ -591,6 +586,8 @@ impl NonMacroAttrKind {
591586
}
592587
}
593588

589+
// Currently trivial, but exists in case a new kind is added in the future whose name starts
590+
// with a vowel.
594591
pub fn article(self) -> &'static str {
595592
"a"
596593
}

0 commit comments

Comments
 (0)