Skip to content

Commit 3d71884

Browse files
committed
---
yaml --- r: 148807 b: refs/heads/try2 c: 891ada9 h: refs/heads/master i: 148805: 5566bea 148803: 7db4e8f 148799: 29234b9 v: v3
1 parent e27d211 commit 3d71884

File tree

6 files changed

+9
-10
lines changed

6 files changed

+9
-10
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: b972cadf61df77b17c4b53eafaa8e3361f123dc4
8+
refs/heads/try2: 891ada9be16451e46268ea0924c1710596e7ddbb
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/librustc/middle/trans/consts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ pub fn const_lit(cx: &CrateContext, e: &ast::Expr, lit: ast::Lit)
7575
ast::LitBool(b) => C_bool(b),
7676
ast::LitNil => C_nil(),
7777
ast::LitStr(ref s, _) => C_str_slice(cx, (*s).clone()),
78-
ast::LitBinary(data) => C_binary_slice(cx, data),
78+
ast::LitBinary(ref data) => C_binary_slice(cx, *data.borrow()),
7979
}
8080
}
8181

branches/try2/src/librustdoc/clean.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,7 @@ impl ToSource for syntax::codemap::Span {
11511151
fn lit_to_str(lit: &ast::Lit) -> ~str {
11521152
match lit.node {
11531153
ast::LitStr(ref st, _) => st.get().to_owned(),
1154-
ast::LitBinary(data) => format!("{:?}", data.as_slice()),
1154+
ast::LitBinary(ref data) => format!("{:?}", data.borrow().as_slice()),
11551155
ast::LitChar(c) => ~"'" + std::char::from_u32(c).unwrap().to_str() + "'",
11561156
ast::LitInt(i, _t) => i.to_str(),
11571157
ast::LitUint(u, _t) => u.to_str(),

branches/try2/src/libsyntax/ast.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ use parse::token;
2020
use std::cell::RefCell;
2121
use std::hashmap::HashMap;
2222
use std::option::Option;
23+
use std::rc::Rc;
2324
use std::to_str::ToStr;
2425
use extra::serialize::{Encodable, Decodable, Encoder, Decoder};
2526

@@ -724,7 +725,7 @@ pub type Lit = Spanned<Lit_>;
724725
#[deriving(Clone, Eq, Encodable, Decodable, IterBytes)]
725726
pub enum Lit_ {
726727
LitStr(InternedString, StrStyle),
727-
LitBinary(@[u8]),
728+
LitBinary(Rc<~[u8]>),
728729
LitChar(u32),
729730
LitInt(i64, IntTy),
730731
LitUint(u64, UintTy),

branches/try2/src/libsyntax/ext/source_util.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ use print::pprust;
2222

2323
use std::io;
2424
use std::io::File;
25+
use std::rc::Rc;
2526
use std::str;
2627

2728
// These macros all relate to the file system; they either return
@@ -135,8 +136,6 @@ pub fn expand_include_str(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
135136
pub fn expand_include_bin(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
136137
-> base::MacResult
137138
{
138-
use std::at_vec;
139-
140139
let file = match get_single_str_from_tts(cx, sp, tts, "include_bin!") {
141140
Some(f) => f,
142141
None => return MacResult::dummy_expr()
@@ -148,8 +147,7 @@ pub fn expand_include_bin(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
148147
return MacResult::dummy_expr();
149148
}
150149
Ok(bytes) => {
151-
let bytes = at_vec::to_managed_move(bytes);
152-
base::MRExpr(cx.expr_lit(sp, ast::LitBinary(bytes)))
150+
base::MRExpr(cx.expr_lit(sp, ast::LitBinary(Rc::new(bytes))))
153151
}
154152
}
155153
}

branches/try2/src/libsyntax/print/pprust.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2212,10 +2212,10 @@ pub fn print_literal(s: &mut State, lit: &ast::Lit) {
22122212
ast::LitBool(val) => {
22132213
if val { word(&mut s.s, "true"); } else { word(&mut s.s, "false"); }
22142214
}
2215-
ast::LitBinary(arr) => {
2215+
ast::LitBinary(ref arr) => {
22162216
ibox(s, indent_unit);
22172217
word(&mut s.s, "[");
2218-
commasep_cmnt(s, Inconsistent, arr, |s, u| word(&mut s.s, format!("{}", *u)),
2218+
commasep_cmnt(s, Inconsistent, *arr.borrow(), |s, u| word(&mut s.s, format!("{}", *u)),
22192219
|_| lit.span);
22202220
word(&mut s.s, "]");
22212221
end(s);

0 commit comments

Comments
 (0)