Rollup merge of #30420 - petrochenkov:owned2, r=nrc
Part of https://github.com/rust-lang/rust/pull/30095 not causing mysterious segfaults. r? @nrc
This commit is contained in:
commit
9e953df6f0
33 changed files with 400 additions and 413 deletions
|
|
@ -112,7 +112,7 @@ impl<T, U> Clean<U> for ty::Binder<T> where T: Clean<U> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<T: Clean<U>, U> Clean<Vec<U>> for syntax::owned_slice::OwnedSlice<T> {
|
||||
impl<T: Clean<U>, U> Clean<Vec<U>> for P<[T]> {
|
||||
fn clean(&self, cx: &DocContext) -> Vec<U> {
|
||||
self.iter().map(|x| x.clean(cx)).collect()
|
||||
}
|
||||
|
|
@ -1584,8 +1584,13 @@ impl Clean<Type> for hir::Ty {
|
|||
resolve_type(cx, p.clean(cx), self.id)
|
||||
}
|
||||
TyPath(Some(ref qself), ref p) => {
|
||||
let mut trait_path = p.clone();
|
||||
trait_path.segments.pop();
|
||||
let mut segments: Vec<_> = p.segments.clone().into();
|
||||
segments.pop();
|
||||
let trait_path = hir::Path {
|
||||
span: p.span,
|
||||
global: p.global,
|
||||
segments: segments.into(),
|
||||
};
|
||||
Type::QPath {
|
||||
name: p.segments.last().unwrap().identifier.name.clean(cx),
|
||||
self_type: box qself.ty.clean(cx),
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ use rustc_front::hir;
|
|||
|
||||
pub struct Module {
|
||||
pub name: Option<Name>,
|
||||
pub attrs: Vec<ast::Attribute>,
|
||||
pub attrs: hir::HirVec<ast::Attribute>,
|
||||
pub where_outer: Span,
|
||||
pub where_inner: Span,
|
||||
pub extern_crates: Vec<ExternCrate>,
|
||||
|
|
@ -58,7 +58,7 @@ impl Module {
|
|||
depr: None,
|
||||
where_outer: syntax::codemap::DUMMY_SP,
|
||||
where_inner: syntax::codemap::DUMMY_SP,
|
||||
attrs : Vec::new(),
|
||||
attrs : hir::HirVec::new(),
|
||||
extern_crates: Vec::new(),
|
||||
imports : Vec::new(),
|
||||
structs : Vec::new(),
|
||||
|
|
@ -103,8 +103,8 @@ pub struct Struct {
|
|||
pub struct_type: StructType,
|
||||
pub name: Name,
|
||||
pub generics: hir::Generics,
|
||||
pub attrs: Vec<ast::Attribute>,
|
||||
pub fields: Vec<hir::StructField>,
|
||||
pub attrs: hir::HirVec<ast::Attribute>,
|
||||
pub fields: hir::HirVec<hir::StructField>,
|
||||
pub whence: Span,
|
||||
}
|
||||
|
||||
|
|
@ -112,9 +112,9 @@ pub struct Enum {
|
|||
pub vis: hir::Visibility,
|
||||
pub stab: Option<attr::Stability>,
|
||||
pub depr: Option<attr::Deprecation>,
|
||||
pub variants: Vec<Variant>,
|
||||
pub variants: hir::HirVec<Variant>,
|
||||
pub generics: hir::Generics,
|
||||
pub attrs: Vec<ast::Attribute>,
|
||||
pub attrs: hir::HirVec<ast::Attribute>,
|
||||
pub id: NodeId,
|
||||
pub whence: Span,
|
||||
pub name: Name,
|
||||
|
|
@ -122,7 +122,7 @@ pub struct Enum {
|
|||
|
||||
pub struct Variant {
|
||||
pub name: Name,
|
||||
pub attrs: Vec<ast::Attribute>,
|
||||
pub attrs: hir::HirVec<ast::Attribute>,
|
||||
pub def: hir::VariantData,
|
||||
pub stab: Option<attr::Stability>,
|
||||
pub depr: Option<attr::Deprecation>,
|
||||
|
|
@ -131,7 +131,7 @@ pub struct Variant {
|
|||
|
||||
pub struct Function {
|
||||
pub decl: hir::FnDecl,
|
||||
pub attrs: Vec<ast::Attribute>,
|
||||
pub attrs: hir::HirVec<ast::Attribute>,
|
||||
pub id: NodeId,
|
||||
pub name: Name,
|
||||
pub vis: hir::Visibility,
|
||||
|
|
@ -149,7 +149,7 @@ pub struct Typedef {
|
|||
pub gen: hir::Generics,
|
||||
pub name: Name,
|
||||
pub id: ast::NodeId,
|
||||
pub attrs: Vec<ast::Attribute>,
|
||||
pub attrs: hir::HirVec<ast::Attribute>,
|
||||
pub whence: Span,
|
||||
pub vis: hir::Visibility,
|
||||
pub stab: Option<attr::Stability>,
|
||||
|
|
@ -162,7 +162,7 @@ pub struct Static {
|
|||
pub mutability: hir::Mutability,
|
||||
pub expr: P<hir::Expr>,
|
||||
pub name: Name,
|
||||
pub attrs: Vec<ast::Attribute>,
|
||||
pub attrs: hir::HirVec<ast::Attribute>,
|
||||
pub vis: hir::Visibility,
|
||||
pub stab: Option<attr::Stability>,
|
||||
pub depr: Option<attr::Deprecation>,
|
||||
|
|
@ -174,7 +174,7 @@ pub struct Constant {
|
|||
pub type_: P<hir::Ty>,
|
||||
pub expr: P<hir::Expr>,
|
||||
pub name: Name,
|
||||
pub attrs: Vec<ast::Attribute>,
|
||||
pub attrs: hir::HirVec<ast::Attribute>,
|
||||
pub vis: hir::Visibility,
|
||||
pub stab: Option<attr::Stability>,
|
||||
pub depr: Option<attr::Deprecation>,
|
||||
|
|
@ -185,10 +185,10 @@ pub struct Constant {
|
|||
pub struct Trait {
|
||||
pub unsafety: hir::Unsafety,
|
||||
pub name: Name,
|
||||
pub items: Vec<hir::TraitItem>,
|
||||
pub items: hir::HirVec<hir::TraitItem>,
|
||||
pub generics: hir::Generics,
|
||||
pub bounds: Vec<hir::TyParamBound>,
|
||||
pub attrs: Vec<ast::Attribute>,
|
||||
pub bounds: hir::HirVec<hir::TyParamBound>,
|
||||
pub attrs: hir::HirVec<ast::Attribute>,
|
||||
pub id: ast::NodeId,
|
||||
pub whence: Span,
|
||||
pub vis: hir::Visibility,
|
||||
|
|
@ -202,8 +202,8 @@ pub struct Impl {
|
|||
pub generics: hir::Generics,
|
||||
pub trait_: Option<hir::TraitRef>,
|
||||
pub for_: P<hir::Ty>,
|
||||
pub items: Vec<hir::ImplItem>,
|
||||
pub attrs: Vec<ast::Attribute>,
|
||||
pub items: hir::HirVec<hir::ImplItem>,
|
||||
pub attrs: hir::HirVec<ast::Attribute>,
|
||||
pub whence: Span,
|
||||
pub vis: hir::Visibility,
|
||||
pub stab: Option<attr::Stability>,
|
||||
|
|
@ -215,16 +215,16 @@ pub struct DefaultImpl {
|
|||
pub unsafety: hir::Unsafety,
|
||||
pub trait_: hir::TraitRef,
|
||||
pub id: ast::NodeId,
|
||||
pub attrs: Vec<ast::Attribute>,
|
||||
pub attrs: hir::HirVec<ast::Attribute>,
|
||||
pub whence: Span,
|
||||
}
|
||||
|
||||
pub struct Macro {
|
||||
pub name: Name,
|
||||
pub id: ast::NodeId,
|
||||
pub attrs: Vec<ast::Attribute>,
|
||||
pub attrs: hir::HirVec<ast::Attribute>,
|
||||
pub whence: Span,
|
||||
pub matchers: Vec<Span>,
|
||||
pub matchers: hir::HirVec<Span>,
|
||||
pub stab: Option<attr::Stability>,
|
||||
pub depr: Option<attr::Deprecation>,
|
||||
pub imported_from: Option<Name>,
|
||||
|
|
@ -234,14 +234,14 @@ pub struct ExternCrate {
|
|||
pub name: Name,
|
||||
pub path: Option<String>,
|
||||
pub vis: hir::Visibility,
|
||||
pub attrs: Vec<ast::Attribute>,
|
||||
pub attrs: hir::HirVec<ast::Attribute>,
|
||||
pub whence: Span,
|
||||
}
|
||||
|
||||
pub struct Import {
|
||||
pub id: NodeId,
|
||||
pub vis: hir::Visibility,
|
||||
pub attrs: Vec<ast::Attribute>,
|
||||
pub attrs: hir::HirVec<ast::Attribute>,
|
||||
pub node: hir::ViewPath_,
|
||||
pub whence: Span,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ use doctree::*;
|
|||
|
||||
pub struct RustdocVisitor<'a, 'tcx: 'a> {
|
||||
pub module: Module,
|
||||
pub attrs: Vec<ast::Attribute>,
|
||||
pub attrs: hir::HirVec<ast::Attribute>,
|
||||
pub cx: &'a core::DocContext<'a, 'tcx>,
|
||||
pub analysis: Option<&'a core::CrateAnalysis>,
|
||||
view_item_stack: HashSet<ast::NodeId>,
|
||||
|
|
@ -53,7 +53,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
|
|||
stack.insert(ast::CRATE_NODE_ID);
|
||||
RustdocVisitor {
|
||||
module: Module::new(None),
|
||||
attrs: Vec::new(),
|
||||
attrs: hir::HirVec::new(),
|
||||
cx: cx,
|
||||
analysis: analysis,
|
||||
view_item_stack: stack,
|
||||
|
|
@ -157,7 +157,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn visit_mod_contents(&mut self, span: Span, attrs: Vec<ast::Attribute> ,
|
||||
pub fn visit_mod_contents(&mut self, span: Span, attrs: hir::HirVec<ast::Attribute>,
|
||||
vis: hir::Visibility, id: ast::NodeId,
|
||||
m: &hir::Mod,
|
||||
name: Option<ast::Name>) -> Module {
|
||||
|
|
@ -192,7 +192,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
|
|||
let mine = paths.into_iter().filter(|path| {
|
||||
!self.resolve_id(path.node.id(), None, false, om,
|
||||
please_inline)
|
||||
}).collect::<Vec<hir::PathListItem>>();
|
||||
}).collect::<hir::HirVec<hir::PathListItem>>();
|
||||
|
||||
if mine.is_empty() {
|
||||
None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue