Skip to content

Rollup of 13 pull requests #84477

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 40 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
30fc601
Tests for field is never read diagnostic
sunjay Mar 11, 2021
321aace
Added suggestion and note for when a field is never used
sunjay Mar 12, 2021
7faaf39
Updating test stderr files
sunjay Mar 12, 2021
789186d
Trying out a new message that works a little better for values *and* …
sunjay Mar 12, 2021
2acd8eb
New shorter diagnostic note that is different for items versus fields
sunjay Mar 13, 2021
3e34eb8
Putting help message only under the identifier that needs to be prefixed
sunjay Mar 25, 2021
53a1105
On stable, suggest removing `#![feature]` for features that have been…
jyn514 Mar 31, 2021
37a5b51
implement TrustedRandomAccess for Take iterator adapter
the8472 Apr 8, 2021
03900e4
move core::hint::black_box under its own feature gate
RalfJung Apr 15, 2021
259a368
fix name resolution for param defaults
lcnr Apr 18, 2021
7cb1dcd
loosen ordering restricts for `const_generics_defaults`
lcnr Apr 18, 2021
312b4fd
improve wf check for const param defaults
lcnr Apr 18, 2021
d3e0d2f
supply substs to anon consts in defaults
lcnr Apr 18, 2021
5d9eeff
Ensure TLS destructors run before thread joins in SGX
mzohreva Apr 21, 2021
9cabbd0
Move `sys_common::poison` to `sync::poison`
CDirkx Apr 21, 2021
3794fc9
Clean up .gitignore
CDirkx Apr 20, 2021
c0d05d2
Remove "Version control"
CDirkx Apr 20, 2021
bfbf4ce
doc/platform-support: clarify UEFI support
dvdhrm Apr 22, 2021
a03cba3
Prevent control, shift and alt keys to make search input lose focus
GuillaumeGomez Apr 22, 2021
c247055
Get rid of "[+] show undocumented items" toggle on numeric From impls
notriddle Apr 22, 2021
a07bf2e
Fix ICE if original_span(fn_sig) returns a span not in body sourcefile
richkadel Apr 22, 2021
e1d9b3c
Take ItemType instead of TypeKind in record_extern_fqn
jyn514 Apr 23, 2021
3170536
Use ItemType in cache
jyn514 Apr 23, 2021
2df886d
Remove `TypeKind`
jyn514 Apr 23, 2021
26f2705
Remove unused `impl Clean<ItemType> for DefKind`
jyn514 Apr 23, 2021
a344282
Don't repeat `hir::def::DefKind` so much
jyn514 Apr 23, 2021
6c066ab
Fix macro bug in `impl From<DefKind> for ItemType`
jyn514 Apr 23, 2021
c1436c6
Rollup merge of #83004 - sunjay:field-never-read-issue-81658, r=pnkfelix
Dylan-DPC Apr 23, 2021
14bbf69
Rollup merge of #83722 - jyn514:stable-help, r=estebank
Dylan-DPC Apr 23, 2021
18523ee
Rollup merge of #83990 - the8472:take-trusted-len, r=dtolnay
Dylan-DPC Apr 23, 2021
6ed8462
Rollup merge of #84216 - RalfJung:black-box, r=Mark-Simulacrum
Dylan-DPC Apr 23, 2021
9cf575a
Rollup merge of #84299 - lcnr:const-generics-defaults-name-res, r=varkor
Dylan-DPC Apr 23, 2021
096bb93
Rollup merge of #84374 - CDirkx:gitignore, r=Mark-Simulacrum
Dylan-DPC Apr 23, 2021
4a63cad
Rollup merge of #84387 - CDirkx:poison, r=m-ou-se
Dylan-DPC Apr 23, 2021
51f90fb
Rollup merge of #84409 - mzohreva:mz/tls-dtors-before-join, r=dtolnay
Dylan-DPC Apr 23, 2021
35cda5b
Rollup merge of #84430 - dvdhrm:rw/uefidoc, r=Amanieu
Dylan-DPC Apr 23, 2021
1ab01e8
Rollup merge of #84433 - GuillaumeGomez:search-input-blur, r=jsha
Dylan-DPC Apr 23, 2021
156294b
Rollup merge of #84444 - notriddle:num-docs-from-undocumented-items-t…
Dylan-DPC Apr 23, 2021
9bad270
Rollup merge of #84456 - richkadel:issue-84421, r=tmandry
Dylan-DPC Apr 23, 2021
72d5ed0
Rollup merge of #84464 - jyn514:type-kind, r=CraftSpider
Dylan-DPC Apr 23, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Don't repeat hir::def::DefKind so much
  • Loading branch information
