Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate miri against the HIR const evaluator #45002

Merged
merged 1,591 commits into from
Dec 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1591 commits
Select commit Hold shift + click to select a range
7c6befe
Merge pull request #274 from RalfJung/packed2
oli-obk Jul 31, 2017
69fd22f
fix for latest nightly
RalfJung Jul 31, 2017
6d3c88c
Merge pull request #277 from RalfJung/nightly
RalfJung Aug 1, 2017
11e30a6
Split up miri into the librustc_mir and bin parts
oli-obk Jul 21, 2017
36502a3
Implement the first machine function
oli-obk Jul 21, 2017
dc6e877
Split "new" miri crate into modules
oli-obk Jul 24, 2017
4a4640a
Move more non-CTFE operations to the Machine
oli-obk Jul 25, 2017
960dca1
Rename `const_eval::Evaluator` to `CompileTimeFunctionEvaluator`
oli-obk Jul 25, 2017
728bb87
Move the `global_item` function to the `EvalContext`
oli-obk Jul 27, 2017
e5799a6
Reduce the chance of accidentally calling functions in CTFE
oli-obk Jul 28, 2017
e15d374
Fix doc text
oli-obk Jul 28, 2017
df7c42b
Move a method used everywhere out of `intrinsic.rs`
oli-obk Jul 28, 2017
45b7cfd
Update env_logger in order to share more dependencies
oli-obk Jul 28, 2017
f16b9e2
Move all intrinsics out of `interpret` and fail CTFE on intrinsic calls
oli-obk Jul 28, 2017
4383fc2
Adjust travis to the directory changes
oli-obk Jul 28, 2017
7ed706d
Update Cargo.toml
oli-obk Jul 28, 2017
adfea61
Allow machines to create new memory kinds
oli-obk Jul 28, 2017
23d351d
Move tls code to its own file
oli-obk Jul 31, 2017
54ecdf1
Remove leftover unused file
oli-obk Jul 31, 2017
3d82b66
Remove redundant `members` field
oli-obk Jul 31, 2017
8de8580
Properly process ptr_op for const eval
oli-obk Jul 31, 2017
d05784f
Address comments
oli-obk Aug 1, 2017
8b81f54
Fix running the rustc test suite
oli-obk Jul 31, 2017
393216d
Add a better error message than `syscall 318 not found`
oli-obk Jul 31, 2017
79f38bf
Process untagged unions
oli-obk Jul 31, 2017
f19d77e
Build the rustc_tests binary on travis
oli-obk Aug 1, 2017
7700bd0
Merge pull request #268 from oli-obk/upstream
oli-obk Aug 2, 2017
f8c61da
Add a test for untagged unions
oli-obk Aug 2, 2017
cf318b1
Merge pull request #278 from solson/unions
eddyb Aug 2, 2017
29a3c4d
Produce backtraces for miri internals
oli-obk Aug 2, 2017
7e585ef
Speed up travis by using release mode
oli-obk Aug 2, 2017
40677a5
Choose release miri for release tests
oli-obk Aug 2, 2017
8deb938
step.rs: improve comment for clarity
RalfJung Aug 2, 2017
c533cf8
fix size_of_val on unsized tuples
RalfJung Aug 2, 2017
163821b
Remove accidental text paste
oli-obk Aug 3, 2017
f7bc6ab
Reuse the `Backtrace` object instead of rolling our own
oli-obk Aug 3, 2017
5d27b94
fix comment
RalfJung Aug 3, 2017
de1376f
Add a build script to inform the binary about its profile, and use th…
RalfJung Aug 3, 2017
5aed318
Merge pull request #281 from RalfJung/unsized
RalfJung Aug 3, 2017
0f43321
no need to do run-time formatting
RalfJung Aug 3, 2017
2cf3949
actually, we can use a plain constant
RalfJung Aug 3, 2017
726b027
Merge pull request #280 from solson/archeology
oli-obk Aug 3, 2017
dd533a9
Revert "disable validation code so that it all compiles against curre…
RalfJung Jul 26, 2017
b3fa42f
with Validation MIR around drop being fixed, we can remove the hack w…
RalfJung Jul 27, 2017
c2c0501
with the new 'limited validation when there is unsafe', we can signif…
RalfJung Aug 2, 2017
85dc3e5
make execution with full MIR work: need to whitelist Arc drop impl an…
RalfJung Aug 2, 2017
3754572
Release of an Undef local is fine, and a NOP
RalfJung Aug 2, 2017
766a69f
make test suite MIR validation aware. run-pass passes with and withou…
RalfJung Aug 2, 2017
58a1702
Let -Zmir-emit-validate also control whether miri even acts on the va…
RalfJung Aug 2, 2017
9458111
for now, disable validation on optimized tests -- inlining breaks val…
RalfJung Aug 2, 2017
4957031
selectively disable validation in compile-fail where appropriate. car…
RalfJung Aug 2, 2017
181bb30
Rustc reorders fields, but miri expects them in source order
oli-obk Aug 4, 2017
8b449c3
Merge pull request #284 from oli-obk/no_more_llvm_madness
oli-obk Aug 4, 2017
ac49e7c
only collect backtrace when RUST_BACKTRACE is set; resolve symbols la…
RalfJung Aug 4, 2017
fb2ed45
consolidate making Undef release a NOP in one place
RalfJung Aug 4, 2017
2a1d766
Merge pull request #286 from RalfJung/mir-validate
RalfJung Aug 5, 2017
b59c092
Merge pull request #283 from RalfJung/backtrace
oli-obk Aug 5, 2017
e7d8037
Rustup
oli-obk Aug 7, 2017
a98a68b
Merge pull request #289 from RalfJung/rusutp
RalfJung Aug 7, 2017
847396e
Re-do memory locking (again). Now with proper support for multiple i…
RalfJung Aug 7, 2017
547f49c
Merge pull request #288 from RalfJung/mir-validate
oli-obk Aug 7, 2017
d0ac2b1
make xargo/build.sh more cross-platform
RalfJung Aug 7, 2017
14e8f50
Merge pull request #291 from RalfJung/cross-platform
RalfJung Aug 7, 2017
4ba2b82
Split the alloc id address space into functions and normal allocs
oli-obk Aug 8, 2017
181851f
Always allocate for globals
oli-obk Aug 8, 2017
8ab1eee
Implement packed statics
oli-obk Aug 8, 2017
3ce57d1
Remove unused function
oli-obk Aug 8, 2017
897b563
clarify which function is pushing a global
oli-obk Aug 8, 2017
9e787fb
Dump all allocs when dumping locals
oli-obk Aug 8, 2017
bba753d
c_int != usize
oli-obk Aug 8, 2017
81f5de7
rename `memory::Kind` to `memory::MemoryKind`
oli-obk Aug 9, 2017
91db25b
Rename `destructure` method to `into_alloc_id_kind`
oli-obk Aug 9, 2017
a6096fb
Merge pull request #292 from oli-obk/static_alloc_ids
oli-obk Aug 9, 2017
7e6c497
Make cargo_miri a feature
oli-obk Aug 9, 2017
4ce60ab
Update build.rs
oli-obk Aug 9, 2017
e2de0b2
Merge pull request #294 from oli-obk/cargo_miri
RalfJung Aug 9, 2017
e71af86
Merge branch 'master' into oli-obk-patch-2
oli-obk Aug 9, 2017
65a3131
Merge pull request #295 from solson/oli-obk-patch-2
RalfJung Aug 9, 2017
de80bcb
some tests for RangeMap
RalfJung Aug 7, 2017
11f0aed
add some tests making sure we get the alias checking right
RalfJung Aug 8, 2017
668491a
Work on making validation test pass again
RalfJung Aug 8, 2017
bff1ad1
integer-ops needs a rustc patch to work again
RalfJung Aug 9, 2017
7b5f8a3
try harder to preserve regions when doing inference
RalfJung Aug 9, 2017
5e018b1
analyzing hashmap.rs uncovered a deeper problem; disable validation t…
RalfJung Aug 9, 2017
3468504
add a bunch of compile-fail tests for validation
RalfJung Aug 10, 2017
8e8c9c8
turns out we can enable this sanity check now
RalfJung Aug 10, 2017
85fd3f8
Merge pull request #297 from RalfJung/mir-validate
oli-obk Aug 10, 2017
1326aed
rustfmt
RalfJung Aug 10, 2017
63c4843
Merge pull request #299 from RalfJung/rustfmt
oli-obk Aug 10, 2017
33ff32c
Get the test suite working inside the rustc test suite
oli-obk Aug 8, 2017
8019deb
Update compiletest.rs
oli-obk Aug 10, 2017
dca1be6
Merge pull request #300 from oli-obk/rustc_tests
oli-obk Aug 11, 2017
2be159b
enable a test that waited for a rustc fix
RalfJung Aug 11, 2017
7e5d971
fix warnings; make test suite pass again
RalfJung Aug 12, 2017
5d60c61
Merge pull request #302 from RalfJung/mir-validate2
RalfJung Aug 12, 2017
90edc03
Add a test demonstrating the limitations of our lfietime resolution
RalfJung Aug 10, 2017
2fccae8
add another compile-fail test for validation
RalfJung Aug 10, 2017
1f20b7d
travis: fail fast
RalfJung Aug 18, 2017
4cfda6a
hack to make xargo libstd build work again
RalfJung Aug 23, 2017
7b8e2c7
Rustup (`Clone` is now a builtin trait)
oli-obk Aug 23, 2017
f75dd90
Also reuse function pointer shims and drop glue from rustc
oli-obk Aug 23, 2017
66108be
Merge pull request #308 from oli-obk/libstd
RalfJung Aug 23, 2017
ae10b23
Merge branch 'master' into mir-validate
RalfJung Aug 23, 2017
3f3fada
Merge pull request #301 from RalfJung/mir-validate
RalfJung Aug 24, 2017
e332ab9
Handle closures in get_field_ty
RalfJung Aug 19, 2017
9ede346
Refactoring: Couple values and types into an object when passed aroun…
oli-obk Aug 24, 2017
f860ad8
Merge pull request #306 from RalfJung/closures
oli-obk Aug 24, 2017
110d50e
Merge branch 'master' into libstd
oli-obk Aug 24, 2017
1901885
Simplify dropping by reusing `eval_fn_call`
oli-obk Aug 24, 2017
4e3c502
Merge pull request #309 from oli-obk/libstd
oli-obk Aug 24, 2017
fad1bc8
Merge branch 'master' into drop
oli-obk Aug 24, 2017
d38c328
Merge pull request #310 from oli-obk/drop
oli-obk Aug 25, 2017
8539728
memory: make sure we check non-NULL/undef even fore 0-sized accesses
RalfJung Aug 25, 2017
f036fe0
refactor memory read API: provide only size-based, no type-based methods
RalfJung Aug 25, 2017
b1ca654
refactor memory write API to match read API
RalfJung Aug 25, 2017
ac80212
move tests with MIR-opt to their own function we we can run them sepa…
RalfJung Aug 25, 2017
8ce6b06
Remove specialize float/bool read/write methods from memory
RalfJung Aug 25, 2017
1ee718a
update compiletest. maybe that helps with the spurious failures.
RalfJung Aug 26, 2017
df20c06
use tempdir to create a dedicated directory for each test
RalfJung Aug 26, 2017
2e28e14
reorder lets so that build_dir is deleted last
RalfJung Aug 26, 2017
54a1f07
Merge pull request #312 from RalfJung/compiletest
RalfJung Aug 26, 2017
2307d6f
Merge branch 'master' into memory
RalfJung Aug 26, 2017
8b5f22c
use rustc version of fulfill_obligation now that we can
dwrensha Aug 26, 2017
b6d0597
Merge pull request #314 from dwrensha/fulfill-obligation
eddyb Aug 26, 2017
3464401
Merge branch 'master' into memory
oli-obk Aug 26, 2017
907d2c7
rustc #43457 got fixed, we can enable more tests
RalfJung Aug 27, 2017
1fce886
Make some things public that are required by priroda
oli-obk Aug 28, 2017
7355a1e
Remove some unused `extern crate`
oli-obk Aug 28, 2017
ac7dfca
Fix #313 by correctly copying relocations when doing overlapping copies
oli-obk Aug 28, 2017
e28f4a8
Add a regression test for #313
oli-obk Aug 28, 2017
9d10e01
Mir validation can't cope with `mem::uninitialized::<SomeEnum>()`
oli-obk Aug 28, 2017
02a0f0f
Turn off validation for some compile-fail tests
oli-obk Aug 28, 2017
e53e9b9
Deduplicate writing null case of struct wrapped nullable pointers
oli-obk Aug 28, 2017
b93462a
Merge pull request #315 from RalfJung/validation
oli-obk Aug 28, 2017
385b5b9
Merge branch 'master' into priroda
oli-obk Aug 28, 2017
129b914
`int_align` has no dynamic error case
oli-obk Aug 28, 2017
2f0dcfb
Simplify `write_value_to_ptr`
oli-obk Aug 28, 2017
44a360d
Merge pull request #316 from solson/priroda
oli-obk Aug 28, 2017
dd5b010
Merge remote-tracking branch 'origin/master' into memory
oli-obk Aug 28, 2017
f817f1c
Get rid of env var race condition once and for all
oli-obk Aug 28, 2017
55eaf5e
Also update the rustc test suite runner
oli-obk Aug 28, 2017
b8329da
Merge pull request #311 from RalfJung/memory
oli-obk Aug 29, 2017
206f0bd
Fix panic in subslice patterns of arrays (fixes #276)
oli-obk Aug 29, 2017
fb96a09
Merge pull request #318 from oli-obk/memory
oli-obk Aug 29, 2017
88fc45b
Get some more rustc tests working
oli-obk Aug 29, 2017
941fbf5
Merge pull request #319 from oli-obk/memory
oli-obk Aug 29, 2017
506a5c7
Mir optimizations treat single variant enums as structs
oli-obk Aug 29, 2017
446ed26
Add at least the program name argument in order to get rustc tests a …
oli-obk Aug 29, 2017
33bfb64
Merge pull request #320 from oli-obk/memory
oli-obk Aug 29, 2017
e6a874b
test new From instances for Rc
RalfJung Aug 29, 2017
4b67bfa
Merge pull request #322 from RalfJung/rc-tests
RalfJung Aug 29, 2017
58a59e9
Rustup (generator support)
oli-obk Aug 30, 2017
3243843
Merge pull request #323 from oli-obk/generators
oli-obk Aug 30, 2017
cf25ef9
Implement `align_offset` intrinsic and thus enabling `from_utf8`
oli-obk Sep 1, 2017
bb2bfb4
update for upstream rename: CodeExtent -> Scope
dwrensha Sep 4, 2017
ea911ca
disable validation in failing tests for now
RalfJung Sep 4, 2017
10101dd
rename variables to match new type name
RalfJung Sep 4, 2017
0002b5a
Merge pull request #328 from dwrensha/rustup
RalfJung Sep 4, 2017
9a273e0
update backtrace to newly released version
RalfJung Sep 2, 2017
f1da208
also update rustc_test
RalfJung Sep 4, 2017
41be917
make sure the lock file is not changed when building on CI
RalfJung Sep 4, 2017
ff75da2
Merge pull request #327 from RalfJung/backtrace
RalfJung Sep 4, 2017
df895cd
no reason not to run tests in miri (once someone writes them)
RalfJung Sep 1, 2017
8dff161
update compiletest; we do not need tempdir any more
RalfJung Sep 1, 2017
9386f05
Merge pull request #325 from RalfJung/test
RalfJung Sep 4, 2017
3b6852a
Merge branch 'master' into align_offset
RalfJung Sep 4, 2017
ee5383f
Merge pull request #324 from oli-obk/align_offset
RalfJung Sep 4, 2017
e9315a6
Rustup
oli-obk Sep 5, 2017
59cbfdb
enable a test that works just fine
RalfJung Sep 6, 2017
2ee999b
use latest xargo; this fixes the libstd build problem
RalfJung Sep 6, 2017
9fe0d60
disable optimized tests until rustc is fixed
RalfJung Sep 6, 2017
b456b7c
Merge pull request #330 from RalfJung/rustup
RalfJung Sep 6, 2017
79f90d1
Make our build work just like the rustc build
oli-obk Sep 7, 2017
5570a78
Disable validation for some tests
oli-obk Sep 7, 2017
2c4fcd8
Merge pull request #329 from solson/oli-obk-patch-2
RalfJung Sep 8, 2017
bc2f925
rustup
oli-obk Sep 8, 2017
1591977
clean up suspensions when function ends
RalfJung Sep 9, 2017
00c909d
we can enable a bunch of tests for validation again
RalfJung Sep 9, 2017
41f2288
fix warnings in tests; update validation whitelist
RalfJung Sep 9, 2017
a5fa8e9
only test on master
RalfJung Sep 9, 2017
ce48754
there are more tests we can enable again
RalfJung Sep 9, 2017
a1f71af
restrict cur_frame visibility
RalfJung Sep 9, 2017
8307d27
Merge pull request #332 from solson/rustup
RalfJung Sep 9, 2017
ce3576f
Use correct rustc in rust's CI
oli-obk Sep 11, 2017
d5d3e3b
Merge pull request #333 from solson/rust_ci
eddyb Sep 11, 2017
79993e6
rustup (part 1/2)
RalfJung Sep 13, 2017
c47ee6b
Rustup part 2/2
oli-obk Sep 13, 2017
2cf984d
This is unreachable code and it should never ever be reachable even i…
oli-obk Sep 13, 2017
02a943b
Merge pull request #335 from solson/rustup
RalfJung Sep 13, 2017
aa578de
identify write locks by lvalues, not regions
RalfJung Sep 13, 2017
bac89ae
enable validation for a bunch of more tests
RalfJung Sep 13, 2017
59a329d
use catch expression to handle the 'release undef' problem slightly b…
RalfJung Sep 13, 2017
c163097
Disable the address-of-ZST test for now; it is buggy as it disagrees …
RalfJung Sep 13, 2017
5d2ed4d
Something in panic handling fails validation with full-MIR
RalfJung Sep 13, 2017
237590a
Merge pull request #336 from RalfJung/mir-validate
RalfJung Sep 13, 2017
a66f622
rustup
RalfJung Sep 14, 2017
91d9b83
validation: remove a hack that is no longer necessary
RalfJung Sep 14, 2017
24e45de
travis: more consistent cargo flags (--locked, --release)
RalfJung Sep 14, 2017
7ec04cb
`cargo install` only takes `--debug`, not `--release`
oli-obk Sep 14, 2017
ca0f063
fix rustc_tests build
RalfJung Sep 14, 2017
02e09dc
Merge pull request #337 from RalfJung/rustup
RalfJung Sep 14, 2017
9db9308
Storage{Live,Dead} in generators got fixed
RalfJung Sep 15, 2017
e8ea7da
Merge pull request #339 from RalfJung/rustup
oli-obk Sep 15, 2017
8cbfbf7
Remove `#[linkage(foo)]` statics from core miri
oli-obk Sep 15, 2017
f13455a
Merge pull request #340 from solson/babysteps
oli-obk Sep 15, 2017
ec5820c
Use rustc's APFloat impl instead of interpreter host floats
oli-obk Sep 15, 2017
1fc3a00
Merge pull request #341 from solson/babysteps
oli-obk Sep 15, 2017
2ea6663
validation: check that int, float etc. are not undef
RalfJung Sep 16, 2017
8509dbb
validation: allow undef integers and raw pointers, as a crude work-ar…
RalfJung Sep 16, 2017
bc240ff
add an undef validation test
RalfJung Sep 16, 2017
6d4840e
Merge pull request #342 from RalfJung/mir-validate
oli-obk Sep 16, 2017
060bb2f
use ui test mode rather than mir-opt
RalfJung Sep 16, 2017
e7b0637
Merge branch 'master' into tests
RalfJung Sep 16, 2017
605c82b
Merge pull request #343 from RalfJung/tests
RalfJung Sep 16, 2017
5a5aa49
get rid of the --miri_host_target hack
RalfJung Sep 16, 2017
8bddd6a
Merge pull request #344 from RalfJung/test
RalfJung Sep 16, 2017
cf92528
Add windows support
Sep 16, 2017
709ab24
Merge branch 'master' into windows
oli-obk Sep 16, 2017
0320a77
Run appveyor tests in release mode
Sep 16, 2017
80853e2
Merge pull request #334 from solson/windows
oli-obk Sep 17, 2017
8419abe
Only run appveyor on the master branch and on PRs
oli-obk Sep 17, 2017
b20c038
Merge pull request #346 from solson/oli-obk-patch-3
RalfJung Sep 18, 2017
bf890b9
README: show AppVeyor status
RalfJung Sep 18, 2017
44fac71
fix AppVeyor URL
RalfJung Sep 18, 2017
11e4859
Merge pull request #347 from RalfJung/readme
oli-obk Sep 18, 2017
383153f
update compiletest
RalfJung Sep 19, 2017
728e664
Merge pull request #348 from RalfJung/tests
oli-obk Sep 19, 2017
1ad9709
get rid of ad-hoc inhabitedness test
RalfJung Sep 22, 2017
a5503a3
Merge pull request #350 from RalfJung/inhabited
eddyb Sep 22, 2017
a8980fd
use exchange_malloc lang item for Box statements
RalfJung Sep 25, 2017
6e86503
fix oom2 test
RalfJung Sep 25, 2017
ed674f7
Merge pull request #351 from RalfJung/exchange_malloc
oli-obk Sep 27, 2017
f035b3d
Remove all non-CTFE stuff from the miri repository
oli-obk Sep 18, 2017
f835974
Move miri base code to rustc::mir::interpret
oli-obk Sep 29, 2017
df5e122
Merge remote-tracking branch 'miri/upstream' into miri
oli-obk Sep 29, 2017
ea35192
Adjust imports to librustc::mir::interpret
oli-obk Sep 18, 2017
d4c442d
Expose miri <-> ctfe differences
oli-obk Sep 19, 2017
acdf83f
Update miri to rustc changes
oli-obk Dec 6, 2017
fe58398
Merge remote-tracking branch 'origin/master' into miri
oli-obk Dec 6, 2017
42a534c
miri: monomorphize types iff they came from MIR.
eddyb Dec 6, 2017
bf5ec79
miri: import ty::Ty directly.
eddyb Dec 6, 2017
ff6152c
miri: move param_env from Machine to EvalContext.
eddyb Dec 6, 2017
9cb6499
miri: don't use an associated constant for a Machine's own data.
eddyb Dec 6, 2017
a792b6c
Merge remote-tracking branch 'origin/master' into miri
oli-obk Dec 6, 2017
0f6b5b0
Update miri submodule
oli-obk Dec 6, 2017
7e5583b
Merge remote-tracking branch 'origin/master' into miri
oli-obk Dec 11, 2017
8c2ec68
Put miri const eval checking behind -Zmiri
oli-obk Dec 11, 2017
acac585
Move large chunks of miri from rustc::mir::interpret to rustc_mir::in…
oli-obk Dec 12, 2017
1ba46dc
Move mir validation out of tree
oli-obk Dec 14, 2017
7a2bff7
Do not produce debuginfo for tools
oli-obk Dec 14, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ before_deploy:
cp -r obj/build/dist/* deploy/$TRAVIS_COMMIT;
fi
- travis_retry gem update --system
- ls -la deploy/$TRAVIS_COMMIT

deploy:
- provider: s3
Expand Down
21 changes: 21 additions & 0 deletions src/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/bootstrap/bin/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,9 @@ fn main() {
// When running miri tests, we need to generate MIR for all libraries
if env::var("TEST_MIRI").ok().map_or(false, |val| val == "true") {
cmd.arg("-Zalways-encode-mir");
if stage != "0" {
cmd.arg("-Zmiri");
}
cmd.arg("-Zmir-emit-validate=1");
}

Expand Down
7 changes: 4 additions & 3 deletions src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -499,9 +499,10 @@ impl<'a> Builder<'a> {
if mode != Mode::Tool {
// Tools don't get debuginfo right now, e.g. cargo and rls don't
// get compiled with debuginfo.
cargo.env("RUSTC_DEBUGINFO", self.config.rust_debuginfo.to_string())
.env("RUSTC_DEBUGINFO_LINES", self.config.rust_debuginfo_lines.to_string())
.env("RUSTC_FORCE_UNSTABLE", "1");
// Adding debuginfo increases their sizes by a factor of 3-4.
cargo.env("RUSTC_DEBUGINFO", self.config.rust_debuginfo.to_string());
cargo.env("RUSTC_DEBUGINFO_LINES", self.config.rust_debuginfo_lines.to_string());
cargo.env("RUSTC_FORCE_UNSTABLE", "1");

// Currently the compiler depends on crates from crates.io, and
// then other crates can depend on the compiler (e.g. proc-macro
Expand Down
6 changes: 5 additions & 1 deletion src/bootstrap/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ impl Step for Rustfmt {

#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub struct Miri {
stage: u32,
host: Interned<String>,
}

Expand All @@ -336,15 +337,17 @@ impl Step for Miri {

fn make_run(run: RunConfig) {
run.builder.ensure(Miri {
stage: run.builder.top_stage,
host: run.target,
});
}

/// Runs `cargo test` for miri.
fn run(self, builder: &Builder) {
let build = builder.build;
let stage = self.stage;
let host = self.host;
let compiler = builder.compiler(1, host);
let compiler = builder.compiler(stage, host);

if let Some(miri) = builder.ensure(tool::Miri { compiler, target: self.host }) {
let mut cargo = builder.cargo(compiler, Mode::Tool, host, "test");
Expand Down Expand Up @@ -766,6 +769,7 @@ impl Step for Compiletest {
if build.config.rust_debuginfo_tests {
flags.push("-g".to_string());
}
flags.push("-Zmiri -Zunstable-options".to_string());

if let Some(linker) = build.linker(target) {
cmd.arg("--linker").arg(linker);
Expand Down
4 changes: 4 additions & 0 deletions src/librustc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@ graphviz = { path = "../libgraphviz" }
jobserver = "0.1"
log = "0.3"
owning_ref = "0.3.3"
rustc_apfloat = { path = "../librustc_apfloat" }
rustc_back = { path = "../librustc_back" }
rustc_const_math = { path = "../librustc_const_math" }
rustc_data_structures = { path = "../librustc_data_structures" }
rustc_errors = { path = "../librustc_errors" }
serialize = { path = "../libserialize" }
syntax = { path = "../libsyntax" }
syntax_pos = { path = "../libsyntax_pos" }
backtrace = "0.3.3"
byteorder = { version = "1.1", features = ["i128"]}


# Note that these dependencies are a lie, they're just here to get linkage to
# work.
Expand Down
5 changes: 5 additions & 0 deletions src/librustc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
#![feature(unboxed_closures)]
#![feature(underscore_lifetimes)]
#![feature(trace_macros)]
#![feature(catch_expr)]
#![feature(test)]

#![recursion_limit="512"]
Expand All @@ -89,6 +90,10 @@ extern crate jobserver;

extern crate serialize as rustc_serialize; // used by deriving

extern crate rustc_apfloat;
extern crate byteorder;
extern crate backtrace;

// Note that librustc doesn't actually depend on these crates, see the note in
// `Cargo.toml` for this crate about why these are here.
#[allow(unused_extern_crates)]
Expand Down
Loading