#[cfg(target_os = "win32", target_arch = "x86")]
#[link(name = "kernel32")]
-#[allow(non_snake_case_functions)]
+#[allow(non_snake_case)]
extern "stdcall" {
fn SetEnvironmentVariableA(n: *const u8, v: *const u8) -> libc::c_int;
}
// NOTE: The following code was generated by "src/etc/unicode.py", do not edit directly
-#![allow(missing_doc, non_uppercase_statics, non_snake_case_functions)]
+#![allow(missing_doc, non_uppercase_statics, non_snake_case)]
'''
# Mapping taken from Table 12 from:
impl<S: Writer, $($name: Hash<S>),*> Hash<S> for ($($name,)*) {
#[allow(uppercase_variables)]
#[inline]
+ #[allow(non_snake_case)]
fn hash(&self, state: &mut S) {
match *self {
($(ref $name,)*) => {
//!
//! For more details, see ::unicode::char (a.k.a. std::char)
-#![allow(non_snake_case_functions)]
+#![allow(non_snake_case)]
#![doc(primitive = "char")]
use mem::transmute;
() => ();
( $($name:ident,)+ ) => (
impl<$($name:Show),*> Show for ($($name,)*) {
- #[allow(uppercase_variables, dead_assignment)]
+ #[allow(non_snake_case, dead_assignment)]
fn fmt(&self, f: &mut Formatter) -> Result {
try!(write!(f, "("));
let ($(ref $name,)*) = *self;
fn next(&mut self, haystack: &[u8], needle: &[u8]) -> Option<(uint, uint)> {
while self.position + needle.len() <= haystack.len() {
if haystack.slice(self.position, self.position + needle.len()) == needle {
- let matchPos = self.position;
+ let match_pos = self.position;
self.position += needle.len(); // add 1 for all matches
- return Some((matchPos, matchPos + needle.len()));
+ return Some((match_pos, match_pos + needle.len()));
} else {
self.position += 1;
}
#[deriving(Clone)]
struct TwoWaySearcher {
// constants
- critPos: uint,
+ crit_pos: uint,
period: uint,
byteset: u64,
// Crochemore, M., Perrin, D., 1991, Two-way string-matching, Journal of the ACM 38(3):651-675.
impl TwoWaySearcher {
fn new(needle: &[u8]) -> TwoWaySearcher {
- let (critPos1, period1) = TwoWaySearcher::maximal_suffix(needle, false);
- let (critPos2, period2) = TwoWaySearcher::maximal_suffix(needle, true);
+ let (crit_pos1, period1) = TwoWaySearcher::maximal_suffix(needle, false);
+ let (crit_pos2, period2) = TwoWaySearcher::maximal_suffix(needle, true);
- let critPos;
+ let crit_pos;
let period;
- if critPos1 > critPos2 {
- critPos = critPos1;
+ if crit_pos1 > crit_pos2 {
+ crit_pos = crit_pos1;
period = period1;
} else {
- critPos = critPos2;
+ crit_pos = crit_pos2;
period = period2;
}
let byteset = needle.iter()
.fold(0, |a, &b| (1 << ((b & 0x3f) as uint)) | a);
-
- // The logic here (calculating critPos and period, the final if statement to see which
+ // The logic here (calculating crit_pos and period, the final if statement to see which
// period to use for the TwoWaySearcher) is essentially an implementation of the
// "small-period" function from the paper (p. 670)
//
- // In the paper they check whether `needle.slice_to(critPos)` is a suffix of
- // `needle.slice(critPos, critPos + period)`, which is precisely what this does
- if needle.slice_to(critPos) == needle.slice(period, period + critPos) {
+ // In the paper they check whether `needle.slice_to(crit_pos)` is a suffix of
+ // `needle.slice(crit_pos, crit_pos + period)`, which is precisely what this does
+ if needle.slice_to(crit_pos) == needle.slice(period, period + crit_pos) {
TwoWaySearcher {
- critPos: critPos,
+ crit_pos: crit_pos,
period: period,
byteset: byteset,
}
} else {
TwoWaySearcher {
- critPos: critPos,
- period: cmp::max(critPos, needle.len() - critPos) + 1,
+ crit_pos: crit_pos,
+ period: cmp::max(crit_pos, needle.len() - crit_pos) + 1,
byteset: byteset,
position: 0,
}
#[inline]
- fn next(&mut self, haystack: &[u8], needle: &[u8], longPeriod: bool) -> Option<(uint, uint)> {
+ fn next(&mut self, haystack: &[u8], needle: &[u8], long_period: bool) -> Option<(uint, uint)> {
'search: loop {
// Check that we have room to search in
if self.position + needle.len() > haystack.len() {
}
// See if the right part of the needle matches
- let start = if longPeriod { self.critPos } else { cmp::max(self.critPos, self.memory) };
+ let start = if long_period { self.crit_pos }
+ else { cmp::max(self.crit_pos, self.memory) };
for i in range(start, needle.len()) {
if needle[i] != haystack[self.position + i] {
- self.position += i - self.critPos + 1;
- if !longPeriod {
+ self.position += i - self.crit_pos + 1;
+ if !long_period {
self.memory = 0;
}
continue 'search;
}
// See if the left part of the needle matches
- let start = if longPeriod { 0 } else { self.memory };
- for i in range(start, self.critPos).rev() {
+ let start = if long_period { 0 } else { self.memory };
+ for i in range(start, self.crit_pos).rev() {
if needle[i] != haystack[self.position + i] {
self.position += self.period;
- if !longPeriod {
+ if !long_period {
self.memory = needle.len() - self.period;
}
continue 'search;
}
// We have found a match!
- let matchPos = self.position;
+ let match_pos = self.position;
self.position += needle.len(); // add self.period for all matches
- if !longPeriod {
+ if !long_period {
self.memory = 0; // set to needle.len() - self.period for all matches
}
- return Some((matchPos, matchPos + needle.len()));
+ return Some((match_pos, match_pos + needle.len()));
}
}
*/
#![allow(non_camel_case_types)]
-#![allow(non_snake_case_functions)]
+#![allow(non_snake_case)]
#![allow(non_uppercase_statics)]
#![allow(missing_doc)]
-#![allow(uppercase_variables)]
+#![allow(non_snake_case)]
#[cfg(test)] extern crate std;
#[cfg(test)] extern crate test;
//! play. The only dependencies of these modules are the normal system libraries
//! that you would find on the respective platform.
-#![allow(non_snake_case_functions)]
+#![allow(non_snake_case)]
use libc::c_int;
use libc;
#[cfg(unix)]
fn translate_status(status: c_int) -> rtio::ProcessExit {
- #![allow(non_snake_case_functions)]
+ #![allow(non_snake_case)]
#[cfg(target_os = "linux")]
#[cfg(target_os = "android")]
mod imp {
pub static ZERO_BIG_DIGIT: BigDigit = 0;
static ZERO_VEC: [BigDigit, ..1] = [ZERO_BIG_DIGIT];
+#[allow(non_snake_case)]
pub mod BigDigit {
use super::BigDigit;
use super::DoubleBigDigit;
#[cfg(test)]
mod bench {
- #![allow(non_snake_case_functions)]
+ #![allow(non_snake_case)]
use test::Bencher;
use super::reader;
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(non_snake_case_functions)]
+#![allow(non_snake_case)]
use std::rand::{Rng, task_rng};
use stdtest::Bencher;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![allow(non_snake_case)]
+
register_diagnostic!(E0001, r##"
This error suggests that the expression arm corresponding to the noted pattern
will never be reached as for all possible values of the expression being matched,
}
declare_lint!(NON_CAMEL_CASE_TYPES, Warn,
- "types, variants and traits should have camel case names")
+ "types, variants, traits and type parameters should have camel case names")
pub struct NonCamelCaseTypes;
-impl LintPass for NonCamelCaseTypes {
- fn get_lints(&self) -> LintArray {
- lint_array!(NON_CAMEL_CASE_TYPES)
- }
-
- fn check_item(&mut self, cx: &Context, it: &ast::Item) {
+impl NonCamelCaseTypes {
+ fn check_case(&self, cx: &Context, sort: &str, ident: ast::Ident, span: Span) {
fn is_camel_case(ident: ast::Ident) -> bool {
let ident = token::get_ident(ident);
- assert!(!ident.get().is_empty());
+ if ident.get().is_empty() { return true; }
let ident = ident.get().trim_chars('_');
// start with a non-lowercase letter rather than non-uppercase
)).collect()
}
- fn check_case(cx: &Context, sort: &str, ident: ast::Ident, span: Span) {
- let s = token::get_ident(ident);
+ let s = token::get_ident(ident);
- if !is_camel_case(ident) {
- let c = to_camel_case(s.get());
- let m = if c.is_empty() {
- format!("{} `{}` should have a camel case name such as `CamelCase`", sort, s)
- } else {
- format!("{} `{}` should have a camel case name such as `{}`", sort, s, c)
- };
- cx.span_lint(NON_CAMEL_CASE_TYPES, span, m.as_slice());
- }
+ if !is_camel_case(ident) {
+ let c = to_camel_case(s.get());
+ let m = if c.is_empty() {
+ format!("{} `{}` should have a camel case name such as `CamelCase`", sort, s)
+ } else {
+ format!("{} `{}` should have a camel case name such as `{}`", sort, s, c)
+ };
+ cx.span_lint(NON_CAMEL_CASE_TYPES, span, m.as_slice());
}
+ }
+}
+
+impl LintPass for NonCamelCaseTypes {
+ fn get_lints(&self) -> LintArray {
+ lint_array!(NON_CAMEL_CASE_TYPES)
+ }
+ fn check_item(&mut self, cx: &Context, it: &ast::Item) {
let has_extern_repr = it.attrs.iter().map(|attr| {
attr::find_repr_attrs(cx.tcx.sess.diagnostic(), attr).iter()
.any(|r| r == &attr::ReprExtern)
match it.node {
ast::ItemTy(..) | ast::ItemStruct(..) => {
- check_case(cx, "type", it.ident, it.span)
+ self.check_case(cx, "type", it.ident, it.span)
}
ast::ItemTrait(..) => {
- check_case(cx, "trait", it.ident, it.span)
+ self.check_case(cx, "trait", it.ident, it.span)
}
ast::ItemEnum(ref enum_definition, _) => {
if has_extern_repr { return }
- check_case(cx, "type", it.ident, it.span);
+ self.check_case(cx, "type", it.ident, it.span);
for variant in enum_definition.variants.iter() {
- check_case(cx, "variant", variant.node.name, variant.span);
+ self.check_case(cx, "variant", variant.node.name, variant.span);
}
}
_ => ()
}
}
+
+ fn check_generics(&mut self, cx: &Context, it: &ast::Generics) {
+ for gen in it.ty_params.iter() {
+ self.check_case(cx, "type parameter", gen.ident, gen.span);
+ }
+ }
}
#[deriving(PartialEq)]
}
}
-declare_lint!(NON_SNAKE_CASE_FUNCTIONS, Warn,
- "methods and functions should have snake case names")
+declare_lint!(NON_SNAKE_CASE, Warn,
+ "methods, functions, lifetime parameters and modules should have snake case names")
-pub struct NonSnakeCaseFunctions;
+pub struct NonSnakeCase;
-impl NonSnakeCaseFunctions {
+impl NonSnakeCase {
fn check_snake_case(&self, cx: &Context, sort: &str, ident: ast::Ident, span: Span) {
fn is_snake_case(ident: ast::Ident) -> bool {
let ident = token::get_ident(ident);
- assert!(!ident.get().is_empty());
- let ident = ident.get().trim_chars('_');
+ if ident.get().is_empty() { return true; }
+ let ident = ident.get().trim_left_chars('\'');
+ let ident = ident.trim_chars('_');
let mut allow_underscore = true;
ident.chars().all(|c| {
let mut buf = String::new();
if s.is_empty() { continue; }
for ch in s.chars() {
- if !buf.is_empty() && ch.is_uppercase() {
+ if !buf.is_empty() && buf.as_slice() != "'" && ch.is_uppercase() {
words.push(buf);
buf = String::new();
}
let s = token::get_ident(ident);
if !is_snake_case(ident) {
- cx.span_lint(NON_SNAKE_CASE_FUNCTIONS, span,
+ cx.span_lint(NON_SNAKE_CASE, span,
format!("{} `{}` should have a snake case name such as `{}`",
sort, s, to_snake_case(s.get())).as_slice());
}
}
}
-impl LintPass for NonSnakeCaseFunctions {
+impl LintPass for NonSnakeCase {
fn get_lints(&self) -> LintArray {
- lint_array!(NON_SNAKE_CASE_FUNCTIONS)
+ lint_array!(NON_SNAKE_CASE)
}
fn check_fn(&mut self, cx: &Context,
}
}
+ fn check_item(&mut self, cx: &Context, it: &ast::Item) {
+ match it.node {
+ ast::ItemMod(_) => {
+ self.check_snake_case(cx, "module", it.ident, it.span);
+ }
+ _ => {}
+ }
+ }
+
fn check_ty_method(&mut self, cx: &Context, t: &ast::TypeMethod) {
self.check_snake_case(cx, "trait method", t.ident, t.span);
}
+
+ fn check_lifetime_decl(&mut self, cx: &Context, t: &ast::Lifetime) {
+ self.check_snake_case(cx, "lifetime", t.name.ident(), t.span);
+ }
+
+ fn check_pat(&mut self, cx: &Context, p: &ast::Pat) {
+ match &p.node {
+ &ast::PatIdent(_, ref path1, _) => {
+ match cx.tcx.def_map.borrow().find(&p.id) {
+ Some(&def::DefLocal(_, _)) | Some(&def::DefBinding(_, _)) |
+ Some(&def::DefArg(_, _)) => {
+ self.check_snake_case(cx, "variable", path1.node, p.span);
+ }
+ _ => {}
+ }
+ }
+ _ => {}
+ }
+ }
+
+ fn check_struct_def(&mut self, cx: &Context, s: &ast::StructDef,
+ _: ast::Ident, _: &ast::Generics, _: ast::NodeId) {
+ for sf in s.fields.iter() {
+ match sf.node {
+ ast::StructField_ { kind: ast::NamedField(ident, _), .. } => {
+ self.check_snake_case(cx, "structure field", ident, sf.span);
+ }
+ _ => {}
+ }
+ }
+ }
}
declare_lint!(NON_UPPERCASE_STATICS, Allow,
_ => {}
}
}
-}
-
-declare_lint!(NON_UPPERCASE_PATTERN_STATICS, Warn,
- "static constants in match patterns should be all caps")
-
-pub struct NonUppercasePatternStatics;
-
-impl LintPass for NonUppercasePatternStatics {
- fn get_lints(&self) -> LintArray {
- lint_array!(NON_UPPERCASE_PATTERN_STATICS)
- }
fn check_pat(&mut self, cx: &Context, p: &ast::Pat) {
// Lint for constants that look like binding identifiers (#7526)
(&ast::PatIdent(_, ref path1, _), Some(&def::DefStatic(_, false))) => {
let s = token::get_ident(path1.node);
if s.get().chars().any(|c| c.is_lowercase()) {
- cx.span_lint(NON_UPPERCASE_PATTERN_STATICS, path1.span,
+ cx.span_lint(NON_UPPERCASE_STATICS, path1.span,
format!("static constant in pattern `{}` should have an uppercase \
name such as `{}`",
s.get(), s.get().chars().map(|c| c.to_uppercase())
}
}
-declare_lint!(UPPERCASE_VARIABLES, Warn,
- "variable and structure field names should start with a lowercase character")
-
-pub struct UppercaseVariables;
-
-impl LintPass for UppercaseVariables {
- fn get_lints(&self) -> LintArray {
- lint_array!(UPPERCASE_VARIABLES)
- }
-
- fn check_pat(&mut self, cx: &Context, p: &ast::Pat) {
- match &p.node {
- &ast::PatIdent(_, ref path1, _) => {
- match cx.tcx.def_map.borrow().find(&p.id) {
- Some(&def::DefLocal(_, _)) | Some(&def::DefBinding(_, _)) |
- Some(&def::DefArg(_, _)) => {
- let s = token::get_ident(path1.node);
- if s.get().len() > 0 && s.get().char_at(0).is_uppercase() {
- cx.span_lint(UPPERCASE_VARIABLES, path1.span,
- "variable names should start with \
- a lowercase character");
- }
- }
- _ => {}
- }
- }
- _ => {}
- }
- }
-
- fn check_struct_def(&mut self, cx: &Context, s: &ast::StructDef,
- _: ast::Ident, _: &ast::Generics, _: ast::NodeId) {
- for sf in s.fields.iter() {
- match sf.node {
- ast::StructField_ { kind: ast::NamedField(ident, _), .. } => {
- let s = token::get_ident(ident);
- if s.get().char_at(0).is_uppercase() {
- cx.span_lint(UPPERCASE_VARIABLES, sf.span,
- "structure field names should start with \
- a lowercase character");
- }
- }
- _ => {}
- }
- }
- }
-}
-
declare_lint!(UNNECESSARY_PARENS, Warn,
"`if`, `match`, `while` and `return` do not need parentheses")
PathStatement,
UnusedResult,
NonCamelCaseTypes,
- NonSnakeCaseFunctions,
+ NonSnakeCase,
NonUppercaseStatics,
- NonUppercasePatternStatics,
- UppercaseVariables,
UnnecessaryParens,
UnusedUnsafe,
UnsafeBlock,
// except according to those terms.
#![allow(dead_code)] // FFI wrappers
-#![allow(non_snake_case_functions)]
+#![allow(non_snake_case)]
use llvm;
use llvm::{CallConv, AtomicBinOp, AtomicOrdering, AsmDialect, AttrBuilder};
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(non_uppercase_pattern_statics)]
+#![allow(non_uppercase_statics)]
use llvm;
use llvm::{Integer, Pointer, Float, Double, Struct, Array};
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(non_uppercase_pattern_statics)]
+#![allow(non_uppercase_statics)]
use libc::c_uint;
use std::cmp;
// The classification code for the x86_64 ABI is taken from the clay language
// https://github.com/jckarter/clay/blob/master/compiler/src/externals.cpp
-#![allow(non_uppercase_pattern_statics)]
+#![allow(non_uppercase_statics)]
use llvm;
use llvm::{Integer, Pointer, Float, Double};
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(non_camel_case_types, non_snake_case_functions)]
+#![allow(non_camel_case_types, non_snake_case)]
//! Code that is useful in various trans modules.
!cx.reachable.contains(&node_id)
}
-#[allow(non_snake_case_functions)]
+#[allow(non_snake_case)]
fn create_DIArray(builder: DIBuilderRef, arr: &[DIDescriptor]) -> DIArray {
return unsafe {
llvm::LLVMDIBuilderGetOrCreateArray(builder, arr.as_ptr(), arr.len() as u32)
}
#[inline]
-#[allow(non_snake_case_functions)]
+#[allow(non_snake_case)]
fn DIB(cx: &CrateContext) -> DIBuilderRef {
cx.dbg_cx.get_ref().builder
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(non_uppercase_pattern_statics)]
+#![allow(non_uppercase_statics)]
use llvm;
use llvm::{SequentiallyConsistent, Acquire, Release, Xchg, ValueRef};
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(non_uppercase_pattern_statics)]
+#![allow(non_uppercase_statics)]
use llvm;
use llvm::{TypeRef, Bool, False, True, TypeKind, ValueRef};
macro_rules! def_type_content_sets(
(mod $mname:ident { $($name:ident = $bits:expr),+ }) => {
+ #[allow(non_snake_case)]
mod $mname {
use middle::ty::TypeContents;
$(pub static $name: TypeContents = TypeContents { bits: $bits };)+
//! An efficient hash map for node IDs
+#![allow(non_snake_case)]
+
use std::collections::{HashMap, HashSet};
use std::hash::{Hasher, Hash, Writer};
use syntax::ast;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(non_uppercase_pattern_statics)]
+#![allow(non_uppercase_statics)]
#![allow(non_camel_case_types)]
-#![allow(non_snake_case_functions)]
+#![allow(non_snake_case)]
#![allow(dead_code)]
#![crate_name = "rustc_llvm"]
static LOCKFILE_EXCLUSIVE_LOCK: libc::DWORD = 0x00000002;
- #[allow(non_snake_case_functions)]
+ #[allow(non_snake_case)]
extern "system" {
fn LockFileEx(hFile: libc::HANDLE,
dwFlags: libc::DWORD,
//! Unwind library interface
#![allow(non_camel_case_types)]
-#![allow(non_snake_case_functions)]
+#![allow(non_snake_case)]
#![allow(dead_code)] // these are just bindings
use libc;
libc::CloseHandle(block);
}
- #[allow(non_snake_case_functions)]
+ #[allow(non_snake_case)]
extern "system" {
fn CreateEventA(lpSecurityAttributes: LPSECURITY_ATTRIBUTES,
bManualReset: BOOL,
SwitchToThread();
}
- #[allow(non_snake_case_functions)]
+ #[allow(non_snake_case)]
extern "system" {
fn CreateThread(lpThreadAttributes: LPSECURITY_ATTRIBUTES,
dwStackSize: SIZE_T,
}
#[cfg(windows)]
-#[allow(non_snake_case_functions)]
+#[allow(non_snake_case)]
extern "system" {
fn TlsAlloc() -> DWORD;
fn TlsFree(dwTlsIndex: DWORD) -> BOOL;
> ToJson for ( $( $tyvar ),* , ) {
#[inline]
- #[allow(uppercase_variables)]
+ #[allow(non_snake_case)]
fn to_json(&self) -> Json {
match *self {
($(ref $tyvar),*,) => List(vec![$($tyvar.to_json()),*])
() => ();
( $($name:ident,)+ ) => (
impl<E, D:Decoder<E>,$($name:Decodable<D, E>),*> Decodable<D,E> for ($($name,)*) {
- #[allow(uppercase_variables)]
+ #[allow(non_snake_case)]
fn decode(d: &mut D) -> Result<($($name,)*), E> {
d.read_tuple(|d, amt| {
let mut i = 0;
}
}
impl<E, S:Encoder<E>,$($name:Encodable<S, E>),*> Encodable<S, E> for ($($name,)*) {
- #[allow(uppercase_variables)]
+ #[allow(non_snake_case)]
fn encode(&self, s: &mut S) -> Result<(), E> {
let ($(ref $name,)*) = *self;
let mut n = 0;
FreeLibrary(handle as *mut libc::c_void); ()
}
- #[allow(non_snake_case_functions)]
+ #[allow(non_snake_case)]
extern "system" {
fn SetLastError(error: libc::size_t);
fn LoadLibraryW(name: *const libc::c_void) -> *mut libc::c_void;
#![experimental]
#![allow(missing_doc)]
-#![allow(non_snake_case_functions)]
+#![allow(non_snake_case)]
use clone::Clone;
use collections::{Collection, MutableSeq};
static CRYPT_VERIFYCONTEXT: DWORD = 0xF0000000;
static NTE_BAD_SIGNATURE: DWORD = 0x80090006;
- #[allow(non_snake_case_functions)]
+ #[allow(non_snake_case)]
extern "system" {
fn CryptAcquireContextA(phProv: *mut HCRYPTPROV,
pszContainer: LPCSTR,
/// iOS doesn't use all of them it but adding more
/// platform-specific configs pollutes the code too much
#[allow(non_camel_case_types)]
- #[allow(non_snake_case_functions)]
+ #[allow(non_snake_case)]
#[allow(dead_code)]
mod uw {
use libc;
/// copy of that function in my mingw install (maybe it was broken?). Instead,
/// this takes the route of using StackWalk64 in order to walk the stack.
#[cfg(windows)]
-#[allow(dead_code, uppercase_variables)]
+#[allow(dead_code, non_snake_case)]
mod imp {
use c_str::CString;
use core_collections::Collection;
use str::StrSlice;
use dynamic_lib::DynamicLibrary;
- #[allow(non_snake_case_functions)]
+ #[allow(non_snake_case)]
extern "system" {
fn GetCurrentProcess() -> libc::HANDLE;
fn GetCurrentThread() -> libc::HANDLE;
}
}
-#[allow(non_snake_case_functions)]
+#[allow(non_snake_case)]
#[test]
fn lookup_Rust() {
let abi = lookup("Rust");
// FIXME(eddyb) #10676 use Rc<T> in the future.
pub type P<T> = Gc<T>;
-#[allow(non_snake_case_functions)]
+#[allow(non_snake_case)]
/// Construct a P<T> from a T value.
pub fn P<T: 'static>(value: T) -> P<T> {
box(GC) value
background: color::Color,
}
-#[allow(non_snake_case_functions)]
+#[allow(non_snake_case)]
#[link(name = "kernel32")]
extern "system" {
fn SetConsoleTextAttribute(handle: libc::HANDLE, attr: libc::WORD) -> libc::BOOL;
// NOTE: The following code was generated by "src/etc/unicode.py", do not edit directly
-#![allow(missing_doc, non_uppercase_statics, non_snake_case_functions)]
+#![allow(missing_doc, non_uppercase_statics, non_snake_case)]
fn bsearch_range_table(c: char, r: &'static [(char,char)]) -> bool {
use core::cmp::{Equal, Less, Greater};
/// 'XID_Start' is a Unicode Derived Property specified in
/// [UAX #31](http://unicode.org/reports/tr31/#NFKC_Modifications),
/// mostly similar to ID_Start but modified for closure under NFKx.
-#[allow(non_snake_case_functions)]
+#[allow(non_snake_case)]
pub fn is_XID_start(c: char) -> bool { derived_property::XID_Start(c) }
/// Returns whether the specified `char` satisfies the 'XID_Continue' Unicode property
/// 'XID_Continue' is a Unicode Derived Property specified in
/// [UAX #31](http://unicode.org/reports/tr31/#NFKC_Modifications),
/// mostly similar to 'ID_Continue' but modified for closure under NFKx.
-#[allow(non_snake_case_functions)]
+#[allow(non_snake_case)]
pub fn is_XID_continue(c: char) -> bool { derived_property::XID_Continue(c) }
///
/// 'XID_Start' is a Unicode Derived Property specified in
/// [UAX #31](http://unicode.org/reports/tr31/#NFKC_Modifications),
/// mostly similar to ID_Start but modified for closure under NFKx.
- #[allow(non_snake_case_functions)]
+ #[allow(non_snake_case)]
fn is_XID_start(&self) -> bool;
/// Returns whether the specified `char` satisfies the 'XID_Continue'
/// 'XID_Continue' is a Unicode Derived Property specified in
/// [UAX #31](http://unicode.org/reports/tr31/#NFKC_Modifications),
/// mostly similar to 'ID_Continue' but modified for closure under NFKx.
- #[allow(non_snake_case_functions)]
+ #[allow(non_snake_case)]
fn is_XID_continue(&self) -> bool;
// no-pretty-expanded FIXME #15189
#![feature(phase)]
-#![allow(non_snake_case_functions)]
+#![allow(non_snake_case)]
#[phase(plugin)] extern crate green;
use std::from_str::FromStr;
// ignore-pretty very bad with line comments
-#![allow(non_snake_case_functions)]
+#![allow(non_snake_case)]
use std::io;
use std::io::stdio::StdReader;
trait foo6 { //~ ERROR trait `foo6` should have a camel case name such as `Foo6`
}
+fn f<ty>(_: ty) {} //~ ERROR type parameter `ty` should have a camel case name such as `Ty`
+
#[repr(C)]
struct foo7 {
bar: int,
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![deny(non_snake_case_functions)]
+#![deny(non_snake_case)]
#![allow(dead_code)]
struct Foo;
--- /dev/null
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![deny(non_snake_case)]
+#![allow(dead_code)]
+
+fn f<'FooBar>( //~ ERROR lifetime `'FooBar` should have a snake case name such as `'foo_bar`
+ _: &'FooBar ()
+) {}
+
+fn main() { }
--- /dev/null
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![deny(non_snake_case)]
+#![allow(dead_code)]
+
+mod FooBar { //~ ERROR module `FooBar` should have a snake case name such as `foo_bar`
+ pub struct S;
+}
+
+fn f(_: FooBar::S) { }
+
+fn main() { }
// ignore-tidy-linelength
#![allow(dead_code)]
-#![deny(uppercase_variables)]
+#![deny(non_snake_case)]
use std::io::File;
use std::io::IoError;
struct Something {
- X: uint //~ ERROR structure field names should start with a lowercase character
+ X: uint //~ ERROR structure field `X` should have a snake case name such as `x`
}
-fn test(Xx: uint) { //~ ERROR variable names should start with a lowercase character
+fn test(Xx: uint) { //~ ERROR variable `Xx` should have a snake case name such as `xx`
println!("{}", Xx);
}
fn main() {
- let Test: uint = 0; //~ ERROR variable names should start with a lowercase character
+ let Test: uint = 0; //~ ERROR variable `Test` should have a snake case name such as `test`
println!("{}", Test);
let mut f = File::open(&Path::new("something.txt"));
match f.read(buff) {
Ok(cnt) => println!("read this many bytes: {}", cnt),
Err(IoError{ kind: EndOfFile, .. }) => println!("Got end of file: {}", EndOfFile.to_string()),
- //~^ ERROR variable names should start with a lowercase character
+ //~^ ERROR variable `EndOfFile` should have a snake case name such as `end_of_file`
}
test(1);
// Issue #7526: lowercase static constants in patterns look like bindings
#![allow(dead_code)]
-#![deny(non_uppercase_pattern_statics)]
+#![deny(non_uppercase_statics)]
+#[allow(non_uppercase_statics)]
pub static a : int = 97;
fn f() {
}
mod m {
+ #[allow(non_uppercase_statics)]
pub static aha : int = 7;
}
// around this problem locally by renaming the constant in the `use`
// form to an uppercase identifier that placates the lint.
-#![deny(non_uppercase_pattern_statics)]
+#![deny(non_uppercase_statics)]
pub static A : int = 97;
}
mod m {
+ #[allow(non_uppercase_statics)]
pub static aha : int = 7;
}