use rustc_span::symbol::{kw, sym, Ident, Symbol};
use rustc_span::{BytePos, InnerSpan, MultiSpan, Span};
use rustc_target::abi::VariantIdx;
-use rustc_trait_selection::traits::misc::can_type_implement_copy;
+use rustc_trait_selection::traits::{self, misc::can_type_implement_copy};
use crate::nonstandard_style::{method_context, MethodLateContext};
if ty.is_copy_modulo_regions(cx.tcx.at(item.span), param_env) {
return;
}
- if can_type_implement_copy(cx.tcx, param_env, ty).is_ok() {
+ if can_type_implement_copy(
+ cx.tcx,
+ param_env,
+ ty,
+ traits::ObligationCause::misc(item.span, item.hir_id()),
+ )
+ .is_ok()
+ {
cx.struct_span_lint(MISSING_COPY_IMPLEMENTATIONS, item.span, |lint| {
lint.build(
"type could implement `Copy`; consider adding `impl \
fn check_generic_param(&mut self, cx: &EarlyContext<'_>, param: &ast::GenericParam) {
warn_if_doc(cx, param.ident.span, "generic parameters", ¶m.attrs);
}
+
+ fn check_block(&mut self, cx: &EarlyContext<'_>, block: &ast::Block) {
+ warn_if_doc(cx, block.span, "block", &block.attrs());
+ }
+
+ fn check_item(&mut self, cx: &EarlyContext<'_>, item: &ast::Item) {
+ if let ast::ItemKind::ForeignMod(_) = item.kind {
+ warn_if_doc(cx, item.span, "extern block", &item.attrs);
+ }
+ }
}
declare_lint! {