Skip to content

Commit 744ecf9

Browse files
committed
---
yaml --- r: 71759 b: refs/heads/dist-snap c: a7f0bfb h: refs/heads/master i: 71757: 263ba35 71755: 8ece121 71751: d56f6c8 71743: 2b851b1 v: v3
1 parent 8cbe793 commit 744ecf9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+1393
-1454
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
99
refs/heads/incoming: b50030718cf28f2a5a81857a26b57442734fe854
10-
refs/heads/dist-snap: 84c296b27d3324b419e54bb5c899bd1fdc1f1008
10+
refs/heads/dist-snap: a7f0bfbda65d6ac2494d2270a96f45570dfb552e
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/doc/rust.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,10 +441,10 @@ expression context, the final namespace qualifier is omitted.
441441
Two examples of paths with type arguments:
442442

443443
~~~~
444-
# use core::hashmap::HashMap;
444+
# use core::hashmap::linear::LinearMap;
445445
# fn f() {
446446
# fn id<T:Copy>(t: T) -> T { t }
447-
type t = HashMap<int,~str>; // Type arguments used in a type expression
447+
type t = LinearMap<int,~str>; // Type arguments used in a type expression
448448
let x = id::<int>(10); // Type arguments used in a call expression
449449
# }
450450
~~~~
@@ -3251,6 +3251,28 @@ of runtime logging modules follows.
32513251
* `::rt::backtrace` Log a backtrace on task failure
32523252
* `::rt::callback` Unused
32533253

3254+
#### Logging Expressions
3255+
3256+
Rust provides several macros to log information. Here's a simple Rust program
3257+
that demonstrates all four of them:
3258+
3259+
```rust
3260+
fn main() {
3261+
error!("This is an error log")
3262+
warn!("This is a warn log")
3263+
info!("this is an info log")
3264+
debug!("This is a debug log")
3265+
}
3266+
```
3267+
3268+
These four log levels correspond to levels 1-4, as controlled by `RUST_LOG`:
3269+
3270+
```bash
3271+
$ RUST_LOG=rust=3 ./rust
3272+
rust: ~"\"This is an error log\""
3273+
rust: ~"\"This is a warn log\""
3274+
rust: ~"\"this is an info log\""
3275+
```
32543276

32553277
# Appendix: Rationales and design tradeoffs
32563278

branches/dist-snap/doc/tutorial.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1888,8 +1888,8 @@ illegal to copy and pass by value.
18881888
Generic `type`, `struct`, and `enum` declarations follow the same pattern:
18891889

18901890
~~~~
1891-
# use core::hashmap::HashMap;
1892-
type Set<T> = HashMap<T, ()>;
1891+
# use core::hashmap::linear::LinearMap;
1892+
type Set<T> = LinearMap<T, ()>;
18931893
18941894
struct Stack<T> {
18951895
elements: ~[T]

branches/dist-snap/src/libcore/at_vec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ pub mod raw {
208208
*/
209209
#[inline(always)]
210210
pub unsafe fn set_len<T>(v: @[T], new_len: uint) {
211-
let repr: **mut VecRepr = ::cast::reinterpret_cast(&addr_of(&v));
211+
let repr: **VecRepr = ::cast::reinterpret_cast(&addr_of(&v));
212212
(**repr).unboxed.fill = new_len * sys::size_of::<T>();
213213
}
214214

@@ -226,7 +226,7 @@ pub mod raw {
226226

227227
#[inline(always)] // really pretty please
228228
pub unsafe fn push_fast<T>(v: &mut @[T], initval: T) {
229-
let repr: **mut VecRepr = ::cast::reinterpret_cast(&v);
229+
let repr: **VecRepr = ::cast::reinterpret_cast(&v);
230230
let fill = (**repr).unboxed.fill;
231231
(**repr).unboxed.fill += sys::size_of::<T>();
232232
let p = addr_of(&((**repr).unboxed.data));

branches/dist-snap/src/libcore/cell.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
//! A mutable, nullable memory location
1212
13-
use cast::transmute_mut;
13+
use cast::transmute;
1414
use prelude::*;
1515

1616
/*
@@ -20,12 +20,16 @@ Similar to a mutable option type, but friendlier.
2020
*/
2121

2222
pub struct Cell<T> {
23-
value: Option<T>
23+
mut value: Option<T>
2424
}
2525

2626
impl<T:cmp::Eq> cmp::Eq for Cell<T> {
2727
fn eq(&self, other: &Cell<T>) -> bool {
28-
(self.value) == (other.value)
28+
unsafe {
29+
let frozen_self: &Option<T> = transmute(&mut self.value);
30+
let frozen_other: &Option<T> = transmute(&mut other.value);
31+
frozen_self == frozen_other
32+
}
2933
}
3034
fn ne(&self, other: &Cell<T>) -> bool { !self.eq(other) }
3135
}
@@ -42,7 +46,6 @@ pub fn empty_cell<T>() -> Cell<T> {
4246
pub impl<T> Cell<T> {
4347
/// Yields the value, failing if the cell is empty.
4448
fn take(&self) -> T {
45-
let mut self = unsafe { transmute_mut(self) };
4649
if self.is_empty() {
4750
fail!(~"attempt to take an empty cell");
4851
}
@@ -54,7 +57,6 @@ pub impl<T> Cell<T> {
5457
5558
/// Returns the value, failing if the cell is full.
5659
fn put_back(&self, value: T) {
57-
let mut self = unsafe { transmute_mut(self) };
5860
if !self.is_empty() {
5961
fail!(~"attempt to put a value back into a full cell");
6062
}

branches/dist-snap/src/libcore/gc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ use io;
4343
use libc::{size_t, uintptr_t};
4444
use option::{None, Option, Some};
4545
use ptr;
46-
use hashmap::HashSet;
46+
use hashmap::linear::LinearSet;
4747
use stackwalk;
4848
use sys;
4949

@@ -344,7 +344,7 @@ pub fn cleanup_stack_for_failure() {
344344
ptr::null()
345345
};
346346

347-
let mut roots = HashSet::new();
347+
let mut roots = LinearSet::new();
348348
for walk_gc_roots(need_cleanup, sentinel) |root, tydesc| {
349349
// Track roots to avoid double frees.
350350
if roots.contains(&*root) {

0 commit comments

Comments
 (0)