Skip to content

Commit 9c0d497

Browse files
committed
---
yaml --- r: 227758 b: refs/heads/try c: 997bd33 h: refs/heads/master v: v3
1 parent ba373a7 commit 9c0d497

File tree

9 files changed

+181
-149
lines changed

9 files changed

+181
-149
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: aca2057ed5fb7af3f8905b2bc01f72fa001c35c8
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4-
refs/heads/try: 81e5c1ff061d2538ce2c3832ad33202a0135558d
4+
refs/heads/try: 997bd334fbb5715ffbb10dc20f4b5af10eef306a
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/error-handling.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,9 @@ There's another way of doing this that's a bit nicer than `unwrap()`:
225225

226226
```rust,ignore
227227
let mut buffer = String::new();
228-
let input = io::stdin().read_line(&mut buffer)
229-
.ok()
230-
.expect("Failed to read line");
228+
let num_bytes_read = io::stdin().read_line(&mut buffer)
229+
.ok()
230+
.expect("Failed to read line");
231231
```
232232

233233
`ok()` converts the `Result` into an `Option`, and `expect()` does the same

branches/try/src/librustc/middle/check_match.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub use self::Constructor::*;
1212
use self::Usefulness::*;
1313
use self::WitnessPreference::*;
1414

15-
use middle::const_eval::{compare_const_vals, const_bool, const_float, const_val};
15+
use middle::const_eval::{compare_const_vals, ConstVal};
1616
use middle::const_eval::{eval_const_expr, eval_const_expr_partial};
1717
use middle::const_eval::{const_expr_to_pat, lookup_const_by_id};
1818
use middle::def::*;
@@ -111,9 +111,9 @@ pub enum Constructor {
111111
/// Enum variants.
112112
Variant(ast::DefId),
113113
/// Literal values.
114-
ConstantValue(const_val),
114+
ConstantValue(ConstVal),
115115
/// Ranges of literal values (2..5).
116-
ConstantRange(const_val, const_val),
116+
ConstantRange(ConstVal, ConstVal),
117117
/// Array patterns of length n.
118118
Slice(usize),
119119
/// Array patterns with a subslice.
@@ -262,7 +262,7 @@ fn check_for_static_nan(cx: &MatchCheckCtxt, pat: &Pat) {
262262
ast_util::walk_pat(pat, |p| {
263263
if let ast::PatLit(ref expr) = p.node {
264264
match eval_const_expr_partial(cx.tcx, &**expr, None) {
265-
Ok(const_float(f)) if f.is_nan() => {
265+
Ok(ConstVal::Float(f)) if f.is_nan() => {
266266
span_warn!(cx.tcx.sess, p.span, E0003,
267267
"unmatchable NaN in pattern, \
268268
use the is_nan method in a guard instead");
@@ -391,9 +391,9 @@ fn check_exhaustive(cx: &MatchCheckCtxt, sp: Span, matrix: &Matrix, source: ast:
391391
}
392392
}
393393

394-
fn const_val_to_expr(value: &const_val) -> P<ast::Expr> {
394+
fn const_val_to_expr(value: &ConstVal) -> P<ast::Expr> {
395395
let node = match value {
396-
&const_bool(b) => ast::LitBool(b),
396+
&ConstVal::Bool(b) => ast::LitBool(b),
397397
_ => unreachable!()
398398
};
399399
P(ast::Expr {
@@ -596,7 +596,7 @@ fn all_constructors(cx: &MatchCheckCtxt, left_ty: Ty,
596596
max_slice_length: usize) -> Vec<Constructor> {
597597
match left_ty.sty {
598598
ty::TyBool =>
599-
[true, false].iter().map(|b| ConstantValue(const_bool(*b))).collect(),
599+
[true, false].iter().map(|b| ConstantValue(ConstVal::Bool(*b))).collect(),
600600

601601
ty::TyRef(_, ty::mt { ty, .. }) => match ty.sty {
602602
ty::TySlice(_) =>
@@ -826,7 +826,7 @@ pub fn constructor_arity(cx: &MatchCheckCtxt, ctor: &Constructor, ty: Ty) -> usi
826826
}
827827

828828
fn range_covered_by_constructor(ctor: &Constructor,
829-
from: &const_val, to: &const_val) -> Option<bool> {
829+
from: &ConstVal, to: &ConstVal) -> Option<bool> {
830830
let (c_from, c_to) = match *ctor {
831831
ConstantValue(ref value) => (value, value),
832832
ConstantRange(ref from, ref to) => (from, to),

0 commit comments

Comments
 (0)