Skip to content

Commit 2c55576

Browse files
committed
---
yaml --- r: 232943 b: refs/heads/try c: cac4a1c h: refs/heads/master i: 232941: be3e266 232939: be4a3ef 232935: 782f7a1 232927: b425d71 v: v3
1 parent 4e90108 commit 2c55576

File tree

43 files changed

+794
-683
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+794
-683
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: edeb4f1c86cbf6af8ef9874d4b3af50f721ea1b8
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4-
refs/heads/try: a520568ae7dea13430c3d9ba5b3fb9596d863791
4+
refs/heads/try: cac4a1c5c8818f74b7bfb5f49ea6f4f32f6345a1
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/src/doc/trpl/rust-inside-other-languages.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,17 @@ And finally, we can try running it:
217217

218218
```bash
219219
$ ruby embed.rb
220+
Thread finished with count=5000000
221+
Thread finished with count=5000000
222+
Thread finished with count=5000000
223+
Thread finished with count=5000000
224+
Thread finished with count=5000000
225+
Thread finished with count=5000000
226+
Thread finished with count=5000000
227+
Thread finished with count=5000000
228+
Thread finished with count=5000000
229+
Thread finished with count=5000000
230+
done!
220231
done!
221232
$
222233
```

branches/try/src/doc/trpl/traits.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ fn normal<T: ConvertTo<i64>>(x: &T) -> i64 {
390390

391391
// can be called with T == i64
392392
fn inverse<T>() -> T
393-
// this is using ConvertTo as if it were "ConvertFrom<i32>"
393+
// this is using ConvertTo as if it were "ConvertTo<i64>"
394394
where i32: ConvertTo<T> {
395395
42.convert()
396396
}

branches/try/src/libcollections/btree/node.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ impl<K, V> Drop for Node<K, V> {
296296
self.destroy();
297297
}
298298

299-
self.keys = unsafe { Unique::new(0 as *mut K) };
299+
self.keys = unsafe { Unique::new(ptr::null_mut()) };
300300
}
301301
}
302302

branches/try/src/libcollections/vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1135,7 +1135,7 @@ impl<T> ops::Deref for Vec<T> {
11351135
fn deref(&self) -> &[T] {
11361136
unsafe {
11371137
let p = self.buf.ptr();
1138-
assume(p != 0 as *mut T);
1138+
assume(!p.is_null());
11391139
slice::from_raw_parts(p, self.len)
11401140
}
11411141
}

branches/try/src/libcore/ptr.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pub use intrinsics::write_bytes;
5151
/// ```
5252
#[inline]
5353
#[stable(feature = "rust1", since = "1.0.0")]
54-
pub fn null<T>() -> *const T { 0 as *const T }
54+
pub const fn null<T>() -> *const T { 0 as *const T }
5555

5656
/// Creates a null mutable raw pointer.
5757
///
@@ -65,7 +65,7 @@ pub fn null<T>() -> *const T { 0 as *const T }
6565
/// ```
6666
#[inline]
6767
#[stable(feature = "rust1", since = "1.0.0")]
68-
pub fn null_mut<T>() -> *mut T { 0 as *mut T }
68+
pub const fn null_mut<T>() -> *mut T { 0 as *mut T }
6969

7070
/// Swaps the values at two mutable locations of the same type, without
7171
/// deinitialising either. They may overlap, unlike `mem::swap` which is
@@ -163,7 +163,7 @@ impl<T: ?Sized> *const T {
163163
#[stable(feature = "rust1", since = "1.0.0")]
164164
#[inline]
165165
pub fn is_null(self) -> bool where T: Sized {
166-
self == 0 as *const T
166+
self == null()
167167
}
168168

169169
/// Returns `None` if the pointer is null, or else returns a reference to
@@ -212,7 +212,7 @@ impl<T: ?Sized> *mut T {
212212
#[stable(feature = "rust1", since = "1.0.0")]
213213
#[inline]
214214
pub fn is_null(self) -> bool where T: Sized {
215-
self == 0 as *mut T
215+
self == null_mut()
216216
}
217217

218218
/// Returns `None` if the pointer is null, or else returns a reference to

branches/try/src/liblog/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ use std::io::{self, Stderr};
184184
use std::io::prelude::*;
185185
use std::mem;
186186
use std::env;
187+
use std::ptr;
187188
use std::rt;
188189
use std::slice;
189190
use std::sync::{Once, StaticMutex};
@@ -209,11 +210,10 @@ static LOCK: StaticMutex = StaticMutex::new();
209210
/// logging statement should be run.
210211
static mut LOG_LEVEL: u32 = MAX_LOG_LEVEL;
211212

212-
static mut DIRECTIVES: *mut Vec<directive::LogDirective> =
213-
0 as *mut Vec<directive::LogDirective>;
213+
static mut DIRECTIVES: *mut Vec<directive::LogDirective> = ptr::null_mut();
214214

215215
/// Optional filter.
216-
static mut FILTER: *mut String = 0 as *mut _;
216+
static mut FILTER: *mut String = ptr::null_mut();
217217

218218
/// Debug log level
219219
pub const DEBUG: u32 = 4;

branches/try/src/librustc/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
#![feature(rustc_diagnostic_macros)]
5252
#![feature(rustc_private)]
5353
#![feature(scoped_tls)]
54-
#![feature(slice_bytes)]
5554
#![feature(slice_splits)]
5655
#![feature(slice_patterns)]
5756
#![feature(staged_api)]

0 commit comments

Comments
 (0)