From 6474de904c1aca3a6eb131edc0e4e869ecabeb90 Mon Sep 17 00:00:00 2001 From: Andy Russell Date: Sun, 16 Dec 2018 22:21:47 -0500 Subject: make non_camel_case_types an early lint --- src/test/ui/methods/auxiliary/ambig_impl_2_lib.rs | 4 ++-- src/test/ui/methods/method-ambig-one-trait-unknown-int-type.rs | 8 ++++---- src/test/ui/methods/method-ambig-two-traits-cross-crate.rs | 6 +++--- src/test/ui/methods/method-ambig-two-traits-cross-crate.stderr | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src/test/ui/methods') diff --git a/src/test/ui/methods/auxiliary/ambig_impl_2_lib.rs b/src/test/ui/methods/auxiliary/ambig_impl_2_lib.rs index 4ba0ccdba9b..f505994a52e 100644 --- a/src/test/ui/methods/auxiliary/ambig_impl_2_lib.rs +++ b/src/test/ui/methods/auxiliary/ambig_impl_2_lib.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub trait me { +pub trait Me { fn me(&self) -> usize; } -impl me for usize { fn me(&self) -> usize { *self } } +impl Me for usize { fn me(&self) -> usize { *self } } diff --git a/src/test/ui/methods/method-ambig-one-trait-unknown-int-type.rs b/src/test/ui/methods/method-ambig-one-trait-unknown-int-type.rs index 9acf5a52166..c77b589d32f 100644 --- a/src/test/ui/methods/method-ambig-one-trait-unknown-int-type.rs +++ b/src/test/ui/methods/method-ambig-one-trait-unknown-int-type.rs @@ -8,19 +8,19 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// Test that we invoking `foo()` successfully resolves to the trait `foo` +// Test that we invoking `foo()` successfully resolves to the trait `Foo` // (prompting the mismatched types error) but does not influence the choice // of what kind of `Vec` we have, eventually leading to a type error. -trait foo { +trait Foo { fn foo(&self) -> isize; } -impl foo for Vec { +impl Foo for Vec { fn foo(&self) -> isize {1} } -impl foo for Vec { +impl Foo for Vec { fn foo(&self) -> isize {2} } diff --git a/src/test/ui/methods/method-ambig-two-traits-cross-crate.rs b/src/test/ui/methods/method-ambig-two-traits-cross-crate.rs index c1d4551fd9e..24b42333c4f 100644 --- a/src/test/ui/methods/method-ambig-two-traits-cross-crate.rs +++ b/src/test/ui/methods/method-ambig-two-traits-cross-crate.rs @@ -13,9 +13,9 @@ // aux-build:ambig_impl_2_lib.rs extern crate ambig_impl_2_lib; -use ambig_impl_2_lib::me; -trait me2 { +use ambig_impl_2_lib::Me; +trait Me2 { fn me(&self) -> usize; } -impl me2 for usize { fn me(&self) -> usize { *self } } +impl Me2 for usize { fn me(&self) -> usize { *self } } fn main() { 1_usize.me(); } //~ ERROR E0034 diff --git a/src/test/ui/methods/method-ambig-two-traits-cross-crate.stderr b/src/test/ui/methods/method-ambig-two-traits-cross-crate.stderr index 7a75f20f65a..35e918f258d 100644 --- a/src/test/ui/methods/method-ambig-two-traits-cross-crate.stderr +++ b/src/test/ui/methods/method-ambig-two-traits-cross-crate.stderr @@ -4,12 +4,12 @@ error[E0034]: multiple applicable items in scope LL | fn main() { 1_usize.me(); } //~ ERROR E0034 | ^^ multiple `me` found | -note: candidate #1 is defined in an impl of the trait `me2` for the type `usize` +note: candidate #1 is defined in an impl of the trait `Me2` for the type `usize` --> $DIR/method-ambig-two-traits-cross-crate.rs:20:22 | -LL | impl me2 for usize { fn me(&self) -> usize { *self } } +LL | impl Me2 for usize { fn me(&self) -> usize { *self } } | ^^^^^^^^^^^^^^^^^^^^^ - = note: candidate #2 is defined in an impl of the trait `ambig_impl_2_lib::me` for the type `usize` + = note: candidate #2 is defined in an impl of the trait `ambig_impl_2_lib::Me` for the type `usize` error: aborting due to previous error -- cgit 1.4.1-3-g733a5