Skip to content

Commit

Permalink
Rollup merge of rust-lang#65155 - Avi-D-coder:fix-lints, r=Mark-Simul…
Browse files Browse the repository at this point in the history
…acrum

Use shorthand initialization in rustdoc

This just fixes a few lints I rust-analyzer was showing. Is this sort of PR useful? Should the lints be fixed as apart of the otherwise unrelated PR I was working on?
  • Loading branch information
tmandry committed Oct 6, 2019
2 parents c4bbc6d + c087111 commit c071083
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions src/librustdoc/clean/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ pub fn krate(mut cx: &mut DocContext<'_>) -> Crate {
Item {
source: Span::empty(),
name: Some(kw.clone()),
attrs: attrs,
attrs,
visibility: Public,
stability: get_stability(cx, def_id),
deprecation: get_deprecation(cx, def_id),
Expand Down Expand Up @@ -1570,7 +1570,7 @@ impl Clean<GenericParamDef> for hir::GenericParam {
did: cx.tcx.hir().local_def_id(self.hir_id),
bounds: self.bounds.clean(cx),
default: default.clean(cx),
synthetic: synthetic,
synthetic,
})
}
hir::GenericParamKind::Const { ref ty } => {
Expand Down Expand Up @@ -2213,7 +2213,7 @@ impl Clean<Item> for doctree::Trait<'_> {
let is_spotlight = attrs.has_doc_flag(sym::spotlight);
Item {
name: Some(self.name.clean(cx)),
attrs: attrs,
attrs,
source: self.whence.clean(cx),
def_id: cx.tcx.hir().local_def_id(self.id),
visibility: self.vis.clean(cx),
Expand Down Expand Up @@ -2844,7 +2844,7 @@ impl Clean<Type> for hir::Ty {
} else {
Some(l.clean(cx))
};
BorrowedRef {lifetime: lifetime, mutability: m.mutbl.clean(cx),
BorrowedRef {lifetime, mutability: m.mutbl.clean(cx),
type_: box m.ty.clean(cx)}
}
TyKind::Slice(ref ty) => Slice(box ty.clean(cx)),
Expand Down Expand Up @@ -3102,9 +3102,9 @@ impl<'tcx> Clean<Type> for Ty<'tcx> {
let path = external_path(cx, cx.tcx.item_name(did),
None, false, vec![], InternalSubsts::empty());
ResolvedPath {
path: path,
path,
param_names: None,
did: did,
did,
is_generic: false,
}
}
Expand Down Expand Up @@ -4274,7 +4274,7 @@ fn resolve_type(cx: &DocContext<'_>,
_ => false,
};
let did = register_res(&*cx, path.res);
ResolvedPath { path: path, param_names: None, did: did, is_generic: is_generic }
ResolvedPath { path, param_names: None, did, is_generic }
}

pub fn register_res(cx: &DocContext<'_>, res: Res) -> DefId {
Expand Down
4 changes: 2 additions & 2 deletions src/librustdoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,8 +486,8 @@ where R: 'static + Send,
krate.version = crate_version;

f(Output {
krate: krate,
renderinfo: renderinfo,
krate,
renderinfo,
renderopts,
})
});
Expand Down

0 comments on commit c071083

Please sign in to comment.