Test fixes and rebase conflicts
This commit is contained in:
parent
158d99d3f1
commit
bde4c1d6fb
@ -11,14 +11,12 @@
|
||||
#![crate_name="static_methods_crate"]
|
||||
#![crate_type = "lib"]
|
||||
|
||||
use std::int;
|
||||
|
||||
pub trait read {
|
||||
fn readMaybe(s: String) -> Option<Self>;
|
||||
}
|
||||
|
||||
impl read for int {
|
||||
fn readMaybe(s: String) -> Option<int> {
|
||||
impl read for isize {
|
||||
fn readMaybe(s: String) -> Option<isize> {
|
||||
s.parse().ok()
|
||||
}
|
||||
}
|
||||
|
@ -9,18 +9,18 @@
|
||||
// except according to those terms.
|
||||
|
||||
use std::num::FromPrimitive;
|
||||
use std::int;
|
||||
use std::isize;
|
||||
|
||||
#[derive(PartialEq, FromPrimitive, Debug)]
|
||||
enum A {
|
||||
Foo = int::MAX,
|
||||
Foo = isize::MAX,
|
||||
Bar = 1,
|
||||
Baz = 3,
|
||||
Qux,
|
||||
}
|
||||
|
||||
pub fn main() {
|
||||
let x: Option<A> = FromPrimitive::from_int(int::MAX);
|
||||
let x: Option<A> = FromPrimitive::from_int(isize::MAX);
|
||||
assert_eq!(x, Some(A::Foo));
|
||||
|
||||
let x: Option<A> = FromPrimitive::from_int(1);
|
||||
|
@ -8,13 +8,11 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use std::uint;
|
||||
|
||||
pub fn main() {
|
||||
// sometimes we have had trouble finding
|
||||
// the right type for f, as we unified
|
||||
// bot and u32 here
|
||||
let f = match "1234".parse::<uint>().ok() {
|
||||
let f = match "1234".parse::<usize>().ok() {
|
||||
None => return (),
|
||||
Some(num) => num as u32
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user