Skip to content

Commit

Permalink
Auto merge of #32495 - Manishearth:rollup, r=<try>
Browse files Browse the repository at this point in the history
Rollup of 18 pull requests

- Successful merges: #32131, #32199, #32257, #32325, #32383, #32387, #32432, #32435, #32440, #32447, #32448, #32456, #32468, #32470, #32476, #32478, #32484, #32492
- Failed merges: #32240, #32469, #32482
  • Loading branch information
bors committed Mar 26, 2016
2 parents a1e29da + 17ea3e8 commit 49312a4
Show file tree
Hide file tree
Showing 302 changed files with 2,422 additions and 1,588 deletions.
4 changes: 2 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -969,11 +969,11 @@ then
LLVM_VERSION=$($LLVM_CONFIG --version)

case $LLVM_VERSION in
(3.[5-8]*)
(3.[6-8]*)
msg "found ok version of LLVM: $LLVM_VERSION"
;;
(*)
err "bad LLVM version: $LLVM_VERSION, need >=3.5"
err "bad LLVM version: $LLVM_VERSION, need >=3.6"
;;
esac
fi
Expand Down
5 changes: 3 additions & 2 deletions mk/crates.mk
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ TARGET_CRATES := libc std term \
RUSTC_CRATES := rustc rustc_typeck rustc_mir rustc_borrowck rustc_resolve rustc_driver \
rustc_trans rustc_back rustc_llvm rustc_privacy rustc_lint \
rustc_data_structures rustc_front rustc_platform_intrinsics \
rustc_plugin rustc_metadata rustc_passes
rustc_plugin rustc_metadata rustc_passes rustc_save_analysis
HOST_CRATES := syntax syntax_ext $(RUSTC_CRATES) rustdoc fmt_macros \
flate arena graphviz rbml log serialize
TOOLS := compiletest rustdoc rustc rustbook error_index_generator
Expand Down Expand Up @@ -102,7 +102,7 @@ DEPS_rustc_data_structures := std log serialize
DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back rustc_borrowck \
rustc_typeck rustc_mir rustc_resolve log syntax serialize rustc_llvm \
rustc_trans rustc_privacy rustc_lint rustc_front rustc_plugin \
rustc_metadata syntax_ext rustc_passes
rustc_metadata syntax_ext rustc_passes rustc_save_analysis
DEPS_rustc_front := std syntax log serialize
DEPS_rustc_lint := rustc log syntax
DEPS_rustc_llvm := native:rustllvm libc std rustc_bitflags
Expand All @@ -116,6 +116,7 @@ DEPS_rustc_privacy := rustc rustc_front log syntax
DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back rustc_mir \
log syntax serialize rustc_llvm rustc_front rustc_platform_intrinsics \
rustc_const_eval
DEPS_rustc_save_analysis := rustc log syntax rustc_front
DEPS_rustc_typeck := rustc syntax rustc_front rustc_platform_intrinsics rustc_const_eval

DEPS_rustdoc := rustc rustc_driver native:hoedown serialize getopts \
Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/mk/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ standalone-docs:
$(Q)$(BOOTSTRAP) --step doc-standalone
check:
$(Q)$(BOOTSTRAP) --step check
cargotest:
$(Q)$(BOOTSTRAP) --step cargotest
check-cargotest:
$(Q)$(BOOTSTRAP) --step check-cargotest
dist:
$(Q)$(BOOTSTRAP) --step dist

