Skip to content

Commit 8cebb1f

Browse files
committed
Rename raw_pointer_deriving lint to raw_pointer_derive
Due to the `#[deriving]` -> `#[derive]` switch.
1 parent c6c7866 commit 8cebb1f

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

src/librustc/lint/builtin.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -550,20 +550,20 @@ impl LintPass for BoxPointers {
550550
}
551551

552552
declare_lint! {
553-
RAW_POINTER_DERIVING,
553+
RAW_POINTER_DERIVE,
554554
Warn,
555555
"uses of #[derive] with raw pointers are rarely correct"
556556
}
557557

558-
struct RawPtrDerivingVisitor<'a, 'tcx: 'a> {
558+
struct RawPtrDeriveVisitor<'a, 'tcx: 'a> {
559559
cx: &'a Context<'a, 'tcx>
560560
}
561561

562-
impl<'a, 'tcx, 'v> Visitor<'v> for RawPtrDerivingVisitor<'a, 'tcx> {
562+
impl<'a, 'tcx, 'v> Visitor<'v> for RawPtrDeriveVisitor<'a, 'tcx> {
563563
fn visit_ty(&mut self, ty: &ast::Ty) {
564564
static MSG: &'static str = "use of `#[derive]` with a raw pointer";
565565
if let ast::TyPtr(..) = ty.node {
566-
self.cx.span_lint(RAW_POINTER_DERIVING, ty.span, MSG);
566+
self.cx.span_lint(RAW_POINTER_DERIVE, ty.span, MSG);
567567
}
568568
visit::walk_ty(self, ty);
569569
}
@@ -572,21 +572,21 @@ impl<'a, 'tcx, 'v> Visitor<'v> for RawPtrDerivingVisitor<'a, 'tcx> {
572572
fn visit_block(&mut self, _: &ast::Block) {}
573573
}
574574

575-
pub struct RawPointerDeriving {
575+
pub struct RawPointerDerive {
576576
checked_raw_pointers: NodeSet,
577577
}
578578

579-
impl RawPointerDeriving {
580-
pub fn new() -> RawPointerDeriving {
581-
RawPointerDeriving {
579+
impl RawPointerDerive {
580+
pub fn new() -> RawPointerDerive {
581+
RawPointerDerive {
582582
checked_raw_pointers: NodeSet::new(),
583583
}
584584
}
585585
}
586586

587-
impl LintPass for RawPointerDeriving {
587+
impl LintPass for RawPointerDerive {
588588
fn get_lints(&self) -> LintArray {
589-
lint_array!(RAW_POINTER_DERIVING)
589+
lint_array!(RAW_POINTER_DERIVE)
590590
}
591591

592592
fn check_item(&mut self, cx: &Context, item: &ast::Item) {
@@ -611,7 +611,7 @@ impl LintPass for RawPointerDeriving {
611611
if !self.checked_raw_pointers.insert(item.id) { return }
612612
match item.node {
613613
ast::ItemStruct(..) | ast::ItemEnum(..) => {
614-
let mut visitor = RawPtrDerivingVisitor { cx: cx };
614+
let mut visitor = RawPtrDeriveVisitor { cx: cx };
615615
visit::walk_item(&mut visitor, &*item);
616616
}
617617
_ => {}

src/librustc/lint/context.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ impl LintStore {
208208

209209
add_builtin_with_new!(sess,
210210
TypeLimits,
211-
RawPointerDeriving,
211+
RawPointerDerive,
212212
MissingDoc,
213213
);
214214

@@ -247,6 +247,7 @@ impl LintStore {
247247
self.register_renamed("unknown_crate_type", "unknown_crate_types");
248248
self.register_renamed("variant_size_difference", "variant_size_differences");
249249
self.register_renamed("transmute_fat_ptr", "fat_ptr_transmutes");
250+
self.register_renamed("raw_pointer_deriving", "raw_pointer_derive");
250251

251252
}
252253

src/test/compile-fail/lint-raw-ptr-deriving.rs renamed to src/test/compile-fail/lint-raw-ptr-derive.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
#![allow(dead_code)]
12-
#![deny(raw_pointer_deriving)]
12+
#![deny(raw_pointer_derive)]
1313

1414
#[derive(Clone)]
1515
struct Foo {

0 commit comments

Comments
 (0)