Skip to content

Commit 876d78a

Browse files
committed
---
yaml --- r: 64183 b: refs/heads/snap-stage3 c: 663a959 h: refs/heads/master i: 64181: f608e21 64179: 9e35e02 64175: b3c50db v: v3
1 parent ca4ba5a commit 876d78a

File tree

5 files changed

+26
-99
lines changed

5 files changed

+26
-99
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 294999c3508ef4cbc2d221f531a6255c82fb95d3
4+
refs/heads/snap-stage3: 663a9597b24f841f44e560e2478225353dbcec30
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/libstd/libc.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,13 @@ pub mod types {
186186
// Standard types that are opaque or common, so are not per-target.
187187
pub mod common {
188188
pub mod c95 {
189+
/**
190+
Type used to construct void pointers for use with C.
191+
192+
This type is only useful as a pointer target. Do not use it as a
193+
return type for FFI functions which have the `void` return type in
194+
C. Use the unit type `()` or omit the return type instead.
195+
*/
189196
pub enum c_void {}
190197
pub enum FILE {}
191198
pub enum fpos_t {}

branches/snap-stage3/src/libstd/ptr.rs

Lines changed: 0 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ use option::{Option, Some, None};
1515
use sys;
1616
use unstable::intrinsics;
1717
use util::swap;
18-
use ops::{Add,Sub};
19-
use num::Int;
2018

2119
#[cfg(not(test))] use cmp::{Eq, Ord};
2220
use uint;
@@ -386,46 +384,6 @@ impl<T> Ord for *const T {
386384
}
387385
}
388386

389-
#[cfg(not(test))]
390-
impl<T, I: Int> Add<I, *T> for *T {
391-
/// Add an integer value to a pointer to get an offset pointer.
392-
/// Is calculated according to the size of the type pointed to.
393-
#[inline]
394-
pub fn add(&self, rhs: &I) -> *T {
395-
self.offset(rhs.to_int() as uint)
396-
}
397-
}
398-
399-
#[cfg(not(test))]
400-
impl<T, I: Int> Sub<I, *T> for *T {
401-
/// Subtract an integer value from a pointer to get an offset pointer.
402-
/// Is calculated according to the size of the type pointed to.
403-
#[inline]
404-
pub fn sub(&self, rhs: &I) -> *T {
405-
self.offset(-rhs.to_int() as uint)
406-
}
407-
}
408-
409-
#[cfg(not(test))]
410-
impl<T, I: Int> Add<I, *mut T> for *mut T {
411-
/// Add an integer value to a pointer to get an offset pointer.
412-
/// Is calculated according to the size of the type pointed to.
413-
#[inline]
414-
pub fn add(&self, rhs: &I) -> *mut T {
415-
self.offset(rhs.to_int() as uint)
416-
}
417-
}
418-
419-
#[cfg(not(test))]
420-
impl<T, I: Int> Sub<I, *mut T> for *mut T {
421-
/// Subtract an integer value from a pointer to get an offset pointer.
422-
/// Is calculated according to the size of the type pointed to.
423-
#[inline]
424-
pub fn sub(&self, rhs: &I) -> *mut T {
425-
self.offset(-rhs.to_int() as uint)
426-
}
427-
}
428-
429387
#[cfg(test)]
430388
pub mod ptr_tests {
431389
use super::*;
@@ -543,60 +501,6 @@ pub mod ptr_tests {
543501
}
544502
}
545503

546-
#[test]
547-
fn test_ptr_addition() {
548-
use vec::raw::*;
549-
550-
unsafe {
551-
let xs = ~[5, ..16];
552-
let mut ptr = to_ptr(xs);
553-
let end = ptr + 16;
554-
555-
while ptr < end {
556-
assert_eq!(*ptr, 5);
557-
ptr = ptr + 1u;
558-
}
559-
560-
let mut xs_mut = xs.clone();
561-
let mut m_ptr = to_mut_ptr(xs_mut);
562-
let m_end = m_ptr + 16i16;
563-
564-
while m_ptr < m_end {
565-
*m_ptr += 5;
566-
m_ptr = m_ptr + 1u8;
567-
}
568-
569-
assert_eq!(xs_mut, ~[10, ..16]);
570-
}
571-
}
572-
573-
#[test]
574-
fn test_ptr_subtraction() {
575-
use vec::raw::*;
576-
577-
unsafe {
578-
let xs = ~[0,1,2,3,4,5,6,7,8,9];
579-
let mut idx = 9i8;
580-
let ptr = to_ptr(xs);
581-
582-
while idx >= 0i8 {
583-
assert_eq!(*(ptr + idx), idx as int);
584-
idx = idx - 1i8;
585-
}
586-
587-
let mut xs_mut = xs.clone();
588-
let mut m_start = to_mut_ptr(xs_mut);
589-
let mut m_ptr = m_start + 9u32;
590-
591-
while m_ptr >= m_start {
592-
*m_ptr += *m_ptr;
593-
m_ptr = m_ptr - 1i8;
594-
}
595-
596-
assert_eq!(xs_mut, ~[0,2,4,6,8,10,12,14,16,18]);
597-
}
598-
}
599-
600504
#[test]
601505
fn test_ptr_array_each_with_len() {
602506
unsafe {

branches/snap-stage3/src/libsyntax/parse/parser.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,10 +1074,9 @@ impl Parser {
10741074
// This version of parse arg doesn't necessarily require
10751075
// identifier names.
10761076
pub fn parse_arg_general(&self, require_name: bool) -> arg {
1077-
let mut is_mutbl = false;
1077+
let mut is_mutbl = self.eat_keyword(keywords::Mut);
10781078
let pat = if require_name || self.is_named_argument() {
10791079
self.parse_arg_mode();
1080-
is_mutbl = self.eat_keyword(keywords::Mut);
10811080
let pat = self.parse_pat();
10821081

10831082
if is_mutbl && !ast_util::pat_is_ident(pat) {
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2013 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+
#[allow(default_methods)];
12+
13+
trait Foo {
14+
fn foo(&self, mut v: int) { v = 1; }
15+
}
16+
17+
fn main() {}

0 commit comments

Comments
 (0)