-
Build a rustc that includes rust-lang/rust#19449
-
Checkout rust-lang/rust#19467
-
Bootstrap (2) using (1) as stage-0 compiler, pass RUSTLFLAGS=-Ccodegen-units=2, you should hit an LLVM assertion (see below) while building stage0/libcollections.
-
Alternatively compile the
collections.rs
(see above) file using the rustc from (1) and passing the-Ccodegen-units=2
flag.
Last active
August 29, 2015 14:10
-
-
Save japaric/ffca1e1eb50002caa56d to your computer and use it in GitHub Desktop.
LLVM assertion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(lang_items)] | |
#![crate_type = "rlib"] | |
#![no_std] | |
// This core crate has an `Option` that uses unboxed closures (see #19467) | |
extern crate core; | |
use core::prelude::{Iterator, IteratorExt, Option, None}; | |
use core::slice::SlicePrelude; | |
struct ElementSwaps { | |
sdir: &'static [uint], | |
} | |
impl Iterator<()> for ElementSwaps { | |
// This attribute triggers the assertion | |
#[inline] | |
fn next(&mut self) -> Option<()> { | |
self.sdir. | |
iter(). | |
max_by(|&sd| sd); | |
None | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ LD_LIBRARY_PATH=/home/japaric/tmp/rust/build/x86_64-unknown-linux-gnu/stage0/lib \ | |
/home/japaric/tmp/rust/build/x86_64-unknown-linux-gnu/stage0/bin/rustc \ | |
-Ccodegen_units=2 \ | |
collections.rs | |
collections.rs:9:1: 11:2 warning: struct is never used: `ElementSwaps`, #[warn(dead_code)] on by default | |
collections.rs:9 struct ElementSwaps { | |
collections.rs:10 sdir: &'static [uint], | |
collections.rs:11 } | |
rustc: /var/tmp/paludis/build/dev-lang-rust-scm/work/rust-scm/src/llvm/lib/IR/Constants.cpp:1609: static llvm::Constant* llvm::ConstantExpr::getPointerCast(llvm::Constant*, llvm::Type*): Assertion `S->getType()->isPtrOrPtrVectorTy() && "Invalid cast"' failed. | |
./reduce.sh: line 6: 9793 Aborted (core dumped) LD_LIBRARY_PATH=/home/japaric/tmp/rust/build/x86_64-unknown-linux-gnu/stage0/lib /home/japaric/tmp/rust/build/x86_64-unknown-linux-gnu/stage0/bin/rustc -Ccodegen_units=2 collections.rs 2>&1 |
further reduction:
#![feature(lang_items, unboxed_closures)]
#![crate_type = "rlib"]
#![no_std]
#![allow(dead_code)]
// This core crate has an `Option` that uses unboxed closures (see #19467)
extern crate core;
use core::prelude::{IteratorExt};
use core::slice::SlicePrelude;
static X: &'static [uint] = &[];
#[inline]
fn next() {
X.iter().max_by(|_| 0i);
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was able to reduce to this