From e6eee414716594f355180837e4fcba9786160aac Mon Sep 17 00:00:00 2001 From: Vladimir Pouzanov Date: Mon, 21 Jul 2014 09:58:55 +0100 Subject: [PATCH 1/4] Fixed static lifetimes --- src/hal/k20/uart.rs | 2 +- src/hal/lpc17xx/peripheral_clock.rs | 2 +- src/hal/lpc17xx/uart.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hal/k20/uart.rs b/src/hal/k20/uart.rs index 4d1e09ff..135bc542 100644 --- a/src/hal/k20/uart.rs +++ b/src/hal/k20/uart.rs @@ -78,7 +78,7 @@ enum ParitySelect { } impl UARTPeripheral { - fn reg(self) -> ®::UART { + fn reg(self) -> &'static reg::UART { match self { UART0 => ®::UART0, UART1 => ®::UART1, diff --git a/src/hal/lpc17xx/peripheral_clock.rs b/src/hal/lpc17xx/peripheral_clock.rs index 9f9e371d..41f5c1c8 100644 --- a/src/hal/lpc17xx/peripheral_clock.rs +++ b/src/hal/lpc17xx/peripheral_clock.rs @@ -195,7 +195,7 @@ impl PeripheralClock { } } - fn divisor_reg_and_offset(self) -> (®::PCLKSEL, u32) { + fn divisor_reg_and_offset(self) -> (&'static reg::PCLKSEL, u32) { match self.to_divisor() { WDTDivisor|TIMER0Divisor|TIMER1Divisor|UART0Divisor|UART1Divisor| PWM1Divisor|I2C0Divisor|SPIDivisor|SSP1Divisor|DACDivisor|ADCDivisor| diff --git a/src/hal/lpc17xx/uart.rs b/src/hal/lpc17xx/uart.rs index 3b91eb9c..1f1fe585 100644 --- a/src/hal/lpc17xx/uart.rs +++ b/src/hal/lpc17xx/uart.rs @@ -113,7 +113,7 @@ pub struct UART { } impl UARTPeripheral { - fn reg(self) -> ®::UART { + fn reg(self) -> &'static reg::UART { match self { UART0 => ®::UART0, UART2 => ®::UART2, From 2ed8674df2c1752d49337d06ced0b297957c2b84 Mon Sep 17 00:00:00 2001 From: Vladimir Pouzanov Date: Wed, 23 Jul 2014 08:23:01 +0100 Subject: [PATCH 2/4] Fixed broken rlib dependency generator --- support/build/rlib.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support/build/rlib.rb b/support/build/rlib.rb index fd32b85f..6901d9e1 100644 --- a/support/build/rlib.rb +++ b/support/build/rlib.rb @@ -17,6 +17,6 @@ module Rlib def self.crate_name(src) - `#{RUSTC} --print-file-name "#{src}"` + `#{RUSTC} --print-file-name "#{src}"`.strip end end From fb418d22a74bdc3ac140452ed93e41e85db21365 Mon Sep 17 00:00:00 2001 From: Vladimir Pouzanov Date: Fri, 25 Jul 2014 08:22:56 +0100 Subject: [PATCH 3/4] Do not optimize PT crate --- Rakefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Rakefile b/Rakefile index 61a5a29b..3ed236f4 100644 --- a/Rakefile +++ b/Rakefile @@ -75,6 +75,7 @@ compile_rust :platformtree_crate, { produce: 'platformtree/platformtree.rs'.in_root.as_rlib.in_build, out_dir: true, build_for: :host, + optimize: 0, } rust_tests :platformtree_test, { @@ -98,6 +99,7 @@ compile_rust :macro_platformtree, { produce: 'macro/platformtree.rs'.in_root.as_dylib.in_build, out_dir: true, build_for: :host, + optimize: 0, } desc "Build API documentation" From db6ff400f35948b4c473ee05c80eb8d36cbde81d Mon Sep 17 00:00:00 2001 From: Vladimir Pouzanov Date: Fri, 25 Jul 2014 09:27:19 +0100 Subject: [PATCH 4/4] Checkout the matching version or libcore --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 939b8560..23c60532 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,8 @@ install: - tar xf rust.tgz - (cd ./rust-nightly-x86_64-unknown-linux-gnu/; sudo ./install.sh) - export LD_LIBRARY_PATH=/usr/local/lib + - (mkdir -p ./thirdparty; cd ./thirdparty; git clone --depth 50 https://github.com/rust-lang/rust) + - "(cd ./thirdparty/rust; git checkout `rustc --version|awk '{sub(/\\(/, \"\", $3); print $3}'`)" before_script: - rustc --version script: