Skip to content

Commit 6ddbf52

Browse files
committed
---
yaml --- r: 187109 b: refs/heads/try c: f9ef8cd h: refs/heads/master i: 187107: 563f3de v: v3
1 parent 19860a8 commit 6ddbf52

File tree

8 files changed

+477
-391
lines changed

8 files changed

+477
-391
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: b4c965ee803a4521d8b4575f634e036f93e408f3
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 3a96d6a9818fe2affc98a187fb1065120458cee9
5-
refs/heads/try: 13ea9062a918e3e60d82186135610a575bf92394
5+
refs/heads/try: f9ef8cd55512842f2481aac6332dbfb92df58c52
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/compiletest/compiletest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#![feature(env)]
2424
#![feature(core)]
2525

26-
#![deny(warnings)]
26+
// #![deny(warnings)]
2727

2828
extern crate test;
2929
extern crate getopts;

branches/try/src/libcollections/str.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ pub trait StrExt: Index<RangeFull, Output = str> {
706706
/// ```
707707
#[unstable(feature = "collections",
708708
reason = "might have its iterator type changed")]
709-
fn match_indices<'a>(&'a self, pat: &'a str) -> MatchIndices<'a> {
709+
fn match_indices<'a, 'b>(&'a self, pat: &'b str) -> MatchIndices<'a, &'b str> {
710710
core_str::StrExt::match_indices(&self[..], pat)
711711
}
712712

@@ -723,7 +723,7 @@ pub trait StrExt: Index<RangeFull, Output = str> {
723723
/// ```
724724
#[unstable(feature = "collections",
725725
reason = "might get removed in the future in favor of a more generic split()")]
726-
fn split_str<'a>(&'a self, pat: &'a str) -> SplitStr<'a> {
726+
fn split_str<'a, 'b>(&'a self, pat: &'b str) -> SplitStr<'a, &'b str> {
727727
core_str::StrExt::split_str(&self[..], pat)
728728
}
729729

branches/try/src/libcore/char.rs

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ use option::Option;
2222
use slice::SliceExt;
2323

2424
// UTF-8 ranges and tags for encoding characters
25-
static TAG_CONT: u8 = 0b1000_0000u8;
26-
static TAG_TWO_B: u8 = 0b1100_0000u8;
27-
static TAG_THREE_B: u8 = 0b1110_0000u8;
28-
static TAG_FOUR_B: u8 = 0b1111_0000u8;
29-
static MAX_ONE_B: u32 = 0x80u32;
30-
static MAX_TWO_B: u32 = 0x800u32;
31-
static MAX_THREE_B: u32 = 0x10000u32;
25+
const TAG_CONT: u8 = 0b1000_0000u8;
26+
const TAG_TWO_B: u8 = 0b1100_0000u8;
27+
const TAG_THREE_B: u8 = 0b1110_0000u8;
28+
const TAG_FOUR_B: u8 = 0b1111_0000u8;
29+
const MAX_ONE_B: u32 = 0x80u32;
30+
const MAX_TWO_B: u32 = 0x800u32;
31+
const MAX_THREE_B: u32 = 0x10000u32;
3232

3333
/*
3434
Lu Uppercase_Letter an uppercase letter
@@ -398,11 +398,14 @@ impl CharExt for char {
398398
#[stable(feature = "rust1", since = "1.0.0")]
399399
fn len_utf8(self) -> usize {
400400
let code = self as u32;
401-
match () {
402-
_ if code < MAX_ONE_B => 1,
403-
_ if code < MAX_TWO_B => 2,
404-
_ if code < MAX_THREE_B => 3,
405-
_ => 4,
401+
if code < MAX_ONE_B {
402+
1
403+
} else if code < MAX_TWO_B {
404+
2
405+
} else if code < MAX_THREE_B {
406+
3
407+
} else {
408+
4
406409
}
407410
}
408411

branches/try/src/libcore/slice.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,8 @@ macro_rules! iterator {
657657
fn next(&mut self) -> Option<$elem> {
658658
// could be implemented with slices, but this avoids bounds checks
659659
unsafe {
660+
::intrinsics::assume(!self.ptr.is_null());
661+
::intrinsics::assume(!self.end.is_null());
660662
if self.ptr == self.end {
661663
None
662664
} else {
@@ -693,6 +695,8 @@ macro_rules! iterator {
693695
fn next_back(&mut self) -> Option<$elem> {
694696
// could be implemented with slices, but this avoids bounds checks
695697
unsafe {
698+
::intrinsics::assume(!self.ptr.is_null());
699+
::intrinsics::assume(!self.end.is_null());
696700
if self.end == self.ptr {
697701
None
698702
} else {

0 commit comments

Comments
 (0)