Skip to content

Commit a7de81a

Browse files
committed
auto merge of rust-lang#5203 : erickt/rust/incoming, r=brson
My merges for rust-lang#5143 missed a couple other copies. This patch corrects this, and gets stage0 to compile libsyntax with `#[deny(vecs_implicitly_copyable)]`. stage1 still fails though.
2 parents 5655ae4 + 4172fae commit a7de81a

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

src/libsyntax/ext/tt/macro_parser.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ pub fn count_names(ms: &[matcher]) -> uint {
140140
}
141141

142142
#[allow(non_implicitly_copyable_typarams)]
143-
pub fn initial_matcher_pos(+ms: ~[matcher], sep: Option<Token>, lo: BytePos)
143+
pub fn initial_matcher_pos(+ms: ~[matcher], +sep: Option<Token>, lo: BytePos)
144144
-> ~MatcherPos {
145145
let mut match_idx_hi = 0u;
146146
for ms.each |elt| {

src/libsyntax/ext/tt/macro_rules.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub fn add_new_extension(cx: ext_ctxt, sp: span, name: ident,
3232
arg: ~[ast::token_tree]) -> base::MacResult {
3333
// these spans won't matter, anyways
3434
fn ms(m: matcher_) -> matcher {
35-
spanned { node: m, span: dummy_sp() }
35+
spanned { node: copy m, span: dummy_sp() }
3636
}
3737

3838
let lhs_nm = cx.parse_sess().interner.gensym(@~"lhs");

src/libsyntax/ext/tt/transcribe.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ pure fn dup_tt_frame(f: @mut TtFrame) -> @mut TtFrame {
8585
readme: @mut (copy *f.readme),
8686
idx: f.idx,
8787
dotdotdoted: f.dotdotdoted,
88-
sep: f.sep,
88+
sep: copy f.sep,
8989
up: match f.up {
9090
Some(up_frame) => Some(dup_tt_frame(up_frame)),
9191
None => None
@@ -191,7 +191,7 @@ pub fn tt_next_token(r: @mut TtReader) -> TokenAndSpan {
191191
r.cur.idx = 0u;
192192
r.repeat_idx[r.repeat_idx.len() - 1u] += 1u;
193193
match r.cur.sep {
194-
Some(tk) => {
194+
Some(copy tk) => {
195195
r.cur_tok = tk; /* repeat same span, I guess */
196196
return ret_val;
197197
}
@@ -219,7 +219,8 @@ pub fn tt_next_token(r: @mut TtReader) -> TokenAndSpan {
219219
return ret_val;
220220
}
221221
tt_seq(sp, copy tts, copy sep, zerok) => {
222-
match lockstep_iter_size(tt_seq(sp, copy tts, sep, zerok), r) {
222+
let t = tt_seq(sp, copy tts, copy sep, zerok);
223+
match lockstep_iter_size(t, r) {
223224
lis_unconstrained => {
224225
r.sp_diag.span_fatal(
225226
sp, /* blame macro writer */
@@ -246,11 +247,11 @@ pub fn tt_next_token(r: @mut TtReader) -> TokenAndSpan {
246247
r.repeat_len.push(len);
247248
r.repeat_idx.push(0u);
248249
r.cur = @mut TtFrame {
249-
readme: @mut copy tts,
250+
readme: @mut tts,
250251
idx: 0u,
251252
dotdotdoted: true,
252253
sep: sep,
253-
up: option::Some(r.cur)
254+
up: Some(r.cur)
254255
};
255256
}
256257
}

0 commit comments

Comments
 (0)