Skip to content
This repository has been archived by the owner on Jul 6, 2019. It is now read-only.

Commit

Permalink
Merge pull request #165 from farcaller/fix-nightly
Browse files Browse the repository at this point in the history
Various nightly fallout fixes
  • Loading branch information
farcaller committed Aug 31, 2014
2 parents f63f1e4 + 9857511 commit dca6004
Show file tree
Hide file tree
Showing 18 changed files with 59 additions and 60 deletions.
12 changes: 6 additions & 6 deletions ioreg/builder/accessors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ use super::utils;
use super::super::node;

/// A visitor to build accessor functions for each register struct
pub struct BuildAccessors<'a, 'b, 'c> {
pub struct BuildAccessors<'a> {
builder: &'a mut Builder,
cx: &'b ExtCtxt<'c>,
cx: &'a ExtCtxt<'a>,
}

impl<'a, 'b, 'c> node::RegVisitor for BuildAccessors<'a, 'b, 'c> {
impl<'a> node::RegVisitor for BuildAccessors<'a> {
fn visit_prim_reg(&mut self, path: &Vec<String>, reg: &node::Reg,
_width: node::RegWidth, fields: &Vec<node::Field>) {
if fields.iter().any(|f| f.access != node::WriteOnly) {
Expand All @@ -48,9 +48,9 @@ impl<'a, 'b, 'c> node::RegVisitor for BuildAccessors<'a, 'b, 'c> {
}
}

impl<'a, 'b, 'c> BuildAccessors<'a, 'b, 'c> {
pub fn new(builder: &'a mut Builder, cx: &'b ExtCtxt<'c>)
-> BuildAccessors<'a, 'b, 'c> {
impl<'a> BuildAccessors<'a> {
pub fn new(builder: &'a mut Builder, cx: &'a ExtCtxt<'a>)
-> BuildAccessors<'a> {
BuildAccessors {builder: builder, cx: cx}
}
}
Expand Down
12 changes: 6 additions & 6 deletions ioreg/builder/getter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ use super::super::node;
use super::utils;

/// A visitor to build the field setters for primitive registers
pub struct BuildGetters<'a, 'b, 'c> {
pub struct BuildGetters<'a> {
builder: &'a mut Builder,
cx: &'b ExtCtxt<'c>,
cx: &'a ExtCtxt<'a>,
}

impl<'a, 'b, 'c> BuildGetters<'a, 'b, 'c> {
pub fn new(builder: &'a mut Builder, cx: &'b ExtCtxt<'c>)
-> BuildGetters<'a, 'b, 'c> {
impl<'a> BuildGetters<'a> {
pub fn new(builder: &'a mut Builder, cx: &'a ExtCtxt<'a>)
-> BuildGetters<'a> {
BuildGetters { builder: builder, cx: cx }
}
}

impl<'a, 'b, 'c> node::RegVisitor for BuildGetters<'a, 'b, 'c> {
impl<'a> node::RegVisitor for BuildGetters<'a> {
fn visit_prim_reg(&mut self, path: &Vec<String>,
reg: &node::Reg, _width: node::RegWidth,
fields: &Vec<node::Field>) {
Expand Down
15 changes: 7 additions & 8 deletions ioreg/builder/register.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ use super::utils;
use super::super::node;

/// A visitor to build the struct for each register
pub struct BuildRegStructs<'a, 'b, 'c> {
pub struct BuildRegStructs<'a> {
builder: &'a mut Builder,
cx: &'b ExtCtxt<'c>,
cx: &'a ExtCtxt<'a>,
}

impl<'a, 'b, 'c> node::RegVisitor for BuildRegStructs<'a, 'b, 'c> {
impl<'a> node::RegVisitor for BuildRegStructs<'a> {
fn visit_prim_reg(&mut self, path: &Vec<String>, reg: &node::Reg,
width: node::RegWidth, fields: &Vec<node::Field>) {
for field in fields.iter() {
Expand All @@ -49,9 +49,9 @@ impl<'a, 'b, 'c> node::RegVisitor for BuildRegStructs<'a, 'b, 'c> {
}
}

impl<'a, 'b, 'c> BuildRegStructs<'a, 'b, 'c> {
pub fn new(builder: &'a mut Builder, cx: &'b ExtCtxt<'c>)
-> BuildRegStructs<'a, 'b, 'c> {
impl<'a> BuildRegStructs<'a> {
pub fn new(builder: &'a mut Builder, cx: &'a ExtCtxt<'a>)
-> BuildRegStructs<'a> {
BuildRegStructs {builder: builder, cx: cx}
}
}
Expand All @@ -74,8 +74,7 @@ fn build_field_type(cx: &ExtCtxt, path: &Vec<String>,
let attrs: Vec<ast::Attribute> = vec!(
utils::list_attribute(cx, "deriving", vec!("FromPrimitive")),
utils::list_attribute(cx, "allow",
vec!("uppercase_variables",
"dead_code",
vec!("dead_code",
"non_camel_case_types",
"missing_doc")));
let item: P<ast::Item> = box(GC) ast::Item {
Expand Down
12 changes: 6 additions & 6 deletions ioreg/builder/setter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ use super::super::node;
use super::utils;

/// A visitor to build the field setters for primitive registers
pub struct BuildSetters<'a, 'b, 'c> {
pub struct BuildSetters<'a> {
builder: &'a mut Builder,
cx: &'b ExtCtxt<'c>,
cx: &'a ExtCtxt<'a>,
}

impl<'a, 'b, 'c> BuildSetters<'a, 'b, 'c> {
pub fn new(builder: &'a mut Builder, cx: &'b ExtCtxt<'c>)
-> BuildSetters<'a, 'b, 'c> {
impl<'a> BuildSetters<'a> {
pub fn new(builder: &'a mut Builder, cx: &'a ExtCtxt<'a>)
-> BuildSetters<'a> {
BuildSetters { builder: builder, cx: cx }
}
}

impl<'a, 'b, 'c> node::RegVisitor for BuildSetters<'a, 'b, 'c> {
impl<'a> node::RegVisitor for BuildSetters<'a> {
fn visit_prim_reg<'a>(&'a mut self, path: &Vec<String>,
reg: &'a node::Reg, _width: node::RegWidth, fields: &Vec<node::Field>)
{
Expand Down
20 changes: 9 additions & 11 deletions ioreg/builder/union.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,14 @@ impl<'a> Iterator<RegOrPadding<'a>> for PaddedRegsIterator<'a> {
}

/// Build types for `RegUnions`
pub struct BuildUnionTypes<'a, 'b, 'c> {
pub struct BuildUnionTypes<'a> {
builder: &'a mut Builder,
cx: &'b ExtCtxt<'c>
cx: &'a ExtCtxt<'a>
}

impl<'a, 'b, 'c> BuildUnionTypes<'a, 'b, 'c> {
pub fn new(builder: &'a mut Builder,
cx: &'b ExtCtxt<'c>)
-> BuildUnionTypes<'a, 'b, 'c> {
impl<'a> BuildUnionTypes<'a> {
pub fn new(builder: &'a mut Builder, cx: &'a ExtCtxt<'a>)
-> BuildUnionTypes<'a> {
BuildUnionTypes { builder: builder, cx: cx }
}
}
Expand All @@ -102,15 +101,15 @@ fn reg_struct_type(cx: &ExtCtxt, path: &Vec<String>, reg: &node::Reg)
}


impl<'a, 'b, 'c> node::RegVisitor for BuildUnionTypes<'a, 'b, 'c> {
impl<'a> node::RegVisitor for BuildUnionTypes<'a> {
fn visit_union_reg<'a>(&'a mut self, path: &Vec<String>, reg: &'a node::Reg,
subregs: Gc<Vec<node::Reg>>) {
let union_type = self.build_union_type(path, reg, &*subregs);
self.builder.push_item(union_type);
}
}

impl<'a, 'b, 'c> BuildUnionTypes<'a, 'b, 'c> {
impl<'a> BuildUnionTypes<'a> {
/// Produce a field for the given register in a `RegUnion` struct
fn build_reg_union_field(&self, path: &Vec<String>, reg: &node::Reg)
-> ast::StructField {
Expand All @@ -132,9 +131,9 @@ impl<'a, 'b, 'c> BuildUnionTypes<'a, 'b, 'c> {
}

/// Build field for padding or a register
fn build_pad_or_reg(&self, path: &Vec<String>, regOrPad: RegOrPadding,
fn build_pad_or_reg(&self, path: &Vec<String>, reg_or_pad: RegOrPadding,
index: uint) -> ast::StructField {
match regOrPad {
match reg_or_pad {
Reg(reg) => self.build_reg_union_field(path, reg),
Pad(length) => {
let u8_path = self.cx.path_ident(
Expand Down Expand Up @@ -179,7 +178,6 @@ impl<'a, 'b, 'c> BuildUnionTypes<'a, 'b, 'c> {
let mut attrs: Vec<ast::Attribute> = vec!(
utils::list_attribute(self.cx, "allow",
vec!("non_camel_case_types",
"uppercase_variables",
"dead_code",
"missing_doc")),
);
Expand Down
10 changes: 5 additions & 5 deletions ioreg/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@ enum Scope {
Outer,
}

pub struct Parser<'a,'b> {
cx: &'a ExtCtxt<'b>,
pub struct Parser<'a> {
cx: &'a ExtCtxt<'a>,
sess: &'a ParseSess,
reader: Box<lexer::Reader>,
reader: Box<lexer::Reader+'a>,
token: token::Token,
span: Span,

last_token: Option<Box<token::Token>>,
last_span: Span,
}

impl<'a, 'b> Parser<'a, 'b> {
pub fn new<'a, 'b>(cx: &'a ExtCtxt<'b>, tts: &[TokenTree]) -> Parser<'a, 'b> {
impl<'a> Parser<'a> {
pub fn new<'a>(cx: &'a ExtCtxt<'a>, tts: &[TokenTree]) -> Parser<'a> {
let sess = cx.parse_sess();
let ttsvec = tts.iter().map(|x| (*x).clone()).collect();
let mut reader = box lexer::new_tt_reader(
Expand Down
2 changes: 1 addition & 1 deletion ioreg/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ mod test {
assert_eq!(get_value(&test, 0), 1<<25)
}

it "doesn't read from writeonly registers" {
it "does not read from writeonly registers" {
test.wo_reg.set_field1(0xdead);
assert_eq!(get_value(&test, 2), 0xdead);
test.wo_reg.set_field2(0xdead);
Expand Down
4 changes: 2 additions & 2 deletions macro/ioreg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub fn plugin_registrar(reg: &mut Registry) {
}

pub fn macro_ioregs(cx: &mut ExtCtxt, _: Span, tts: &[ast::TokenTree])
-> Box<MacResult> {
-> Box<MacResult+'static> {
match Parser::new(cx, tts).parse_ioregs() {
Some(group) => {
let mut builder = Builder::new();
Expand All @@ -56,7 +56,7 @@ pub struct MacItems {
}

impl MacItems {
pub fn new(items: Vec<Gc<ast::Item>>) -> Box<MacResult> {
pub fn new(items: Vec<Gc<ast::Item>>) -> Box<MacResult+'static> {
box MacItems { items: items } as Box<MacResult>
}
}
Expand Down
6 changes: 3 additions & 3 deletions macro/platformtree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub fn plugin_registrar(reg: &mut Registry) {
}

pub fn macro_platformtree(cx: &mut ExtCtxt, _: Span, tts: &[ast::TokenTree])
-> Box<MacResult> {
-> Box<MacResult+'static> {
let pt = Parser::new(cx, tts).parse_platformtree();
let items = Builder::build(cx, pt.unwrap())
.expect(format!("Unexpected failure on {}", line!()).as_slice())
Expand All @@ -58,7 +58,7 @@ pub fn macro_platformtree(cx: &mut ExtCtxt, _: Span, tts: &[ast::TokenTree])


pub fn macro_platformtree_verbose(cx: &mut ExtCtxt, sp: Span,
tts: &[ast::TokenTree]) -> Box<MacResult> {
tts: &[ast::TokenTree]) -> Box<MacResult+'static> {
let result = macro_platformtree(cx, sp, tts);

println!("Platform Tree dump:")
Expand Down Expand Up @@ -127,7 +127,7 @@ pub struct MacItems {
}

impl MacItems {
pub fn new(items: Vec<Gc<ast::Item>>) -> Box<MacResult> {
pub fn new(items: Vec<Gc<ast::Item>>) -> Box<MacResult+'static> {
box MacItems { items: items } as Box<MacResult>
}
}
Expand Down
4 changes: 3 additions & 1 deletion platformtree/builder/os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ fn build_args(builder: &mut Builder, cx: &mut ExtCtxt,
let typaram = cx.typaram(
DUMMY_SP,
cx.ident_of(ty.to_tyhash().as_slice()),
OwnedSlice::empty(),
OwnedSlice::from_vec(vec!(
ast::RegionTyParamBound(cx.lifetime(DUMMY_SP, intern("'a")))
)),
None,
None);
collected_params.push(typaram);
Expand Down
2 changes: 1 addition & 1 deletion platformtree/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use node;

pub struct Parser<'a> {
pub sess: &'a ParseSess,
reader: Box<lexer::Reader>,
reader: Box<lexer::Reader+'a>,
token: token::Token,
span: Span,

Expand Down
2 changes: 1 addition & 1 deletion src/zinc/drivers/dht22.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use hal::pin::{GPIO, Low, High, In, Out, GPIOLevel};
use hal::timer::Timer;

/// Basic DHT22 driver ported over from Arduino example.
pub struct DHT22<'a, T, P> {
pub struct DHT22<'a, T:'a, P:'a> {
gpio: &'a P,
timer: &'a T,
}
Expand Down
2 changes: 1 addition & 1 deletion src/zinc/drivers/lcd/c12332.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use hal::pin::GPIO;
use hal::spi::SPI;

/// C12332 driver.
pub struct C12332<'a, S, T, P> {
pub struct C12332<'a, S:'a, T:'a, P:'a> {
spi: &'a S,
timer: &'a T,

Expand Down
2 changes: 1 addition & 1 deletion src/zinc/drivers/lcd/ili9341.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use hal::pin::GPIO;
use hal::spi::SPI;

/// ILI9341 driver.
pub struct ILI9341<'a, S, T, P> {
pub struct ILI9341<'a, S:'a, T:'a, P:'a> {
spi: &'a S,
timer: &'a T,
dc: &'a P,
Expand Down
2 changes: 1 addition & 1 deletion src/zinc/hal/k20/pin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ impl ::hal::pin::GPIO for Pin {
mod reg {
use util::volatile_cell::VolatileCell;

#[allow(uppercase_variables)]
#[allow(non_snake_case)]
pub struct PORT {
pub PCR: [VolatileCell<u32>, ..32],
pub GPCLR: VolatileCell<u32>,
Expand Down
4 changes: 2 additions & 2 deletions src/zinc/hal/k20/sim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#[path="../../util/ioreg.rs"] mod ioreg;

/// Enable clock to a PORTx peripheral
#[allow(non_snake_case_functions)]
#[allow(non_snake_case)]
pub fn enable_PORT(num: uint) {
reg::SIM.set_SCGC5(reg::SIM.SCGC5() | (1 << (num + 8)));
}
Expand All @@ -27,7 +27,7 @@ pub fn enable_PORT(num: uint) {
mod reg {
use util::volatile_cell::VolatileCell;

#[allow(uppercase_variables)]
#[allow(non_snake_case)]
struct SIM {
SOPT1: VolatileCell<u32>,
SOPT1CFG: VolatileCell<u32>,
Expand Down
2 changes: 1 addition & 1 deletion src/zinc/hal/lpc17xx/ssp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ impl SSPPeripheral {
}

impl SSP {
#[allow(uppercase_variables)]
#[allow(non_snake_case)]
fn set_format(&self, bits: u8, mode: u8) {
let slave = false;

Expand Down
6 changes: 3 additions & 3 deletions src/zinc/util/ioreg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

macro_rules! ioreg_old(
($io:ident: $ty:ty, $($reg:ident),+) => (
#[allow(uppercase_variables)]
#[allow(non_snake_case)]
pub struct $io {
$(
$reg: VolatileCell<$ty>,
Expand All @@ -30,7 +30,7 @@ macro_rules! reg_r(
($t:ident, $ty:ty, $getter_name:ident, $reg:ident) => (
impl $t {
#[no_split_stack]
#[allow(dead_code,non_snake_case_functions)]
#[allow(dead_code,non_snake_case)]
#[inline(always)]
pub fn $getter_name(&self) -> $ty {
self.$reg.get()
Expand All @@ -43,7 +43,7 @@ macro_rules! reg_w(
($t:ident, $ty:ty, $setter_name:ident, $reg:ident) => (
impl $t {
#[no_split_stack]
#[allow(dead_code,non_snake_case_functions)]
#[allow(dead_code,non_snake_case)]
#[inline(always)]
pub fn $setter_name(&self, val: $ty) {
self.$reg.set(val);
Expand Down

0 comments on commit dca6004

Please sign in to comment.