Skip to content

Commit 188f8f0

Browse files
committed
auto merge of #18978 : jakub-/rust/roll-up, r=cmr
2 parents 7e43f41 + ef6c72c commit 188f8f0

File tree

20 files changed

+501
-133
lines changed

20 files changed

+501
-133
lines changed

src/doc/guide-pointers.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,11 @@ pass-by-reference. Basically, languages can make two choices (this is made
133133
up syntax, it's not Rust):
134134

135135
```{notrust,ignore}
136-
fn foo(x) {
136+
func foo(x) {
137137
x = 5
138138
}
139139
140-
fn main() {
140+
func main() {
141141
i = 1
142142
foo(i)
143143
// what is the value of i here?
@@ -153,11 +153,11 @@ So what do pointers have to do with this? Well, since pointers point to a
153153
location in memory...
154154

155155
```{notrust,ignore}
156-
fn foo(&int x) {
156+
func foo(&int x) {
157157
*x = 5
158158
}
159159
160-
fn main() {
160+
func main() {
161161
i = 1
162162
foo(&i)
163163
// what is the value of i here?
@@ -192,13 +192,13 @@ When you combine pointers and functions, it's easy to accidentally invalidate
192192
the memory the pointer is pointing to. For example:
193193

194194
```{notrust,ignore}
195-
fn make_pointer(): &int {
195+
func make_pointer(): &int {
196196
x = 5;
197197
198198
return &x;
199199
}
200200
201-
fn main() {
201+
func main() {
202202
&int i = make_pointer();
203203
*i = 5; // uh oh!
204204
}
@@ -214,11 +214,11 @@ issue. Two pointers are said to alias when they point at the same location
214214
in memory. Like this:
215215

216216
```{notrust,ignore}
217-
fn mutate(&int i, int j) {
217+
func mutate(&int i, int j) {
218218
*i = j;
219219
}
220220
221-
fn main() {
221+
func main() {
222222
x = 5;
223223
y = &x;
224224
z = &x; //y and z are aliased

src/etc/snapshot.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@ def full_snapshot_name(date, rev, platform, hsh):
7575

7676

7777
def get_kernel(triple):
78-
os_name = triple.split('-')[2]
78+
t = triple.split('-')
79+
if len(t) == 2:
80+
os_name = t[1]
81+
else:
82+
os_name = t[2]
7983
if os_name == "windows":
8084
return "winnt"
8185
if os_name == "darwin":

src/liballoc/rc.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,9 @@ pub struct Rc<T> {
179179
_noshare: marker::NoSync
180180
}
181181

182-
#[stable]
183182
impl<T> Rc<T> {
184183
/// Constructs a new reference-counted pointer.
184+
#[stable]
185185
pub fn new(value: T) -> Rc<T> {
186186
unsafe {
187187
Rc {
@@ -200,9 +200,7 @@ impl<T> Rc<T> {
200200
}
201201
}
202202
}
203-
}
204203

205-
impl<T> Rc<T> {
206204
/// Downgrades the reference-counted pointer to a weak reference.
207205
#[experimental = "Weak pointers may not belong in this module"]
208206
pub fn downgrade(&self) -> Weak<T> {

src/libcollections/tree/set.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -504,9 +504,9 @@ impl<T: Ord> TreeSet<T> {
504504
/// # Example
505505
///
506506
/// ```
507-
/// use std::collections::BTreeSet;
507+
/// use std::collections::TreeSet;
508508
///
509-
/// let mut set = BTreeSet::new();
509+
/// let mut set = TreeSet::new();
510510
///
511511
/// assert_eq!(set.insert(2i), true);
512512
/// assert_eq!(set.insert(2i), false);
@@ -522,9 +522,9 @@ impl<T: Ord> TreeSet<T> {
522522
/// # Example
523523
///
524524
/// ```
525-
/// use std::collections::BTreeSet;
525+
/// use std::collections::TreeSet;
526526
///
527-
/// let mut set = BTreeSet::new();
527+
/// let mut set = TreeSet::new();
528528
///
529529
/// set.insert(2i);
530530
/// assert_eq!(set.remove(&2), true);

src/libcollections/vec.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,6 @@ impl<T> Vec<T> {
645645
/// assert!(vec.capacity() >= 3);
646646
/// ```
647647
#[stable]
648-
#[unstable = "matches collection reform specification, waiting for dust to settle"]
649648
pub fn shrink_to_fit(&mut self) {
650649
if mem::size_of::<T>() == 0 { return }
651650

src/libcore/any.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ use intrinsics::TypeId;
8888
#[stable]
8989
pub trait Any: 'static {
9090
/// Get the `TypeId` of `self`
91+
#[stable]
9192
fn get_type_id(&self) -> TypeId;
9293
}
9394

@@ -117,7 +118,6 @@ pub trait AnyRefExt<'a> {
117118
#[stable]
118119
impl<'a> AnyRefExt<'a> for &'a Any {
119120
#[inline]
120-
#[stable]
121121
fn is<T: 'static>(self) -> bool {
122122
// Get TypeId of the type this function is instantiated with
123123
let t = TypeId::of::<T>();
@@ -130,7 +130,6 @@ impl<'a> AnyRefExt<'a> for &'a Any {
130130
}
131131

132132
#[inline]
133-
#[unstable = "naming conventions around acquiring references may change"]
134133
fn downcast_ref<T: 'static>(self) -> Option<&'a T> {
135134
if self.is::<T>() {
136135
unsafe {
@@ -159,7 +158,6 @@ pub trait AnyMutRefExt<'a> {
159158
#[stable]
160159
impl<'a> AnyMutRefExt<'a> for &'a mut Any {
161160
#[inline]
162-
#[unstable = "naming conventions around acquiring references may change"]
163161
fn downcast_mut<T: 'static>(self) -> Option<&'a mut T> {
164162
if self.is::<T>() {
165163
unsafe {

0 commit comments

Comments
 (0)