Expand Down
6 changes: 6 additions & 0 deletions src/doc/book/strings.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ let s = "foo\
assert_eq!("foobar", s);
```

Note that you normally cannot access a `str` directly, but only through a `&str`
reference. This is because `str` is an unsized type which requires additional
runtime information to be usable. For more information see the chapter on
[unsized types][ut].

Rust has more than only `&str`s though. A `String` is a heap-allocated string.
This string is growable, and is also guaranteed to be UTF-8. `String`s are
commonly created by converting from a string slice using the `to_string`
Expand Down Expand Up @@ -185,5 +190,6 @@ let hello_world = hello + &world;
This is because `&String` can automatically coerce to a `&str`. This is a
feature called ‘[`Deref` coercions][dc]’.

[ut]: unsized-types.html
[dc]: deref-coercions.html
[connect]: ../std/net/struct.TcpStream.html#method.connect
3 changes: 3 additions & 0 deletions src/doc/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -3911,6 +3911,9 @@ The _heap_ is a general term that describes boxes. The lifetime of an
allocation in the heap depends on the lifetime of the box values pointing to
it. Since box values may themselves be passed in and out of frames, or stored
in the heap, heap allocations may outlive the frame they are allocated within.
An allocation in the heap is guaranteed to reside at a single location in the
heap for the whole lifetime of the allocation - it will never be relocated as
a result of moving a box value.

### Memory ownership

Expand Down
4 changes: 0 additions & 4 deletions src/etc/CONFIGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,3 @@ These are some links to repos with configs which ease the use of rust.
* [kate-config](https://github.com/rust-lang/kate-config)
* [nano-config](https://github.com/rust-lang/nano-config)
* [zsh-config](https://github.com/rust-lang/zsh-config)

## Community-maintained Configs

* [.editorconfig](https://gist.github.com/derhuerst/c9d1b9309e308d9851fa) ([what is this?](http://editorconfig.org/))
6 changes: 5 additions & 1 deletion src/libcore/str/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1953,7 +1953,10 @@ impl StrExt for str {

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

#[inline]
fn split_at(&self, mid: usize) -> (&str, &str) {
// is_char_boundary checks that the index is in [0, .len()]
if self.is_char_boundary(mid) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
// except according to those terms.

use rustc_data_structures::graph;
use middle::cfg::*;
use cfg::*;
use middle::def::Def;
use middle::pat_util;
use middle::ty::{self, TyCtxt};
use ty::{self, TyCtxt};
use syntax::ast;
use syntax::ptr::P;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use graphviz::IntoCow;
use syntax::ast;

use front::map as ast_map;
use middle::cfg;
use cfg;

pub type Node<'a> = (cfg::CFGIndex, &'a cfg::CFGNode);
pub type Edge<'a> = &'a cfg::CFGEdge;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/cfg/mod.rs → src/librustc/cfg/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//! Uses `Graph` as the underlying representation.

use rustc_data_structures::graph;
use middle::ty::TyCtxt;
use ty::TyCtxt;
use syntax::ast;
use rustc_front::hir;

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/dep_graph/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use self::thread::{DepGraphThreadData, DepMessage};
use middle::def_id::DefId;
use syntax::ast::NodeId;
use middle::ty::TyCtxt;
use ty::TyCtxt;
use rustc_front::hir;
use rustc_front::intravisit::Visitor;
use std::rc::Rc;
Expand Down
6 changes: 3 additions & 3 deletions src/librustc/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1261,7 +1261,7 @@ compiled:
fn foo<T: Index<u8>>(x: T){}
#[rustc_on_unimplemented = "the type `{Self}` cannot be indexed by `{Idx}`"]
trait Index<Idx> { ... }
trait Index<Idx> { /* ... */ }
foo(true); // `bool` does not implement `Index<u8>`
```
Expand Down Expand Up @@ -1291,7 +1291,7 @@ compiled:
fn foo<T: Index<u8>>(x: T){}
#[rustc_on_unimplemented = "the type `{Self}` cannot be indexed by `{Idx}`"]
trait Index<Idx> { ... }
trait Index<Idx> { /* ... */ }
foo(true); // `bool` does not implement `Index<u8>`
```
Expand Down Expand Up @@ -1319,7 +1319,7 @@ compiled:
fn foo<T: Index<u8>>(x: T){}
#[rustc_on_unimplemented = "the type `{Self}` cannot be indexed by `{Idx}`"]
trait Index<Idx> { ... }
trait Index<Idx> { /* ... */ }
foo(true); // `bool` does not implement `Index<u8>`
```
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
use super::combine::{self, CombineFields};
use super::type_variable::{BiTo};

use middle::ty::{self, Ty, TyCtxt};
use middle::ty::TyVar;
use middle::ty::relate::{Relate, RelateResult, TypeRelation};
use ty::{self, Ty, TyCtxt};
use ty::TyVar;
use ty::relate::{Relate, RelateResult, TypeRelation};

pub struct Bivariate<'a, 'tcx: 'a> {
fields: CombineFields<'a, 'tcx>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ use super::{InferCtxt};
use super::{MiscVariable, TypeTrace};
use super::type_variable::{RelationDir, BiTo, EqTo, SubtypeOf, SupertypeOf};

