Skip to content

Commit

Permalink
Auto merge of #44908 - nikomatsakis:beta-20170928, r=alexcrichton
Browse files Browse the repository at this point in the history
Beta 20170928

Backports of:

- Allow unused extern crate again #44825
- macros: fix bug in collecting trait and impl items with derives. #44757
-  `--cap-lints allow` switches off `can_emit_warnings` #44627
-  Update the libc submodule #44116
- limit and clear cache obligations opportunistically #44269
- clear out projection subobligations after they are processed #43999
  • Loading branch information
bors committed Sep 28, 2017
2 parents 3c3cd3f + 41d7051 commit d158897
Show file tree
Hide file tree
Showing 17 changed files with 354 additions and 47 deletions.
2 changes: 1 addition & 1 deletion src/bootstrap/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub const CFG_RELEASE_NUM: &str = "1.21.0";
// An optional number to put after the label, e.g. '.2' -> '-beta.2'
// Be sure to make this starts with a dot to conform to semver pre-release
// versions (section 9)
pub const CFG_PRERELEASE_VERSION: &str = ".3";
pub const CFG_PRERELEASE_VERSION: &str = ".4";

pub struct GitInfo {
inner: Option<Info>,
Expand Down
2 changes: 1 addition & 1 deletion src/liblibc
Submodule liblibc updated 83 files
+10 −3 .travis.yml
+221 −29 Cargo.lock
+1 −1 Cargo.toml
+1 −1 README.md
+1 −1 appveyor.yml
+13 −0 ci/docker/aarch64-linux-android/Dockerfile
+2 −2 ci/docker/aarch64-unknown-linux-gnu/Dockerfile
+13 −0 ci/docker/arm-linux-androideabi/Dockerfile
+2 −2 ci/docker/arm-unknown-linux-gnueabihf/Dockerfile
+20 −0 ci/docker/asmjs-unknown-emscripten/Dockerfile
+13 −0 ci/docker/i686-linux-android/Dockerfile
+2 −2 ci/docker/mips-unknown-linux-gnu/Dockerfile
+3 −3 ci/docker/mips-unknown-linux-musl/Dockerfile
+2 −2 ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile
+3 −3 ci/docker/mipsel-unknown-linux-musl/Dockerfile
+2 −2 ci/docker/powerpc-unknown-linux-gnu/Dockerfile
+2 −2 ci/docker/powerpc64-unknown-linux-gnu/Dockerfile
+3 −0 ci/docker/s390x-unknown-linux-gnu/Dockerfile
+21 −0 ci/docker/wasm32-unknown-emscripten/Dockerfile
+11 −0 ci/docker/wasm32-unknown-emscripten/node-wrapper.sh
+5 −1 ci/docker/x86_64-rumprun-netbsd/Dockerfile
+54 −0 ci/docker/x86_64-rumprun-netbsd/runtest.rs
+0 −8 ci/docker/x86_64-unknown-openbsd/Dockerfile
+19 −0 ci/emscripten-entry.sh
+54 −0 ci/emscripten.sh
+1 −0 ci/run-docker.sh
+6 −122 ci/run.sh
+41 −0 ci/runtest-android.rs
+11 −1 libc-test/Cargo.toml
+0 −16 libc-test/build-generated.rs
+54 −11 libc-test/build.rs
+0 −16 libc-test/generate-files/Cargo.toml
+0 −19 libc-test/run-generated-Cargo.toml
+0 −9 libc-test/src/main-generated.rs
+7 −0 libc-test/test/linux_fcntl.rs
+1 −1 libc-test/test/main.rs
+6 −0 src/lib.rs
+0 −37 src/macros.rs
+31 −0 src/redox.rs
+5 −1 src/unix/bsd/apple/mod.rs
+17 −17 src/unix/bsd/freebsdlike/dragonfly/mod.rs
+2 −0 src/unix/bsd/freebsdlike/freebsd/aarch64.rs
+17 −17 src/unix/bsd/freebsdlike/freebsd/mod.rs
+2 −0 src/unix/bsd/freebsdlike/freebsd/x86_64.rs
+13 −2 src/unix/bsd/freebsdlike/mod.rs
+62 −12 src/unix/bsd/mod.rs
+15 −6 src/unix/bsd/netbsdlike/mod.rs
+8 −1 src/unix/bsd/netbsdlike/netbsd/mod.rs
+12 −0 src/unix/bsd/netbsdlike/openbsdlike/mod.rs
+78 −12 src/unix/haiku/mod.rs
+3 −41 src/unix/mod.rs
+58 −0 src/unix/newlib/mod.rs
+3 −0 src/unix/notbsd/android/b32/arm.rs
+29 −0 src/unix/notbsd/android/b32/mod.rs
+3 −0 src/unix/notbsd/android/b64/aarch64.rs
+30 −0 src/unix/notbsd/android/b64/mod.rs
+166 −3 src/unix/notbsd/android/mod.rs
+1,667 −0 src/unix/notbsd/emscripten.rs
+39 −1 src/unix/notbsd/linux/mips/mips32.rs
+34 −1 src/unix/notbsd/linux/mips/mips64.rs
+163 −6 src/unix/notbsd/linux/mod.rs
+33 −0 src/unix/notbsd/linux/musl/b32/arm.rs
+0 −348 src/unix/notbsd/linux/musl/b32/asmjs.rs
+39 −2 src/unix/notbsd/linux/musl/b32/mips.rs
+0 −5 src/unix/notbsd/linux/musl/b32/mod.rs
+31 −0 src/unix/notbsd/linux/musl/b32/x86.rs
+3 −0 src/unix/notbsd/linux/musl/b64/aarch64.rs
+30 −0 src/unix/notbsd/linux/musl/b64/mod.rs
+3 −0 src/unix/notbsd/linux/musl/b64/powerpc64.rs
+1 −9 src/unix/notbsd/linux/musl/mod.rs
+33 −0 src/unix/notbsd/linux/other/b32/arm.rs
+33 −0 src/unix/notbsd/linux/other/b32/powerpc.rs
+31 −0 src/unix/notbsd/linux/other/b32/x86.rs
+32 −0 src/unix/notbsd/linux/other/b64/aarch64.rs
+32 −0 src/unix/notbsd/linux/other/b64/powerpc64.rs
+30 −0 src/unix/notbsd/linux/other/b64/x86_64.rs
+0 −5 src/unix/notbsd/linux/other/mod.rs
+32 −5 src/unix/notbsd/linux/s390x.rs
+50 −133 src/unix/notbsd/mod.rs
+66 −20 src/unix/solaris/mod.rs
+70 −24 src/unix/uclibc/mod.rs
+46 −0 src/unix/uclibc/x86_64/l4re.rs
+78 −90 src/unix/uclibc/x86_64/mod.rs
12 changes: 12 additions & 0 deletions src/librustc/infer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1160,6 +1160,18 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
value.fold_with(&mut r)
}

