Skip to content

Commit e5e2753

Browse files
michaelwoeristernikomatsakis
authored andcommitted
---
yaml --- r: 276469 b: refs/heads/try c: 6fdeecf h: refs/heads/master i: 276467: a4670b9
1 parent faa0668 commit e5e2753

File tree

305 files changed

+1720
-2516
lines changed

Some content is hidden

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

305 files changed

+1720
-2516
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: 6dbb0e86aec11050480beb76eade6fb805010ba7
33
refs/heads/snap-stage3: 235d77457d80b549dad3ac36d94f235208a1eafb
4-
refs/heads/try: 49312a405e14a449b98fe0056b12a40ac128be4a
4+
refs/heads/try: 6fdeecf62f413171ad9762bb42b2d794eb4f4967
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/configure

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -969,11 +969,11 @@ then
969969
LLVM_VERSION=$($LLVM_CONFIG --version)
970970

971971
case $LLVM_VERSION in
972-
(3.[6-8]*)
972+
(3.[5-8]*)
973973
msg "found ok version of LLVM: $LLVM_VERSION"
974974
;;
975975
(*)
976-
err "bad LLVM version: $LLVM_VERSION, need >=3.6"
976+
err "bad LLVM version: $LLVM_VERSION, need >=3.5"
977977
;;
978978
esac
979979
fi

branches/try/mk/crates.mk

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ TARGET_CRATES := libc std term \
5757
RUSTC_CRATES := rustc rustc_typeck rustc_mir rustc_borrowck rustc_resolve rustc_driver \
5858
rustc_trans rustc_back rustc_llvm rustc_privacy rustc_lint \
5959
rustc_data_structures rustc_front rustc_platform_intrinsics \
60-
rustc_plugin rustc_metadata rustc_passes rustc_save_analysis
60+
rustc_plugin rustc_metadata rustc_passes
6161
HOST_CRATES := syntax syntax_ext $(RUSTC_CRATES) rustdoc fmt_macros \
6262
flate arena graphviz rbml log serialize
6363
TOOLS := compiletest rustdoc rustc rustbook error_index_generator
@@ -102,7 +102,7 @@ DEPS_rustc_data_structures := std log serialize
102102
DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back rustc_borrowck \
103103
rustc_typeck rustc_mir rustc_resolve log syntax serialize rustc_llvm \
104104
rustc_trans rustc_privacy rustc_lint rustc_front rustc_plugin \
105-
rustc_metadata syntax_ext rustc_passes rustc_save_analysis
105+
rustc_metadata syntax_ext rustc_passes
106106
DEPS_rustc_front := std syntax log serialize
107107
DEPS_rustc_lint := rustc log syntax
108108
DEPS_rustc_llvm := native:rustllvm libc std rustc_bitflags
@@ -116,7 +116,6 @@ DEPS_rustc_privacy := rustc rustc_front log syntax
116116
DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back rustc_mir \
117117
log syntax serialize rustc_llvm rustc_front rustc_platform_intrinsics \
118118
rustc_const_eval
119-
DEPS_rustc_save_analysis := rustc log syntax rustc_front
120119
DEPS_rustc_typeck := rustc syntax rustc_front rustc_platform_intrinsics rustc_const_eval
121120

122121
DEPS_rustdoc := rustc rustc_driver native:hoedown serialize getopts \

branches/try/src/bootstrap/mk/Makefile.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ standalone-docs:
3838
$(Q)$(BOOTSTRAP) --step doc-standalone
3939
check:
4040
$(Q)$(BOOTSTRAP) --step check
41-
check-cargotest:
42-
$(Q)$(BOOTSTRAP) --step check-cargotest
41+
cargotest:
42+
$(Q)$(BOOTSTRAP) --step cargotest
4343
dist:
4444
$(Q)$(BOOTSTRAP) --step dist
4545

branches/try/src/doc/book/strings.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@ let s = "foo\
4444
assert_eq!("foobar", s);
4545
```
4646

47-
Note that you normally cannot access a `str` directly, but only through a `&str`
48-
reference. This is because `str` is an unsized type which requires additional
49-
runtime information to be usable. For more information see the chapter on
50-
[unsized types][ut].
51-
5247
Rust has more than only `&str`s though. A `String` is a heap-allocated string.
5348
This string is growable, and is also guaranteed to be UTF-8. `String`s are
5449
commonly created by converting from a string slice using the `to_string`
@@ -190,6 +185,5 @@ let hello_world = hello + &world;
190185
This is because `&String` can automatically coerce to a `&str`. This is a
191186
feature called ‘[`Deref` coercions][dc]’.
192187

193-
[ut]: unsized-types.html
194188
[dc]: deref-coercions.html
195189
[connect]: ../std/net/struct.TcpStream.html#method.connect

branches/try/src/doc/reference.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3911,9 +3911,6 @@ The _heap_ is a general term that describes boxes. The lifetime of an
39113911
allocation in the heap depends on the lifetime of the box values pointing to
39123912
it. Since box values may themselves be passed in and out of frames, or stored
39133913
in the heap, heap allocations may outlive the frame they are allocated within.
3914-
An allocation in the heap is guaranteed to reside at a single location in the
3915-
heap for the whole lifetime of the allocation - it will never be relocated as
3916-
a result of moving a box value.
39173914

39183915
### Memory ownership
39193916

branches/try/src/etc/CONFIGS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@ These are some links to repos with configs which ease the use of rust.
1010
* [kate-config](https://github.com/rust-lang/kate-config)
1111
* [nano-config](https://github.com/rust-lang/nano-config)
1212
* [zsh-config](https://github.com/rust-lang/zsh-config)
13+
14+
## Community-maintained Configs
15+
16+
* [.editorconfig](https://gist.github.com/derhuerst/c9d1b9309e308d9851fa) ([what is this?](http://editorconfig.org/))

branches/try/src/libcore/str/mod.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1953,10 +1953,7 @@ impl StrExt for str {
19531953

19541954
#[inline]
19551955
fn is_char_boundary(&self, index: usize) -> bool {
1956-
// 0 and len are always ok.
1957-
// Test for 0 explicitly so that it can optimize out the check
1958-
// easily and skip reading string data for that case.
1959-
if index == 0 || index == self.len() { return true; }
1956+
if index == self.len() { return true; }
19601957
match self.as_bytes().get(index) {
19611958
None => false,
19621959
Some(&b) => b < 128 || b >= 192,
@@ -2029,7 +2026,6 @@ impl StrExt for str {
20292026
self.find(pat)
20302027
}
20312028

2032-
#[inline]
20332029
fn split_at(&self, mid: usize) -> (&str, &str) {
20342030
// is_char_boundary checks that the index is in [0, .len()]
20352031
if self.is_char_boundary(mid) {

branches/try/src/librustc/dep_graph/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use self::thread::{DepGraphThreadData, DepMessage};
1212
use middle::def_id::DefId;
1313
use syntax::ast::NodeId;
14-
use ty::TyCtxt;
14+
use middle::ty::TyCtxt;
1515
use rustc_front::hir;
1616
use rustc_front::intravisit::Visitor;
1717
use std::rc::Rc;

branches/try/src/librustc/diagnostics.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,7 @@ compiled:
12611261
fn foo<T: Index<u8>>(x: T){}
12621262
12631263
#[rustc_on_unimplemented = "the type `{Self}` cannot be indexed by `{Idx}`"]
1264-
trait Index<Idx> { /* ... */ }
1264+
trait Index<Idx> { ... }
12651265
12661266
foo(true); // `bool` does not implement `Index<u8>`
12671267
```
@@ -1291,7 +1291,7 @@ compiled:
12911291
fn foo<T: Index<u8>>(x: T){}
12921292
12931293
#[rustc_on_unimplemented = "the type `{Self}` cannot be indexed by `{Idx}`"]
1294-
trait Index<Idx> { /* ... */ }
1294+
trait Index<Idx> { ... }
12951295
12961296
foo(true); // `bool` does not implement `Index<u8>`
12971297
```
@@ -1319,7 +1319,7 @@ compiled:
13191319
fn foo<T: Index<u8>>(x: T){}
13201320
13211321
#[rustc_on_unimplemented = "the type `{Self}` cannot be indexed by `{Idx}`"]
1322-
trait Index<Idx> { /* ... */ }
1322+
trait Index<Idx> { ... }
13231323
13241324
foo(true); // `bool` does not implement `Index<u8>`
13251325
```

branches/try/src/librustc/lib.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,20 +78,17 @@ pub mod back {
7878
pub use rustc_back::svh;
7979
}
8080

81-
pub mod cfg;
8281
pub mod dep_graph;
8382

8483
pub mod front {
8584
pub mod check_attr;
8685
pub mod map;
8786
}
8887

89-
pub mod infer;
90-
pub mod lint;
91-
9288
pub mod middle {
9389
pub mod astconv_util;
9490
pub mod expr_use_visitor; // STAGE0: increase glitch immunity
91+
pub mod cfg;
9592
pub mod check_match;
9693
pub mod const_eval;
9794
pub mod const_qualif;
@@ -105,6 +102,7 @@ pub mod middle {
105102
pub mod entry;
106103
pub mod free_region;
107104
pub mod intrinsicck;
105+
pub mod infer;
108106
pub mod lang_items;
109107
pub mod liveness;
110108
pub mod mem_categorization;
@@ -115,6 +113,9 @@ pub mod middle {
115113
pub mod recursion_limit;
116114
pub mod resolve_lifetime;
117115
pub mod stability;
116+
pub mod subst;
117+
pub mod traits;
118+
pub mod ty;
118119
pub mod weak_lang_items;
119120
}
120121

@@ -127,8 +128,8 @@ pub mod mir {
127128
}
128129

129130
pub mod session;
130-
pub mod traits;
131-
pub mod ty;
131+
132+
pub mod lint;
132133

133134
pub mod util {
134135
pub use rustc_back::sha2;

branches/try/src/librustc/lint/builtin.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -136,19 +136,6 @@ declare_lint! {
136136
"type parameter default erroneously allowed in invalid location"
137137
}
138138

139-
declare_lint! {
140-
pub ILLEGAL_FLOATING_POINT_CONSTANT_PATTERN,
141-
Warn,
142-
"floating-point constants cannot be used in patterns"
143-
}
144-
145-
declare_lint! {
146-
pub ILLEGAL_STRUCT_OR_ENUM_CONSTANT_PATTERN,
147-
Deny,
148-
"constants of struct or enum type can only be used in a pattern if \
149-
the struct or enum has `#[derive(PartialEq, Eq)]`"
150-
}
151-
152139
declare_lint! {
153140
pub MATCH_OF_UNIT_VARIANT_VIA_PAREN_DOTDOT,
154141
Deny,
@@ -206,8 +193,6 @@ impl LintPass for HardwiredLints {
206193
PRIVATE_IN_PUBLIC,
207194
INACCESSIBLE_EXTERN_CRATE,
208195
INVALID_TYPE_PARAM_DEFAULT,
209-
ILLEGAL_FLOATING_POINT_CONSTANT_PATTERN,
210-
ILLEGAL_STRUCT_OR_ENUM_CONSTANT_PATTERN,
211196
MATCH_OF_UNIT_VARIANT_VIA_PAREN_DOTDOT,
212197
CONST_ERR,
213198
RAW_POINTER_DERIVE,

branches/try/src/librustc/lint/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use self::TargetLint::*;
2727

2828
use dep_graph::DepNode;
2929
use middle::privacy::AccessLevels;
30-
use ty::TyCtxt;
30+
use middle::ty::TyCtxt;
3131
use session::{config, early_error, Session};
3232
use lint::{Level, LevelSource, Lint, LintId, LintArray, LintPass};
3333
use lint::{EarlyLintPass, EarlyLintPassObject, LateLintPass, LateLintPassObject};

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
use middle::def::Def;
18-
use ty::{Ty, TyCtxt};
18+
use middle::ty::{Ty, TyCtxt};
1919

2020
use syntax::codemap::Span;
2121
use rustc_front::hir as ast;

branches/try/src/librustc/cfg/construct.rs renamed to branches/try/src/librustc/middle/cfg/construct.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
// except according to those terms.
1010

1111
use rustc_data_structures::graph;
12-
use cfg::*;
12+
use middle::cfg::*;
1313
use middle::def::Def;
1414
use middle::pat_util;
15-
use ty::{self, TyCtxt};
15+
use middle::ty::{self, TyCtxt};
1616
use syntax::ast;
1717
use syntax::ptr::P;
1818

branches/try/src/librustc/cfg/graphviz.rs renamed to branches/try/src/librustc/middle/cfg/graphviz.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use graphviz::IntoCow;
1818
use syntax::ast;
1919

2020
use front::map as ast_map;
21-
use cfg;
21+
use middle::cfg;
2222

2323
pub type Node<'a> = (cfg::CFGIndex, &'a cfg::CFGNode);
2424
pub type Edge<'a> = &'a cfg::CFGEdge;

branches/try/src/librustc/cfg/mod.rs renamed to branches/try/src/librustc/middle/cfg/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//! Uses `Graph` as the underlying representation.
1313
1414
use rustc_data_structures::graph;
15-
use ty::TyCtxt;
15+
use middle::ty::TyCtxt;
1616
use syntax::ast;
1717
use rustc_front::hir;
1818

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

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ use middle::def_id::{DefId};
2222
use middle::expr_use_visitor::{ConsumeMode, Delegate, ExprUseVisitor};
2323
use middle::expr_use_visitor::{LoanCause, MutateMode};
2424
use middle::expr_use_visitor as euv;
25-
use infer;
25+
use middle::infer;
2626
use middle::mem_categorization::{cmt};
2727
use middle::pat_util::*;
28-
use traits::ProjectionMode;
29-
use ty::*;
30-
use ty;
28+
use middle::traits::ProjectionMode;
29+
use middle::ty::*;
30+
use middle::ty;
3131
use std::cmp::Ordering;
3232
use std::fmt;
3333
use std::iter::{FromIterator, IntoIterator, repeat};
@@ -478,24 +478,15 @@ impl<'a, 'tcx> Folder for StaticInliner<'a, 'tcx> {
478478
Some(Def::Const(did)) => {
479479
let substs = Some(self.tcx.node_id_item_substs(pat.id).substs);
480480
if let Some((const_expr, _)) = lookup_const_by_id(self.tcx, did, substs) {
481-
match const_expr_to_pat(self.tcx, const_expr, pat.id, pat.span) {
482-
Ok(new_pat) => {
483-
if let Some(ref mut map) = self.renaming_map {
484-
// Record any renamings we do here
485-
record_renamings(const_expr, &pat, map);
486-
}
487-
new_pat
488-
}
489-
Err(def_id) => {
490-
self.failed = true;
491-
self.tcx.sess.span_err(
492-
pat.span,
493-
&format!("constants of the type `{}` \
494-
cannot be used in patterns",
495-
self.tcx.item_path_str(def_id)));
496-
pat
481+
const_expr_to_pat(self.tcx, const_expr, pat.span).map(|new_pat| {
482+
483+
if let Some(ref mut renaming_map) = self.renaming_map {
484+
// Record any renamings we do here
485+
record_renamings(const_expr, &pat, renaming_map);
497486
}
498-
}
487+
488+
new_pat
489+
})
499490
} else {
500491
self.failed = true;
501492
span_err!(self.tcx.sess, pat.span, E0158,

0 commit comments

Comments
 (0)