use middle::ty::{IntType, UintType};
use middle::ty::{self, Ty, TyCtxt};
use middle::ty::error::TypeError;
use middle::ty::fold::{TypeFolder, TypeFoldable};
use middle::ty::relate::{Relate, RelateResult, TypeRelation};
use ty::{IntType, UintType};
use ty::{self, Ty, TyCtxt};
use ty::error::TypeError;
use ty::fold::{TypeFolder, TypeFoldable};
use ty::relate::{Relate, RelateResult, TypeRelation};

use syntax::ast;
use syntax::codemap::Span;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ use super::higher_ranked::HigherRankedRelations;
use super::{Subtype};
use super::type_variable::{EqTo};

use middle::ty::{self, Ty, TyCtxt};
use middle::ty::TyVar;
use middle::ty::relate::{Relate, RelateResult, TypeRelation};
use ty::{self, Ty, TyCtxt};
use ty::TyVar;
use ty::relate::{Relate, RelateResult, TypeRelation};

/// Ensures `a` is made equal to `b`. Returns `a` on success.
pub struct Equate<'a, 'tcx: 'a> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ use rustc_front::print::pprust;
use middle::cstore::CrateStore;
use middle::def::Def;
use middle::def_id::DefId;
use middle::infer::{self, TypeOrigin};
use infer::{self, TypeOrigin};
use middle::region;
use middle::subst;
use middle::ty::{self, Ty, TyCtxt, TypeFoldable};
use middle::ty::{Region, ReFree};
use middle::ty::error::TypeError;
use ty::subst;
use ty::{self, Ty, TyCtxt, TypeFoldable};
use ty::{Region, ReFree};
use ty::error::TypeError;

use std::cell::{Cell, RefCell};
use std::char::from_u32;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
//! variable only once, and it does so as soon as it can, so it is reasonable to ask what the type
//! inferencer knows "so far".

use middle::ty::{self, Ty, TyCtxt, TypeFoldable};
use middle::ty::fold::TypeFolder;
use ty::{self, Ty, TyCtxt, TypeFoldable};
use ty::fold::TypeFolder;
use std::collections::hash_map::{self, Entry};

use super::InferCtxt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ use super::InferCtxt;
use super::lattice::{self, LatticeDir};
use super::Subtype;

use middle::ty::{self, Ty, TyCtxt};
use middle::ty::relate::{Relate, RelateResult, TypeRelation};
use ty::{self, Ty, TyCtxt};
use ty::relate::{Relate, RelateResult, TypeRelation};

/// "Greatest lower bound" (common subtype)
pub struct Glb<'a, 'tcx: 'a> {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
use super::{CombinedSnapshot, InferCtxt, HigherRankedType, SkolemizationMap};
use super::combine::CombineFields;

use middle::ty::{self, TyCtxt, Binder, TypeFoldable};
use middle::ty::error::TypeError;
use middle::ty::relate::{Relate, RelateResult, TypeRelation};
use ty::{self, TyCtxt, Binder, TypeFoldable};
use ty::error::TypeError;
use ty::relate::{Relate, RelateResult, TypeRelation};
use syntax::codemap::Span;
use util::nodemap::{FnvHashMap, FnvHashSet};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
use super::combine;
use super::InferCtxt;

use middle::ty::TyVar;
use middle::ty::{self, Ty};
use middle::ty::relate::{RelateResult, TypeRelation};
use ty::TyVar;
use ty::{self, Ty};
use ty::relate::{RelateResult, TypeRelation};