jyn514 committed Apr 23, 2021
commit a34428203a79f7f14cd471c09e8b5814bbffdb76
66 changes: 33 additions & 33 deletions src/librustdoc/formats/item_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::fmt;

use serde::{Serialize, Serializer};

use rustc_hir as hir;
use rustc_hir::def::DefKind;
use rustc_span::hygiene::MacroKind;

use crate::clean;
Expand Down Expand Up @@ -103,39 +103,39 @@ impl<'a> From<&'a clean::Item> for ItemType {
}
}

impl From<hir::def::DefKind> for ItemType {
fn from(other: hir::def::DefKind) -> Self {
impl From<DefKind> for ItemType {
fn from(other: DefKind) -> Self {
match other {
hir::def::DefKind::Enum => Self::Enum,
hir::def::DefKind::Fn => Self::Function,
hir::def::DefKind::Mod => Self::Module,
hir::def::DefKind::Const => Self::Constant,
hir::def::DefKind::Static => Self::Static,
hir::def::DefKind::Struct => Self::Struct,
hir::def::DefKind::Union => Self::Union,
hir::def::DefKind::Trait => Self::Trait,
hir::def::DefKind::TyAlias => Self::Typedef,
hir::def::DefKind::TraitAlias => Self::TraitAlias,
hir::def::DefKind::Macro(_) => Self::Macro,
hir::def::DefKind::ForeignTy
| hir::def::DefKind::Variant
| hir::def::DefKind::AssocTy
| hir::def::DefKind::TyParam
| hir::def::DefKind::ConstParam
| hir::def::DefKind::Ctor(..)
| hir::def::DefKind::AssocFn
| hir::def::DefKind::AssocConst
| hir::def::DefKind::ExternCrate
| hir::def::DefKind::Use
| hir::def::DefKind::ForeignMod
| hir::def::DefKind::AnonConst
| hir::def::DefKind::OpaqueTy
| hir::def::DefKind::Field
| hir::def::DefKind::LifetimeParam
| hir::def::DefKind::GlobalAsm
| hir::def::DefKind::Impl
| hir::def::DefKind::Closure
| hir::def::DefKind::Generator => Self::ForeignType,
DefKind::Enum => Self::Enum,
DefKind::Fn => Self::Function,
DefKind::Mod => Self::Module,
DefKind::Const => Self::Constant,
DefKind::Static => Self::Static,
DefKind::Struct => Self::Struct,
DefKind::Union => Self::Union,
DefKind::Trait => Self::Trait,
DefKind::TyAlias => Self::Typedef,
DefKind::TraitAlias => Self::TraitAlias,
DefKind::Macro(_) => Self::Macro,
DefKind::ForeignTy
| DefKind::Variant
| DefKind::AssocTy
| DefKind::TyParam
| DefKind::ConstParam
| DefKind::Ctor(..)
| DefKind::AssocFn
| DefKind::AssocConst
| DefKind::ExternCrate
| DefKind::Use
| DefKind::ForeignMod
| DefKind::AnonConst
| DefKind::OpaqueTy
| DefKind::Field
| DefKind::LifetimeParam
| DefKind::GlobalAsm
| DefKind::Impl
| DefKind::Closure
| DefKind::Generator => Self::ForeignType,
}
}
}
Expand Down