Skip to content

Commit 1f356bc

Browse files
committed
---
yaml --- r: 155063 b: refs/heads/try2 c: 1872c4c h: refs/heads/master i: 155061: 4aeb2e9 155059: 263d175 155055: 97b8971 v: v3
1 parent 796c046 commit 1f356bc

File tree

8 files changed

+85
-48
lines changed

8 files changed

+85
-48
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 931b11549f3aab00aaaaff39cce33c0f7219b3b6
8+
refs/heads/try2: 1872c4c6b57a93c689c54e00d29d324ca1a10e95
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/librustc/metadata/creader.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ fn extract_crate_info(e: &Env, i: &ast::ViewItem) -> Option<CrateInfo> {
145145
match i.node {
146146
ast::ViewItemExternCrate(ident, ref path_opt, id) => {
147147
let ident = token::get_ident(ident);
148-
debug!("resolving extern crate stmt. ident: {} path_opt: {}",
148+
debug!("resolving extern crate stmt. ident: {:?} path_opt: {:?}",
149149
ident, path_opt);
150150
let name = match *path_opt {
151151
Some((ref path_str, _)) => {
@@ -281,7 +281,7 @@ fn existing_match(e: &Env, name: &str,
281281
hash: Option<&Svh>) -> Option<ast::CrateNum> {
282282
let mut ret = None;
283283
e.sess.cstore.iter_crate_data(|cnum, data| {
284-
if data.name.as_slice() != name { return }
284+
if data.name().as_slice() != name { return }
285285

286286
match hash {
287287
Some(hash) if *hash == data.hash() => { ret = Some(cnum); return }

branches/try2/src/libsyntax/ast.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,6 @@ use std::rc::Rc;
2525
use std::gc::{Gc, GC};
2626
use serialize::{Encodable, Decodable, Encoder, Decoder};
2727

28-
/// A pointer abstraction.
29-
// FIXME(eddyb) #10676 use Rc<T> in the future.
30-
pub type P<T> = Gc<T>;
31-
32-
#[allow(non_snake_case)]
33-
/// Construct a P<T> from a T value.
34-
pub fn P<T: 'static>(value: T) -> P<T> {
35-
box(GC) value
36-
}
37-
3828
// FIXME #6993: in librustc, uses of "ident" should be replaced
3929
// by just "Name".
4030

branches/try2/src/libsyntax/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ pub mod diagnostic;
6363
pub mod fold;
6464
pub mod owned_slice;
6565
pub mod parse;
66+
pub mod ptr;
6667
pub mod visit;
6768

6869
pub mod print {

branches/try2/src/libsyntax/ptr.rs

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
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+
use std::fmt;
12+
use std::fmt::Show;
13+
use std::hash::Hash;
14+
use serialize::{Encodable, Decodable, Encoder, Decoder};
15+
16+
/// An owned smart pointer.
17+
pub struct P<T> {
18+
ptr: Box<T>
19+
}
20+
21+
#[allow(non_snake_case)]
22+
/// Construct a P<T> from a T value.
23+
pub fn P<T: 'static>(value: T) -> P<T> {
24+
P {
25+
ptr: box value
26+
}
27+
}
28+
29+
impl<T: 'static> P<T> {
30+
pub fn and_then<U>(self, f: |T| -> U) -> U {
31+
f(*self.ptr)
32+
}
33+
34+
pub fn map(self, f: |T| -> T) -> P<T> {
35+
self.and_then(|x| P(f(x)))
36+
}
37+
}
38+
39+
impl<T> Deref<T> for P<T> {
40+
fn deref<'a>(&'a self) -> &'a T {
41+
&*self.ptr
42+
}
43+
}
44+
45+
impl<T: 'static + Clone> Clone for P<T> {
46+
fn clone(&self) -> P<T> {
47+
P((**self).clone())
48+
}
49+
}
50+
51+
impl<T: PartialEq> PartialEq for P<T> {
52+
fn eq(&self, other: &P<T>) -> bool {
53+
**self == **other
54+
}
55+
}
56+
57+
impl<T: Eq> Eq for P<T> {}
58+
59+
impl<T: Show> Show for P<T> {
60+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
61+
(**self).fmt(f)
62+
}
63+
}
64+
65+
impl<S, T: Hash<S>> Hash<S> for P<T> {
66+
fn hash(&self, state: &mut S) {
67+
(**self).hash(state);
68+
}
69+
}
70+
71+
impl<E, D: Decoder<E>, T: 'static + Decodable<D, E>> Decodable<D, E> for P<T> {
72+
fn decode(d: &mut D) -> Result<P<T>, E> {
73+
Decodable::decode(d).map(P)
74+
}
75+
}
76+
77+
impl<E, S: Encoder<E>, T: Encodable<S, E>> Encodable<S, E> for P<T> {
78+
fn encode(&self, s: &mut S) -> Result<(), E> {
79+
(**self).encode(s)
80+
}
81+
}

branches/try2/src/test/run-make/extern-diff-internal-name/Makefile

Lines changed: 0 additions & 6 deletions
This file was deleted.

branches/try2/src/test/run-make/extern-diff-internal-name/lib.rs

Lines changed: 0 additions & 12 deletions
This file was deleted.

branches/try2/src/test/run-make/extern-diff-internal-name/test.rs

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)