Skip to content

Commit

Permalink
Assorted cleanups suggested by reviewers.
Browse files Browse the repository at this point in the history
  • Loading branch information
jld committed Oct 29, 2013
1 parent 01097cb commit 727731f
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
3 changes: 2 additions & 1 deletion src/libextra/enum_set.rs
Expand Up @@ -139,7 +139,8 @@ mod test {

use enum_set::*;

#[deriving(Eq)] #[repr(uint)]
#[deriving(Eq)]
#[repr(uint)]
enum Foo {
A, B, C
}
Expand Down
3 changes: 2 additions & 1 deletion src/librustc/metadata/common.rs
Expand Up @@ -111,7 +111,8 @@ pub static tag_items_data_item_reexport_def_id: uint = 0x4e;
pub static tag_items_data_item_reexport_name: uint = 0x4f;

// used to encode crate_ctxt side tables
#[deriving(Eq)] #[repr(uint)]
#[deriving(Eq)]
#[repr(uint)]
pub enum astencode_tag { // Reserves 0x50 -- 0x6f
tag_ast = 0x50,

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/trans/adt.rs
Expand Up @@ -359,7 +359,7 @@ fn bounds_usable(cx: &mut CrateContext, ity: IntType, bounds: &IntBounds) -> boo
}
}

fn ty_of_inttype(ity: IntType) -> ty::t {
pub fn ty_of_inttype(ity: IntType) -> ty::t {
match ity {
attr::SignedInt(t) => ty::mk_mach_int(t),
attr::UnsignedInt(t) => ty::mk_mach_uint(t)
Expand Down
7 changes: 2 additions & 5 deletions src/librustc/middle/trans/debuginfo.rs
Expand Up @@ -109,7 +109,6 @@ use std::libc::{c_uint, c_ulonglong, c_longlong};
use std::ptr;
use std::unstable::atomics;
use std::vec;
use syntax::attr;
use syntax::codemap::{Span, Pos};
use syntax::{ast, codemap, ast_util, ast_map, opt_vec};
use syntax::parse::token;
Expand Down Expand Up @@ -1422,10 +1421,8 @@ fn prepare_enum_metadata(cx: &mut CrateContext,
let discriminant_type_metadata = |inttype| {
let discriminant_llvm_type = adt::ll_inttype(cx, inttype);
let (discriminant_size, discriminant_align) = size_and_align_of(cx, discriminant_llvm_type);
let discriminant_base_type_metadata = type_metadata(cx, match inttype {
attr::SignedInt(t) => ty::mk_mach_int(t),
attr::UnsignedInt(t) => ty::mk_mach_uint(t)
}, codemap::dummy_sp());
let discriminant_base_type_metadata = type_metadata(cx, adt::ty_of_inttype(inttype),
codemap::dummy_sp());
do enum_name.with_c_str |enum_name| {
unsafe {
llvm::LLVMDIBuilderCreateEnumerationType(
Expand Down
3 changes: 2 additions & 1 deletion src/librustc/middle/ty.rs
Expand Up @@ -715,7 +715,8 @@ pub struct ParamBounds {

pub type BuiltinBounds = EnumSet<BuiltinBound>;

#[deriving(Clone, Eq, IterBytes, ToStr)] #[repr(uint)]
#[deriving(Clone, Eq, IterBytes, ToStr)]
#[repr(uint)]
pub enum BuiltinBound {
BoundStatic,
BoundSend,
Expand Down
3 changes: 1 addition & 2 deletions src/libsyntax/attr.rs
Expand Up @@ -385,8 +385,7 @@ pub fn find_repr_attr(diagnostic: @mut span_handler, attr: @ast::MetaItem, acc:
for item in items.iter() {
match item.node {
ast::MetaWord(word) => {
let word: &str = word;
let hint = match word {
let hint = match word.as_slice() {
// Can't use "extern" because it's not a lexical identifier.
"C" => ReprExtern,
_ => match int_type_of_word(word) {
Expand Down
3 changes: 2 additions & 1 deletion src/test/run-pass/issue-2718.rs
Expand Up @@ -26,7 +26,8 @@ pub mod pipes {
payload: Option<T>
}

#[deriving(Eq)] #[repr(int)]
#[deriving(Eq)]
#[repr(int)]
pub enum state {
empty,
full,
Expand Down

0 comments on commit 727731f

Please sign in to comment.