Skip to content

Commit 5dcfcb5

Browse files
committed
---
yaml --- r: 138246 b: refs/heads/master c: f68d4d3 h: refs/heads/master v: v3
1 parent 5c01f53 commit 5dcfcb5

File tree

257 files changed

+3330
-1442
lines changed

Some content is hidden

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

257 files changed

+3330
-1442
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: 93e589c8726d91c084932af370742c15d97a0c24
2+
refs/heads/master: f68d4d39f7d465f9584fdbfc14523f964b176fe3
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5

trunk/mk/crates.mk

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252
TARGET_CRATES := libc std green native flate arena glob term semver \
5353
uuid serialize sync getopts collections num test time rand \
54-
url log regex graphviz core rbml rlibc alloc rustrt \
54+
url log regex graphviz core rbml rlibc alloc debug rustrt \
5555
unicode
5656
HOST_CRATES := syntax rustc rustdoc fourcc hexfloat regex_macros fmt_macros \
5757
rustc_llvm rustc_back
@@ -63,19 +63,20 @@ DEPS_libc := core
6363
DEPS_rlibc := core
6464
DEPS_unicode := core
6565
DEPS_alloc := core libc native:jemalloc
66+
DEPS_debug := std
6667
DEPS_rustrt := alloc core libc collections native:rustrt_native
6768
DEPS_std := core libc rand alloc collections rustrt sync unicode \
6869
native:rust_builtin native:backtrace
6970
DEPS_graphviz := std
7071
DEPS_green := std native:context_switch
7172
DEPS_native := std
72-
DEPS_syntax := std term serialize log fmt_macros arena libc
73+
DEPS_syntax := std term serialize log fmt_macros debug arena libc
7374
DEPS_rustc := syntax flate arena serialize getopts rbml \
74-
time log graphviz rustc_llvm rustc_back
75+
time log graphviz debug rustc_llvm rustc_back
7576
DEPS_rustc_llvm := native:rustllvm libc std
7677
DEPS_rustc_back := std syntax rustc_llvm flate log libc
7778
DEPS_rustdoc := rustc native:hoedown serialize getopts \
78-
test time
79+
test time debug
7980
DEPS_flate := std native:miniz
8081
DEPS_arena := std
8182
DEPS_graphviz := std

