Skip to content

Commit 9416412

Browse files
committed
---
yaml --- r: 67217 b: refs/heads/master c: e029c2d h: refs/heads/master i: 67215: 40b7775 v: v3
1 parent bf2abc9 commit 9416412

23 files changed

+673
-675
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: b128ceb16127ec9c817595aaa64c025b9e5ed12e
2+
refs/heads/master: e029c2d623957d52b5a5ad01f1d8e000e1e56555
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 18e3db7392d2d0697b7e27d6d986139960144d85
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9

trunk/doc/tutorial.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -499,8 +499,8 @@ types.
499499
> items.
500500
501501
~~~~
502-
# use std::float;
503-
# use std::num::atan;
502+
use std::float;
503+
use std::num::atan;
504504
fn angle(vector: (float, float)) -> float {
505505
let pi = float::consts::pi;
506506
match vector {
@@ -555,7 +555,7 @@ while cake_amount > 0 {
555555
`loop` denotes an infinite loop, and is the preferred way of writing `while true`:
556556

557557
~~~~
558-
# use std::int;
558+
use std::int;
559559
let mut x = 5;
560560
loop {
561561
x += x - 3;
@@ -701,7 +701,7 @@ get at their contents. All variant constructors can be used as
701701
patterns, as in this definition of `area`:
702702

703703
~~~~
704-
# use std::float;
704+
use std::float;
705705
# struct Point {x: float, y: float}
706706
# enum Shape { Circle(Point, float), Rectangle(Point, Point) }
707707
fn area(sh: Shape) -> float {
@@ -733,7 +733,7 @@ fn point_from_direction(dir: Direction) -> Point {
733733
Enum variants may also be structs. For example:
734734

735735
~~~~
736-
# use std::float;
736+
use std::float;
737737
# struct Point { x: float, y: float }
738738
# fn square(x: float) -> float { x * x }
739739
enum Shape {
@@ -1599,7 +1599,8 @@ lists back to back. Since that is so unsightly, empty argument lists
15991599
may be omitted from `do` expressions.
16001600

16011601
~~~~
1602-
# use std::task::spawn;
1602+
use std::task::spawn;
1603+
16031604
do spawn {
16041605
debug!("Kablam!");
16051606
}
@@ -1728,7 +1729,7 @@ impl Circle {
17281729
To call such a method, just prefix it with the type name and a double colon:
17291730

17301731
~~~~
1731-
# use std::float::consts::pi;
1732+
use std::float::consts::pi;
17321733
struct Circle { radius: float }
17331734
impl Circle {
17341735
fn new(area: float) -> Circle { Circle { radius: (area / pi).sqrt() } }
@@ -1774,7 +1775,7 @@ illegal to copy and pass by value.
17741775
Generic `type`, `struct`, and `enum` declarations follow the same pattern:
17751776

17761777
~~~~
1777-
# use std::hashmap::HashMap;
1778+
use std::hashmap::HashMap;
17781779
type Set<T> = HashMap<T, ()>;
17791780
17801781
struct Stack<T> {
@@ -2000,7 +2001,7 @@ name and a double colon. The compiler uses type inference to decide which
20002001
implementation to use.
20012002

20022003
~~~~
2003-
# use std::float::consts::pi;
2004+
use std::float::consts::pi;
20042005
trait Shape { fn new(area: float) -> Self; }
20052006
struct Circle { radius: float }
20062007
struct Square { length: float }
@@ -2156,7 +2157,7 @@ trait Circle : Shape { fn radius(&self) -> float; }
21562157
Now, we can implement `Circle` on a type only if we also implement `Shape`.
21572158

21582159
~~~~
2159-
# use std::float::consts::pi;
2160+
use std::float::consts::pi;
21602161
# trait Shape { fn area(&self) -> float; }
21612162
# trait Circle : Shape { fn radius(&self) -> float; }
21622163
# struct Point { x: float, y: float }
@@ -2191,7 +2192,7 @@ fn radius_times_area<T: Circle>(c: T) -> float {
21912192
Likewise, supertrait methods may also be called on trait objects.
21922193

21932194
~~~ {.xfail-test}
2194-
# use std::float::consts::pi;
2195+
use std::float::consts::pi;
21952196
# trait Shape { fn area(&self) -> float; }
21962197
# trait Circle : Shape { fn radius(&self) -> float; }
21972198
# struct Point { x: float, y: float }

trunk/src/etc/tidy.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ def do_license_check(name, contents):
4949
report_err("FIXME without issue number")
5050
if line.find("TODO") != -1:
5151
report_err("TODO is deprecated; use FIXME")
52-
match = re.match(r'^.*//\s*(NOTE.*)$', line)
53-
if match:
54-
report_warn(match.group(1))
52+
idx = line.find("// NOTE")
53+
if idx != -1:
54+
report_warn("NOTE" + line[idx + len("// NOTE"):])
5555
if (line.find('\t') != -1 and
5656
fileinput.filename().find("Makefile") == -1):
5757
report_err("tab character")

0 commit comments

Comments
 (0)