pub trait LatticeDir<'f,'tcx> : TypeRelation<'f,'tcx> {
fn infcx(&self) -> &'f InferCtxt<'f, 'tcx>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ use super::InferCtxt;
use super::lattice::{self, LatticeDir};
use super::Subtype;

use middle::ty::{self, Ty, TyCtxt};
use middle::ty::relate::{Relate, RelateResult, TypeRelation};
use ty::{self, Ty, TyCtxt};
use ty::relate::{Relate, RelateResult, TypeRelation};

/// "Least upper bound" (common supertype)
pub struct Lub<'a, 'tcx: 'a> {
Expand Down
26 changes: 13 additions & 13 deletions src/librustc/middle/infer/mod.rs → src/librustc/infer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub use self::LateBoundRegionConversionTime::*;
pub use self::RegionVariableOrigin::*;
pub use self::SubregionOrigin::*;
pub use self::ValuePairs::*;
pub use middle::ty::IntVarValue;
pub use ty::IntVarValue;
pub use self::freshen::TypeFreshener;
pub use self::region_inference::{GenericKind, VerifyBound};

Expand All @@ -24,16 +24,16 @@ use middle::free_region::FreeRegionMap;
use middle::mem_categorization as mc;
use middle::mem_categorization::McResult;
use middle::region::CodeExtent;
use middle::subst;
use middle::subst::Substs;
use middle::subst::Subst;
use middle::traits::{self, ProjectionMode};
use middle::ty::adjustment;
use middle::ty::{TyVid, IntVid, FloatVid};
use middle::ty::{self, Ty, TyCtxt};
use middle::ty::error::{ExpectedFound, TypeError, UnconstrainedNumeric};
use middle::ty::fold::{TypeFolder, TypeFoldable};
use middle::ty::relate::{Relate, RelateResult, TypeRelation};
use ty::subst;
use ty::subst::Substs;
use ty::subst::Subst;
use traits::{self, ProjectionMode};
use ty::adjustment;
use ty::{TyVid, IntVid, FloatVid};
use ty::{self, Ty, TyCtxt};
use ty::error::{ExpectedFound, TypeError, UnconstrainedNumeric};
use ty::fold::{TypeFolder, TypeFoldable};
use ty::relate::{Relate, RelateResult, TypeRelation};
use rustc_data_structures::unify::{self, UnificationTable};
use std::cell::{RefCell, Ref};
use std::fmt;
Expand Down Expand Up @@ -622,8 +622,8 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
}

pub fn type_is_unconstrained_numeric(&'a self, ty: Ty) -> UnconstrainedNumeric {
use middle::ty::error::UnconstrainedNumeric::Neither;
use middle::ty::error::UnconstrainedNumeric::{UnconstrainedInt, UnconstrainedFloat};
use ty::error::UnconstrainedNumeric::Neither;
use ty::error::UnconstrainedNumeric::{UnconstrainedInt, UnconstrainedFloat};
match ty.sty {
ty::TyInfer(ty::IntVar(vid)) => {
if self.int_unification_table.borrow_mut().has_value(vid) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
/// For clarity, rename the graphviz crate locally to dot.
use graphviz as dot;

use middle::ty::{self, TyCtxt};
use ty::{self, TyCtxt};
use middle::region::CodeExtent;
use super::Constraint;
use middle::infer::SubregionOrigin;
use middle::infer::region_inference::RegionVarBindings;
use infer::SubregionOrigin;
use infer::region_inference::RegionVarBindings;
use util::nodemap::{FnvHashMap, FnvHashSet};

use std::borrow::Cow;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ use super::unify_key;
use rustc_data_structures::graph::{self, Direction, NodeIndex};
use rustc_data_structures::unify::{self, UnificationTable};
use middle::free_region::FreeRegionMap;
use middle::ty::{self, Ty, TyCtxt};
use middle::ty::{BoundRegion, Region, RegionVid};
use middle::ty::{ReEmpty, ReStatic, ReFree, ReEarlyBound};
use middle::ty::{ReLateBound, ReScope, ReVar, ReSkolemized, BrFresh};
use ty::{self, Ty, TyCtxt};
use ty::{BoundRegion, Region, RegionVid};
use ty::{ReEmpty, ReStatic, ReFree, ReEarlyBound};
use ty::{ReLateBound, ReScope, ReVar, ReSkolemized, BrFresh};
use util::common::indenter;
use util::nodemap::{FnvHashMap, FnvHashSet};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// except according to those terms.

use super::{InferCtxt, FixupError, FixupResult};
use middle::ty::{self, Ty, TyCtxt, TypeFoldable};
use ty::{self, Ty, TyCtxt, TypeFoldable};

///////////////////////////////////////////////////////////////////////////
// OPPORTUNISTIC TYPE RESOLVER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ use super::higher_ranked::HigherRankedRelations;
use super::SubregionOrigin;
use super::type_variable::{SubtypeOf, SupertypeOf};

use middle::ty::{self, Ty, TyCtxt};
use middle::ty::TyVar;
use middle::ty::relate::{Cause, Relate, RelateResult, TypeRelation};
use ty::{self, Ty, TyCtxt};
use ty::TyVar;
use ty::relate::{Cause, Relate, RelateResult, TypeRelation};
use std::mem;

/// Ensures `a` is made a subtype of `b`. Returns `a` on success.
Expand Down
Loading

0 comments on commit 49312a4

Please sign in to comment.