trunk/src/compiletest/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub fn load_errors(re: &Regex, testfile: &Path) -> Vec<ExpectedError> {
3131
fn parse_expected(line_num: uint, line: &str, re: &Regex) -> Option<ExpectedError> {
3232
re.captures(line).and_then(|caps| {
3333
let adjusts = caps.name("adjusts").len();
34-
let kind = caps.name("kind").to_ascii().to_lowercase().into_string();
34+
let kind = caps.name("kind").to_ascii().to_lower().into_string();
3535
let msg = caps.name("msg").trim().to_string();
3636

3737
debug!("line={} kind={} msg={}", line_num, kind, msg);

trunk/src/doc/reference.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ following forms:
341341
escaped in order to denote its ASCII encoding `0x5C`.
342342

343343
Raw byte string literals do not process any escapes. They start with the
344-
character `U+0062` (`b`), followed by `U+0072` (`r`), followed by zero or more
344+
character `U+0072` (`r`), followed by `U+0062` (`b`), followed by zero or more
345345
of the character `U+0023` (`#`), and a `U+0022` (double-quote) character. The
346346
_raw string body_ is not defined in the EBNF grammar above: it can contain any
347347
sequence of ASCII characters and is terminated only by another `U+0022`
@@ -1177,7 +1177,7 @@ This is a list of behaviour not considered *unsafe* in Rust terms, but that may
11771177
be undesired.
11781178

11791179
* Deadlocks
1180-
* Reading data from private fields (`std::repr`)
1180+
* Reading data from private fields (`std::repr`, `format!("{:?}", x)`)
11811181
* Leaks due to reference count cycles, even in the global heap
11821182
* Exiting without calling destructors
11831183
* Sending signals
@@ -2279,6 +2279,8 @@ These types help drive the compiler's analysis
22792279
: The lifetime parameter should be considered invariant
22802280
* `malloc`
22812281
: Allocate memory on the managed heap.
2282+
* `opaque`
2283+
: ___Needs filling in___
22822284
* `owned_box`
22832285
: ___Needs filling in___
22842286
* `stack_exhausted`
@@ -2293,6 +2295,8 @@ These types help drive the compiler's analysis
22932295
: The type parameter should be considered invariant
22942296
* `ty_desc`
22952297
: ___Needs filling in___
2298+
* `ty_visitor`
2299+
: ___Needs filling in___
22962300

22972301
> **Note:** This list is likely to become out of date. We should auto-generate
22982302
> it from `librustc/middle/lang_items.rs`.

trunk/src/liballoc/arc.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,8 @@ mod tests {
317317

318318
assert_eq!((*arc_v)[2], 3);
319319
assert_eq!((*arc_v)[4], 5);
320+
321+
info!("{:?}", arc_v);
320322
}
321323

322324
#[test]

trunk/src/liballoc/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ extern crate libc;
7777

7878
// Allow testing this library
7979

80+
#[cfg(test)] extern crate debug;
8081
#[cfg(test)] extern crate native;
8182
#[cfg(test)] #[phase(plugin, link)] extern crate std;
8283
#[cfg(test)] #[phase(plugin, link)] extern crate log;

trunk/src/libcollections/bitv.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@
5959
//! println!("There are {} primes below {}", num_primes, max_prime);
6060
//! ```
6161
62+
#![allow(missing_doc)]
63+
6264
use core::prelude::*;
6365

6466
use core::cmp;
@@ -1638,6 +1640,7 @@ mod tests {
16381640
use std::prelude::*;
16391641
use std::iter::range_step;
16401642
use std::u32;
1643+
use std::uint;
16411644
use std::rand;
16421645
use std::rand::Rng;
16431646
use test::Bencher;

trunk/src/libcollections/hash/sip.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ mod tests {
402402
debug!("siphash test {}: {}", t, buf);
403403
let vec = u8to64_le!(vecs[t], 0);
404404
let out = hash_with_keys(k0, k1, &Bytes(buf.as_slice()));
405-
debug!("got {}, expected {}", out, vec);
405+
debug!("got {:?}, expected {:?}", out, vec);
406406
assert_eq!(vec, out);
407407

408408
state_full.reset();
@@ -412,6 +412,9 @@ mod tests {
412412
let v = to_hex_str(&vecs[t]);
413413
debug!("{}: ({}) => inc={} full={}", t, v, i, f);
414414

415+
debug!("full state {:?}", state_full);
416+
debug!("inc state {:?}", state_inc);
417+
415418
assert_eq!(f, i);
416419
assert_eq!(f, v);
417420

trunk/src/libcollections/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ extern crate alloc;
3333

3434
#[cfg(test)] extern crate native;
3535
#[cfg(test)] extern crate test;
36+
#[cfg(test)] extern crate debug;
3637

3738
#[cfg(test)] #[phase(plugin, link)] extern crate std;
3839
#[cfg(test)] #[phase(plugin, link)] extern crate log;

trunk/src/libcollections/ringbuf.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -551,21 +551,21 @@ mod tests {
551551
assert_eq!(d.len(), 3u);
552552
d.push(137);
553553
assert_eq!(d.len(), 4u);
554-
debug!("{}", d.front());
554+
debug!("{:?}", d.front());
555555
assert_eq!(*d.front().unwrap(), 42);
556-
debug!("{}", d.back());
556+
debug!("{:?}", d.back());
557557
assert_eq!(*d.back().unwrap(), 137);
558558
let mut i = d.pop_front();
559-
debug!("{}", i);
559+
debug!("{:?}", i);
560560
assert_eq!(i, Some(42));
561561
i = d.pop();
562-
debug!("{}", i);
562+
debug!("{:?}", i);
563563
assert_eq!(i, Some(137));
564564
i = d.pop();
565-
debug!("{}", i);
565+
debug!("{:?}", i);
566566
assert_eq!(i, Some(137));
567567
i = d.pop();
568-
debug!("{}", i);
568+
debug!("{:?}", i);
569569
assert_eq!(i, Some(17));
570570
assert_eq!(d.len(), 0u);
571571
d.push(3);
@@ -576,10 +576,10 @@ mod tests {
576576
assert_eq!(d.len(), 3u);
577577
d.push_front(1);
578578
assert_eq!(d.len(), 4u);
579-
debug!("{}", d.get(0));
580-
debug!("{}", d.get(1));
581-
debug!("{}", d.get(2));
582-
debug!("{}", d.get(3));
579+
debug!("{:?}", d.get(0));
580+
debug!("{:?}", d.get(1));
581+
debug!("{:?}", d.get(2));
582+
debug!("{:?}", d.get(3));
583583
assert_eq!(*d.get(0), 1);
584584
assert_eq!(*d.get(1), 2);
585585
assert_eq!(*d.get(2), 3);

trunk/src/libcore/intrinsics.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,21 +58,17 @@ pub struct TyDesc {
5858
pub drop_glue: GlueFn,
5959

6060
// Called by reflection visitor to visit a value of type `T`
61-
#[cfg(stage0)]
6261
pub visit_glue: GlueFn,
6362

6463
// Name corresponding to the type
6564
pub name: &'static str,
6665
}
6766

68-
#[cfg(stage0)]
6967
#[lang="opaque"]
7068
pub enum Opaque { }
7169

72-
#[cfg(stage0)]
7370
pub type Disr = u64;
7471

75-
#[cfg(stage0)]
7672
#[lang="ty_visitor"]
7773
pub trait TyVisitor {
7874
fn visit_bot(&mut self) -> bool;
@@ -331,6 +327,8 @@ extern "rust-intrinsic" {
331327
/// Returns `true` if a type is managed (will be allocated on the local heap)
332328
pub fn owns_managed<T>() -> bool;
333329

330+
pub fn visit_tydesc(td: *const TyDesc, tv: &mut TyVisitor);
331+
334332
/// Calculates the offset from a pointer. The offset *must* be in-bounds of
335333
/// the object, or one-byte-past-the-end. An arithmetic overflow is also
336334
/// undefined behaviour.

trunk/src/libdebug/fmt.rs

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
//! Implementation of the `{:?}` format qualifier
12+
//!
13+
//! This module contains the `Poly` trait which is used to implement the `{:?}`
14+
//! format expression in formatting macros. This trait is defined for all types
15+
//! automatically, so it is likely not necessary to use this module manually
16+
17+
use std::fmt;
18+
19+
use repr;
20+
21+
/// Format trait for the `?` character
22+
pub trait Poly {
23+
/// Formats the value using the given formatter.
24+
#[experimental]
25+
fn fmt(&self, &mut fmt::Formatter) -> fmt::Result;
26+
}
27+
28+
#[doc(hidden)]
29+
pub fn secret_poly<T: Poly>(x: &T, fmt: &mut fmt::Formatter) -> fmt::Result {
30+
// FIXME #11938 - UFCS would make us able call the this method
31+
// directly Poly::fmt(x, fmt).
32+
x.fmt(fmt)
33+
}
34+
35+
impl<T> Poly for T {
36+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
37+
match (f.width, f.precision) {
38+
(None, None) => {
39+
match repr::write_repr(f, self) {
40+
Ok(()) => Ok(()),
41+
Err(..) => Err(fmt::WriteError),
42+
}
43+
}
44+
45+
// If we have a specified width for formatting, then we have to make
46+
// this allocation of a new string
47+
_ => {
48+
let s = repr::repr_to_string(self);
49+
f.pad(s.as_slice())
50+
}
51+
}
52+
}
53+
}

trunk/src/libdebug/lib.rs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
//! Debugging utilities for Rust programs
12+
//!
13+
//! This crate is intended to provide useful functionality when debugging
14+
//! programs, such as reflection for printing values. This crate is currently
15+
//! entirely experimental as its makeup will likely change over time.
16+
//! Additionally, it is not guaranteed that functionality such as reflection
17+
//! will persist into the future.
18+
19+
#![crate_name = "debug"]
20+
#![experimental]
21+
#![license = "MIT/ASL2"]
22+
#![crate_type = "rlib"]
23+
#![crate_type = "dylib"]
24+
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
25+
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
26+
html_root_url = "http://doc.rust-lang.org/nightly/")]
27+
#![experimental]
28+
#![feature(macro_rules)]
29+
#![allow(experimental)]
30+
31+
pub mod fmt;
32+
pub mod reflect;
33+
pub mod repr;

0 commit comments

Comments
 (0)