about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJakub Bukaj <jakub@jakub.cc>2014-11-19 23:06:53 +0100
committerJakub Bukaj <jakub@jakub.cc>2014-11-19 23:34:01 +0100
commitee66c841655c3abb528841704d991c4a5a67ff9d (patch)
tree586a16ef24193ba5fb488f5470c1f156ac31c984
parent2e9f705b930901a406eeba3cf2b01c015cb86b4d (diff)
downloadrust-ee66c841655c3abb528841704d991c4a5a67ff9d.tar.gz
rust-ee66c841655c3abb528841704d991c4a5a67ff9d.zip
Fixes to the roll-up
-rw-r--r--src/doc/guide-error-handling.md13
-rw-r--r--src/libsyntax/visit.rs2
-rw-r--r--src/test/compile-fail/bad-lit-suffixes.rs4
-rw-r--r--src/test/compile-fail/issue-19086.rs10
4 files changed, 16 insertions, 13 deletions
diff --git a/src/doc/guide-error-handling.md b/src/doc/guide-error-handling.md
index 427ca4ba1a1..e2a706e59f0 100644
--- a/src/doc/guide-error-handling.md
+++ b/src/doc/guide-error-handling.md
@@ -84,6 +84,8 @@ While we know that we've covered all possible cases, Rust can't tell. It
 doesn't know that probability is between 0.0 and 1.0. So we add another case:
 
 ```rust
+use Event::NewRelease;
+
 enum Event {
     NewRelease,
 }
@@ -106,7 +108,7 @@ fn descriptive_probability(event: Event) -> &'static str {
 }
 
 fn main() {
-    std::io::println(descriptive_probability(NewRelease));
+    println!("{}", descriptive_probability(NewRelease));
 }
 ```
 
@@ -151,15 +153,14 @@ enum Version { Version1, Version2 }
 #[deriving(Show)]
 enum ParseError { InvalidHeaderLength, InvalidVersion }
 
-
 fn parse_version(header: &[u8]) -> Result<Version, ParseError> {
     if header.len() < 1 {
-        return Err(InvalidHeaderLength);
+        return Err(ParseError::InvalidHeaderLength);
     }
     match header[0] {
-        1 => Ok(Version1),
-        2 => Ok(Version2),
-        _ => Err(InvalidVersion)
+        1 => Ok(Version::Version1),
+        2 => Ok(Version::Version2),
+        _ => Err(ParseError::InvalidVersion)
     }
 }
 
diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs
index 1eae5286d79..41a7ce7d78e 100644
--- a/src/libsyntax/visit.rs
+++ b/src/libsyntax/visit.rs
@@ -212,7 +212,7 @@ pub fn walk_local<'v, V: Visitor<'v>>(visitor: &mut V, local: &'v Local) {
 
 pub fn walk_lifetime_def<'v, V: Visitor<'v>>(visitor: &mut V,
                                               lifetime_def: &'v LifetimeDef) {
-    visitor.visit_lifetime_ref(&lifetime_def.lifetime);
+    visitor.visit_name(lifetime_def.lifetime.span, lifetime_def.lifetime.name);
     for bound in lifetime_def.bounds.iter() {
         visitor.visit_lifetime_ref(bound);
     }
diff --git a/src/test/compile-fail/bad-lit-suffixes.rs b/src/test/compile-fail/bad-lit-suffixes.rs
index e142365a8ca..d10337e768c 100644
--- a/src/test/compile-fail/bad-lit-suffixes.rs
+++ b/src/test/compile-fail/bad-lit-suffixes.rs
@@ -36,6 +36,6 @@ fn main() {
 
     1234suffix; //~ ERROR illegal suffix `suffix` for numeric literal
     0b101suffix; //~ ERROR illegal suffix `suffix` for numeric literal
-    1.0suffix; //~ ERROR illegal suffix `suffix` for numeric literal
-    1.0e10suffix; //~ ERROR illegal suffix `suffix` for numeric literal
+    1.0suffix; //~ ERROR illegal suffix `suffix` for float literal
+    1.0e10suffix; //~ ERROR illegal suffix `suffix` for float literal
 }
diff --git a/src/test/compile-fail/issue-19086.rs b/src/test/compile-fail/issue-19086.rs
index 9fd1f228984..69201859457 100644
--- a/src/test/compile-fail/issue-19086.rs
+++ b/src/test/compile-fail/issue-19086.rs
@@ -8,11 +8,13 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-fn main() {
-    enum Foo {
-        FooB { x: i32, y: i32 }
-    }
+use Foo::FooB;
 
+enum Foo {
+    FooB { x: i32, y: i32 }
+}
+
+fn main() {
     let f = FooB { x: 3, y: 4 };
     match f {
         FooB(a, b) => println!("{} {}", a, b),