// Pass down configuration from the LLVM build into the build of
// librustc_llvm and librustc_codegen_llvm.
- if builder.is_rust_llvm(target) {
+ if builder.is_rust_llvm(target) && backend != "emscripten" {
cargo.env("LLVM_RUSTLLVM", "1");
}
cargo.env("LLVM_CONFIG", &llvm_config);
RUN sh /scripts/sccache.sh
ENV PATH=$PATH:/emsdk-portable
-ENV PATH=$PATH:/emsdk-portable/clang/e1.37.13_64bit/
-ENV PATH=$PATH:/emsdk-portable/emscripten/1.37.13/
-ENV PATH=$PATH:/emsdk-portable/node/4.1.1_64bit/bin/
-ENV EMSCRIPTEN=/emsdk-portable/emscripten/1.37.13/
-ENV BINARYEN_ROOT=/emsdk-portable/clang/e1.37.13_64bit/binaryen/
+ENV PATH=$PATH:/emsdk-portable/clang/e1.38.15_64bit/
+ENV PATH=$PATH:/emsdk-portable/emscripten/1.38.15/
+ENV PATH=$PATH:/emsdk-portable/node/8.9.1_64bit/bin/
+ENV EMSCRIPTEN=/emsdk-portable/emscripten/1.38.15/
+ENV BINARYEN_ROOT=/emsdk-portable/clang/e1.38.15_64bit/binaryen/
ENV EM_CONFIG=/emsdk-portable/.emscripten
ENV TARGETS=asmjs-unknown-emscripten
RUN sh /scripts/sccache.sh
ENV PATH=$PATH:/emsdk-portable
-ENV PATH=$PATH:/emsdk-portable/clang/e1.37.13_64bit/
-ENV PATH=$PATH:/emsdk-portable/emscripten/1.37.13/
-ENV PATH=$PATH:/node-v8.0.0-linux-x64/bin/
-ENV EMSCRIPTEN=/emsdk-portable/emscripten/1.37.13/
-ENV BINARYEN_ROOT=/emsdk-portable/clang/e1.37.13_64bit/binaryen/
+ENV PATH=$PATH:/emsdk-portable/clang/e1.38.15_64bit/
+ENV PATH=$PATH:/emsdk-portable/emscripten/1.38.15/
+ENV PATH=$PATH:/emsdk-portable/node/8.9.1_64bit/bin/
+ENV EMSCRIPTEN=/emsdk-portable/emscripten/1.38.15/
+ENV BINARYEN_ROOT=/emsdk-portable/clang/e1.38.15_64bit/binaryen/
ENV EM_CONFIG=/emsdk-portable/.emscripten
ENV TARGETS=wasm32-unknown-emscripten
cd /emsdk-portable
./emsdk update
-hide_output ./emsdk install sdk-1.37.13-64bit
-./emsdk activate sdk-1.37.13-64bit
+hide_output ./emsdk install sdk-1.38.15-64bit
+./emsdk activate sdk-1.38.15-64bit
# Compile and cache libc
source ./emsdk_env.sh
# Make emsdk usable by any user
cp /root/.emscripten /emsdk-portable
chmod a+rxw -R /emsdk-portable
-
-# node 8 is required to run wasm
-cd /
-curl -sL https://nodejs.org/dist/v8.0.0/node-v8.0.0-linux-x64.tar.xz | \
- tar -xJ
elem: &PlaceElem<'tcx>)
-> PlaceTy<'tcx>
{
- self.projection_ty_core(tcx, elem, |_, _, ty| ty)
+ self.projection_ty_core(tcx, elem, |_, _, ty| -> Result<Ty<'tcx>, ()> { Ok(ty) })
+ .unwrap()
}
/// `place_ty.projection_ty_core(tcx, elem, |...| { ... })`
/// `Ty` or downcast variant corresponding to that projection.
/// The `handle_field` callback must map a `Field` to its `Ty`,
/// (which should be trivial when `T` = `Ty`).
- pub fn projection_ty_core<V, T>(self,
- tcx: TyCtxt<'a, 'gcx, 'tcx>,
- elem: &ProjectionElem<'tcx, V, T>,
- mut handle_field: impl FnMut(&Self, &Field, &T) -> Ty<'tcx>)
- -> PlaceTy<'tcx>
+ pub fn projection_ty_core<V, T, E>(
+ self,
+ tcx: TyCtxt<'a, 'gcx, 'tcx>,
+ elem: &ProjectionElem<'tcx, V, T>,
+ mut handle_field: impl FnMut(&Self, &Field, &T) -> Result<Ty<'tcx>, E>)
+ -> Result<PlaceTy<'tcx>, E>
where
V: ::std::fmt::Debug, T: ::std::fmt::Debug
{
bug!("cannot downcast non-ADT type: `{:?}`", self)
}
},
- ProjectionElem::Field(ref f, ref fty) => PlaceTy::Ty { ty: handle_field(&self, f, fty) }
+ ProjectionElem::Field(ref f, ref fty) =>
+ PlaceTy::Ty { ty: handle_field(&self, f, fty)? },
};
debug!("projection_ty self: {:?} elem: {:?} yields: {:?}", self, elem, answer);
- answer
+ Ok(answer)
}
}
let recursion_limit = *selcx.tcx().sess.recursion_limit.get();
if obligation.recursion_depth >= recursion_limit {
debug!("project: overflow!");
- selcx.infcx().report_overflow_error(&obligation, true);
+ return Err(ProjectionTyError::TraitSelectionError(SelectionError::Overflow));
}
let obligation_trait_ref = &obligation.predicate.trait_ref(selcx.tcx());
"hexagon" => HEXAGON_WHITELIST,
"mips" | "mips64" => MIPS_WHITELIST,
"powerpc" | "powerpc64" => POWERPC_WHITELIST,
- "wasm32" => WASM_WHITELIST,
+ // wasm32 on emscripten does not support these target features
+ "wasm32" if !sess.target.target.options.is_like_emscripten => WASM_WHITELIST,
_ => &[],
}
}
codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::RUSTC_STD_INTERNAL_SYMBOL);
if is_extern && !std_internal {
+ // Emscripten cannot export statics, so reduce their export level here
+ if tcx.sess.target.target.options.is_like_emscripten {
+ if let Some(Node::Item(&hir::Item {
+ node: hir::ItemKind::Static(..),
+ ..
+ })) = tcx.hir.get_if_local(sym_def_id) {
+ return SymbolExportLevel::Rust;
+ }
+ }
+
SymbolExportLevel::C
} else {
SymbolExportLevel::Rust
let v1 = ty::Contravariant.xform(v);
let tcx = self.infcx.tcx;
- let mut projected_ty = PlaceTy::from_ty(ty);
+ let ty = self.normalize(ty, locations);
+
+ // We need to follow any provided projetions into the type.
+ //
+ // if we hit a ty var as we descend, then just skip the
+ // attempt to relate the mir local with any type.
+ #[derive(Debug)] struct HitTyVar;
+ let mut curr_projected_ty: Result<PlaceTy, HitTyVar>;
+
+ curr_projected_ty = Ok(PlaceTy::from_ty(ty));
for proj in &user_ty.projs {
- projected_ty = projected_ty.projection_ty_core(
+ let projected_ty = if let Ok(projected_ty) = curr_projected_ty {
+ projected_ty
+ } else {
+ break;
+ };
+ curr_projected_ty = projected_ty.projection_ty_core(
tcx, proj, |this, field, &()| {
- let ty = this.field_ty(tcx, field);
- self.normalize(ty, locations)
+ if this.to_ty(tcx).is_ty_var() {
+ Err(HitTyVar)
+ } else {
+ let ty = this.field_ty(tcx, field);
+ Ok(self.normalize(ty, locations))
+ }
});
}
debug!("user_ty base: {:?} freshened: {:?} projs: {:?} yields: {:?}",
- user_ty.base, ty, user_ty.projs, projected_ty);
+ user_ty.base, ty, user_ty.projs, curr_projected_ty);
- let ty = projected_ty.to_ty(tcx);
-
- self.relate_types(ty, v1, a, locations, category)?;
+ if let Ok(projected_ty) = curr_projected_ty {
+ let ty = projected_ty.to_ty(tcx);
+ self.relate_types(ty, v1, a, locations, category)?;
+ }
}
UserTypeAnnotation::TypeOf(def_id, canonical_substs) => {
let (
debug!("relate_type_and_user_type: ty of def-id is {:?}", ty);
let ty = self.normalize(ty);
- let mut projected_ty = PlaceTy::from_ty(ty);
+ // We need to follow any provided projetions into the type.
+ //
+ // if we hit a ty var as we descend, then just skip the
+ // attempt to relate the mir local with any type.
+
+ struct HitTyVar;
+ let mut curr_projected_ty: Result<PlaceTy, HitTyVar>;
+ curr_projected_ty = Ok(PlaceTy::from_ty(ty));
for proj in projs {
- projected_ty = projected_ty.projection_ty_core(
+ let projected_ty = if let Ok(projected_ty) = curr_projected_ty {
+ projected_ty
+ } else {
+ break;
+ };
+ curr_projected_ty = projected_ty.projection_ty_core(
tcx, proj, |this, field, &()| {
- let ty = this.field_ty(tcx, field);
- self.normalize(ty)
+ if this.to_ty(tcx).is_ty_var() {
+ Err(HitTyVar)
+ } else {
+ let ty = this.field_ty(tcx, field);
+ Ok(self.normalize(ty))
+ }
});
}
- let ty = projected_ty.to_ty(tcx);
- self.relate(mir_ty, variance, ty)?;
+ if let Ok(projected_ty) = curr_projected_ty {
+ let ty = projected_ty.to_ty(tcx);
+ self.relate(mir_ty, variance, ty)?;
+ }
if let Some(UserSelfTy {
impl_def_id,
-Subproject commit 2717444753318e461e0c3b30dacd03ffbac96903
+Subproject commit 7f23313edff8beccb3fe44b815714269c5124c15
LLVMPassManagerBuilderRef PMBR, LLVMRustCodeGenOptLevel OptLevel,
bool MergeFunctions, bool SLPVectorize, bool LoopVectorize, bool PrepareForThinLTO,
const char* PGOGenPath, const char* PGOUsePath) {
-#if LLVM_RUSTLLVM
+#if LLVM_VERSION_GE(7, 0)
unwrap(PMBR)->MergeFunctions = MergeFunctions;
#endif
unwrap(PMBR)->SLPVectorize = SLPVectorize;
if self.0 == 1 {
panic!("panic 1");
} else {
- eprint!("drop {}", self.0);
+ eprintln!("drop {}", self.0);
}
}
}
fn main() {
panic::set_hook(Box::new(|i| {
- eprint!("greetings from the panic handler");
+ eprintln!("greetings from the panic handler");
}));
panic!("foobar");
}
assert_eq!(BE_U32, b(55u32).to_be());
assert_eq!(LE_U32, b(55u32).to_le());
- #[cfg(not(target_arch = "asmjs"))]
+ #[cfg(not(target_os = "emscripten"))]
{
const BE_U128: u128 = 999999u128.to_be();
const LE_I128: i128 = (-999999i128).to_le();
--- /dev/null
+// compile-pass
+
+// rust-lang/rust#55552: The strategy pnkfelix landed in PR #55274
+// (for ensuring that NLL respects user-provided lifetime annotations)
+// did not handle the case where the ascribed type has some expliit
+// wildcards (`_`) mixed in, and it caused an internal compiler error
+// (ICE).
+//
+// This test is just checking that we do not ICE when such things
+// occur.
+
+struct X;
+struct Y;
+struct Z;
+
+struct Pair { x: X, y: Y }
+
+pub fn join<A, B, RA, RB>(oper_a: A, oper_b: B) -> (RA, RB)
+where A: FnOnce() -> RA + Send,
+ B: FnOnce() -> RB + Send,
+ RA: Send,
+ RB: Send
+{
+ (oper_a(), oper_b())
+}
+
+fn main() {
+ let ((_x, _y), _z): (_, Z) = join(|| (X, Y), || Z);
+
+ let (Pair { x: _x, y: _y }, Z): (_, Z) = join(|| Pair { x: X, y: Y }, || Z);
+}
// Test that the compiler will catch invalid inline assembly constraints.
+// ignore-emscripten
+
#![feature(asm)]
extern "C" {
error[E0668]: malformed inline assembly
- --> $DIR/inline-asm-bad-constraint.rs:29:9
+ --> $DIR/inline-asm-bad-constraint.rs:31:9
|
LL | asm!("" :"={rax"(rax)) //~ ERROR E0668
| ^^^^^^^^^^^^^^^^^^^^^^
error[E0668]: malformed inline assembly
- --> $DIR/inline-asm-bad-constraint.rs:37:9
+ --> $DIR/inline-asm-bad-constraint.rs:39:9
|
LL | asm!("callq $0" : : "0"(foo)) //~ ERROR E0668
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0668]: malformed inline assembly
- --> $DIR/inline-asm-bad-constraint.rs:44:9
+ --> $DIR/inline-asm-bad-constraint.rs:46:9
|
LL | asm!("addb $1, $0" : "={rax}"((0i32, rax))); //~ ERROR E0668
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// Test that the compiler will catch passing invalid values to inline assembly
// operands.
+// ignore-emscripten
+
#![feature(asm)]
#[repr(C)]
error[E0669]: invalid value for constraint in inline assembly
- --> $DIR/inline-asm-bad-operand.rs:29:24
+ --> $DIR/inline-asm-bad-operand.rs:31:24
|
LL | asm!("" :: "r"("")); //~ ERROR E0669
| ^^
error[E0669]: invalid value for constraint in inline assembly
- --> $DIR/inline-asm-bad-operand.rs:34:32
+ --> $DIR/inline-asm-bad-operand.rs:36:32
|
LL | asm!("ret" : : "{rdi}"(target)); //~ ERROR E0669
| ^^^^^^
error[E0669]: invalid value for constraint in inline assembly
- --> $DIR/inline-asm-bad-operand.rs:41:29
+ --> $DIR/inline-asm-bad-operand.rs:43:29
|
LL | unsafe { asm!("" :: "i"(hello)) }; //~ ERROR E0669
| ^^^^^
error[E0669]: invalid value for constraint in inline assembly
- --> $DIR/inline-asm-bad-operand.rs:49:38
+ --> $DIR/inline-asm-bad-operand.rs:51:38
|
LL | asm!("movups $1, %xmm0"::"m"(arr)); //~ ERROR E0669
| ^^^
error[E0669]: invalid value for constraint in inline assembly
- --> $DIR/inline-asm-bad-operand.rs:56:32
+ --> $DIR/inline-asm-bad-operand.rs:58:32
|
LL | asm!("mov sp, $0"::"r"(addr)); //~ ERROR E0669
| ^^^^
error[E0669]: invalid value for constraint in inline assembly
- --> $DIR/inline-asm-bad-operand.rs:63:32
+ --> $DIR/inline-asm-bad-operand.rs:65:32
|
LL | asm!("mov sp, $0"::"r"(addr), //~ ERROR E0669
| ^^^^
error[E0669]: invalid value for constraint in inline assembly
- --> $DIR/inline-asm-bad-operand.rs:64:32
+ --> $DIR/inline-asm-bad-operand.rs:66:32
|
LL | "r"("hello e0669")); //~ ERROR E0669
| ^^^^^^^^^^^^^
-error[E0275]: overflow evaluating the requirement `<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<T as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next`
+error[E0275]: overflow evaluating the requirement `<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<T as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next: std::marker::Sized`
--> $DIR/issue-23122-2.rs:17:15
|
LL | impl<T: Next> Next for GetNext<T> {
| ^^^^
|
= help: consider adding a `#![recursion_limit="128"]` attribute to your crate
+ = note: required because of the requirements on the impl of `Next` for `GetNext<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<T as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next>`
error: aborting due to previous error
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
// compile-pass
+// ignore-emscripten no i128 support
#![feature(nll)]
use core::ops::RangeBounds;
-#[cfg(not(target_arch = "wasm32"))]
+#[cfg(any(not(target_arch = "wasm32"), target_os = "emscripten"))]
#[lang = "eh_personality"]
extern fn eh_personality() {}
} else {
self.fatal("no NodeJS binary found (--nodejs)");
}
- }
-
- // If this is otherwise wasm , then run tests under nodejs with our
+ // If this is otherwise wasm, then run tests under nodejs with our
// shim
- if self.config.target.contains("wasm32") {
+ } else if self.config.target.contains("wasm32") {
if let Some(ref p) = self.config.nodejs {
args.push(p.clone());
} else {