/// Returns true if `T` contains unresolved type variables. In the
/// process of visiting `T`, this will resolve (where possible)
/// type variables in `T`, but it never constructs the final,
/// resolved type, so it's more efficient than
/// `resolve_type_vars_if_possible()`.
pub fn any_unresolved_type_vars<T>(&self, value: &T) -> bool
where T: TypeFoldable<'tcx>
{
let mut r = resolve::UnresolvedTypeFinder::new(self);
value.visit_with(&mut r)
}

pub fn resolve_type_and_region_vars_if_possible<T>(&self, value: &T) -> T
where T: TypeFoldable<'tcx>
{
Expand Down
39 changes: 38 additions & 1 deletion src/librustc/infer/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

use super::{InferCtxt, FixupError, FixupResult};
use ty::{self, Ty, TyCtxt, TypeFoldable};
use ty::fold::TypeFolder;
use ty::fold::{TypeFolder, TypeVisitor};

///////////////////////////////////////////////////////////////////////////
// OPPORTUNISTIC TYPE RESOLVER
Expand Down Expand Up @@ -80,6 +80,43 @@ impl<'a, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for OpportunisticTypeAndRegionResolv
}
}

///////////////////////////////////////////////////////////////////////////
// UNRESOLVED TYPE FINDER

/// The unresolved type **finder** walks your type and searches for
/// type variables that don't yet have a value. They get pushed into a
/// vector. It does not construct the fully resolved type (which might
/// involve some hashing and so forth).
pub struct UnresolvedTypeFinder<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
infcx: &'a InferCtxt<'a, 'gcx, 'tcx>,
}

impl<'a, 'gcx, 'tcx> UnresolvedTypeFinder<'a, 'gcx, 'tcx> {
pub fn new(infcx: &'a InferCtxt<'a, 'gcx, 'tcx>) -> Self {
UnresolvedTypeFinder { infcx }
}
}

impl<'a, 'gcx, 'tcx> TypeVisitor<'tcx> for UnresolvedTypeFinder<'a, 'gcx, 'tcx> {
fn visit_ty(&mut self, t: Ty<'tcx>) -> bool {
let t = self.infcx.shallow_resolve(t);
if t.has_infer_types() {
if let ty::TyInfer(_) = t.sty {
// Since we called `shallow_resolve` above, this must
// be an (as yet...) unresolved inference variable.
true
} else {
// Otherwise, visit its contents.
t.super_visit_with(self)
}
} else {
// Micro-optimize: no inference types at all Can't have unresolved type
// variables, no need to visit the contents.
false
}
}
}

///////////////////////////////////////////////////////////////////////////
// FULL TYPE RESOLUTION

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/lint/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ declare_lint! {

declare_lint! {
pub UNUSED_EXTERN_CRATES,
Warn,
Allow,
"extern crates that are never used"
}

Expand Down
10 changes: 7 additions & 3 deletions src/librustc/session/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -642,12 +642,16 @@ pub fn build_session_with_codemap(sopts: config::Options,
// FIXME: This is not general enough to make the warning lint completely override
// normal diagnostic warnings, since the warning lint can also be denied and changed
// later via the source code.
let can_print_warnings = sopts.lint_opts
let warnings_allow = sopts.lint_opts
.iter()
.filter(|&&(ref key, _)| *key == "warnings")
.map(|&(_, ref level)| *level != lint::Allow)
.map(|&(_, ref level)| *level == lint::Allow)
.last()
.unwrap_or(true);
.unwrap_or(false);
let cap_lints_allow = sopts.lint_cap.map_or(false, |cap| cap == lint::Allow);

let can_print_warnings = !(warnings_allow || cap_lints_allow);

let treat_err_as_bug = sopts.debugging_opts.treat_err_as_bug;

let emitter: Box<Emitter> = match (sopts.error_format, emitter_dest) {
Expand Down
3 changes: 3 additions & 0 deletions src/librustc/traits/fulfill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,9 @@ impl<'a, 'gcx, 'tcx> FulfillmentContext<'tcx> {
});
debug!("select: outcome={:?}", outcome);

// FIXME: if we kept the original cache key, we could mark projection
// obligations as complete for the projection cache here.

errors.extend(
outcome.errors.into_iter()
.map(|e| to_fulfillment_error(e)));
Expand Down
Loading

0 comments on commit d158897

Please sign in to comment.