Skip to content

Commit 992b4e8

Browse files
committed
---
yaml --- r: 222807 b: refs/heads/master c: 5b0721d h: refs/heads/master i: 222805: fde83c4 222803: cfe0179 222799: 57983c5 v: v3
1 parent bfe9b5b commit 992b4e8

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
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: 66109d2c38b4ff2b1e097014fa4710682937a10b
2+
refs/heads/master: 5b0721d0fe390ff3f6741cdf15bf93b8a1df2879
33
refs/heads/snap-stage3: a5c12f4e39d32af3c951b66bd2839bc0b5a1125b
44
refs/heads/try: b53c0f93eedcdedd4fd89bccc5a3a09d1c5cd23e
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

trunk/src/doc/tarpl/races.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ race condition can't violate memory safety in a Rust program on
2525
its own. Only in conjunction with some other unsafe code can a race condition
2626
actually violate memory safety. For instance:
2727

28-
```rust,no_run
28+
```rust,norun
2929
use std::thread;
3030
use std::sync::atomic::{AtomicUsize, Ordering};
3131
use std::sync::Arc;
@@ -56,7 +56,7 @@ thread::spawn(move || {
5656
println!("{}", data[idx.load(Ordering::SeqCst)]);
5757
```
5858

59-
```rust,no_run
59+
```rust,norun
6060
use std::thread;
6161
use std::sync::atomic::{AtomicUsize, Ordering};
6262
use std::sync::Arc;

trunk/src/librustdoc/markdown.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,14 @@ use test::{TestOptions, Collector};
2929
/// Separate any lines at the start of the file that begin with `%`.
3030
fn extract_leading_metadata<'a>(s: &'a str) -> (Vec<&'a str>, &'a str) {
3131
let mut metadata = Vec::new();
32+
let mut count = 0;
3233
for line in s.lines() {
3334
if line.starts_with("%") {
3435
// remove %<whitespace>
35-
metadata.push(line[1..].trim_left())
36+
metadata.push(line[1..].trim_left());
37+
count += line.len() + 1;
3638
} else {
37-
let line_start_byte = s.find(line).unwrap();
38-
return (metadata, &s[line_start_byte..]);
39+
return (metadata, &s[count..]);
3940
}
4041
}
4142
// if we're here, then all lines were metadata % lines.

0 commit comments

Comments
 (0)