self.report_unsafe(cx, it.span, "declaration of an `unsafe` trait")
}
- ast::ItemKind::Impl(ast::Unsafety::Unsafe, ..) => {
+ ast::ItemKind::Impl { unsafety: ast::Unsafety::Unsafe, .. } => {
self.report_unsafe(cx, it.span, "implementation of an `unsafe` trait")
}
"a trait"
}
hir::ItemKind::TyAlias(..) => "a type alias",
- hir::ItemKind::Impl(.., Some(ref trait_ref), _, impl_item_refs) => {
+ hir::ItemKind::Impl { of_trait: Some(ref trait_ref), items, .. } => {
// If the trait is private, add the impl items to `private_traits` so they don't get
// reported for missing docs.
let real_trait = trait_ref.path.res.def_id();
match cx.tcx.hir().find(hir_id) {
Some(Node::Item(item)) => {
if let hir::VisibilityKind::Inherited = item.vis.node {
- for impl_item_ref in impl_item_refs {
+ for impl_item_ref in items {
self.private_traits.insert(impl_item_ref.id.hir_id);
}
}
}
declare_lint_pass!(
- /// Check for used feature gates in `INCOMPLETE_FEATURES` in `feature_gate.rs`.
+ /// Check for used feature gates in `INCOMPLETE_FEATURES` in `librustc_feature/active.rs`.
IncompleteFeatures => [INCOMPLETE_FEATURES]
);
// return `Bound::Excluded`. (And we have tests checking that we
// handle the attribute correctly.)
(Bound::Included(lo), _) if lo > 0 => {
- return Some((format!("{} must be non-null", ty), None));
+ return Some((format!("`{}` must be non-null", ty), None));
}
(Bound::Included(_), _) | (_, Bound::Included(_))
if init == InitKind::Uninit =>
{
return Some((
- format!("{} must be initialized inside its custom valid range", ty),
+ format!(
+ "`{}` must be initialized inside its custom valid range",
+ ty,
+ ),
None,
));
}
}
// Now, recurse.
match adt_def.variants.len() {
- 0 => Some((format!("0-variant enums have no valid value"), None)),
+ 0 => Some((format!("enums with no variants have no valid value"), None)),
1 => {
// Struct, or enum with exactly one variant.
// Proceed recursively, check all fields.