rust/src
bors 6beb06ee5e Auto merge of #47746 - varkor:never-type-ice, r=nikomatsakis
Fix never-type rvalue ICE

This fixes #43061.
r? @nikomatsakis

A small post-mortem as a follow-up to our investigations in https://github.com/rust-lang/rust/pull/47291:
The problem as I understand it is that when `NeverToAny` coercions are made, the expression/statement that is coerced may be enclosed in a block. In our case, the statement `x;` was being transformed to something like: `NeverToAny( {x;} )`. Then, `NeverToAny` is transformed into an expression:
000fbbc9b8/src/librustc_mir/build/expr/into.rs (L52-L59)
Which ends up calling `ast_block_stmts` on the block `{x;}`, which triggers this condition:
000fbbc9b8/src/librustc_mir/build/block.rs (L141-L147)
In our case, there is no return expression, so `push_assign_unit` is called. But the block has already been recorded as _diverging_, meaning the result of the block will be assigned to a location of type `!`, rather than `()`. This causes the MIR error.
I'm assuming the `NeverToAny` coercion code is doing what it's supposed to (there don't seem to be any other problems), so fixing the issue simply consists of checking that the destination for the return value actually _is_ supposed to be a unit. (If no return value is given, the only other possible type for the return value is `!`, which can just be ignored, as it will be unreachable anyway.)

I checked the other cases of `push_assign_unit`, and it didn't look like they could be affected by the divergence issue (blocks are kind of special-cased in this regard as far as I can tell), so this should be sufficient to fix the issue.
2018-01-28 00:40:10 +00:00
..
binaryen@1c9bf65aa0
bootstrap Merge branch 'beta-prerelease' of https://github.com/cuviper/rust into rollup 2018-01-26 06:52:55 -08:00
build_helper Revert "Add a file to trivially disable tool building or testing" 2017-12-27 00:00:45 +08:00
ci Revert update of the i686-freebsd builder 2018-01-25 14:53:30 -08:00
dlmalloc@d3812c3acc
doc fix for documentation error issue 47716 2018-01-24 09:25:46 -07:00
etc Correct the return type for x86_mm256_sad_epu8 2017-12-21 22:58:03 +00:00
grammar
jemalloc@1f5a28755e
liballoc Auto merge of #47006 - bitshifter:stabilize-repr-align, r=eddyb 2018-01-25 00:26:17 +00:00
liballoc_jemalloc Make liballoc_jemalloc work on CloudABI. 2018-01-18 21:11:24 +01:00
liballoc_system Build the right platform module on CloudABI. 2017-12-31 13:21:46 +01:00
libarena Rollup merge of #47069 - Kagamihime:master, r=nrc 2018-01-13 02:26:23 +08:00
libbacktrace
libcompiler_builtins@0a95675bab Update compiler-builtins submodule 2018-01-24 18:26:27 -08:00
libcore Auto merge of #47299 - cramertj:unsafe-placer, r=alexcrichton 2018-01-24 07:22:22 +00:00
libfmt_macros
libgetopts
libgraphviz Fix docs for future pulldown migration 2018-01-01 14:44:12 +01:00
liblibc@2b4cd1016b Upgrade liblibc to latest upstream version. 2018-01-08 16:59:15 +01:00
libpanic_abort Let libpanic_abort call into libc's abort() on CloudABI. 2018-01-05 22:16:54 +01:00
libpanic_unwind Make libpanic_unwind build on CloudABI. 2018-01-04 17:55:44 +01:00
libproc_macro Auto merge of #46551 - jseyfried:improve_legacy_modern_macro_interaction, r=nrc 2018-01-12 10:00:09 +00:00
libprofiler_builtins
librustc end_point handling multibyte characters correctly. 2018-01-27 11:46:27 +00:00
librustc_allocator
librustc_apfloat in which the unused-parens lint comes to cover function and method args 2018-01-18 08:33:58 -08:00
librustc_asan
librustc_back llvm6: CodeModel::{JIT,}Default no longer exists 2018-01-24 07:18:01 -08:00
librustc_binaryen
librustc_borrowck end_point handling multibyte characters correctly. 2018-01-27 11:46:27 +00:00
librustc_const_eval Auto merge of #47374 - topecongiro:issue-47096, r=nikomatsakis 2018-01-25 03:20:54 +00:00
librustc_const_math rustc: use {U,I}size instead of {U,I}s shorthands. 2018-01-04 03:12:04 +02:00
librustc_cratesio_shim
librustc_data_structures Stabilize std::ptr::NonNull 2018-01-20 11:09:23 +01:00
librustc_driver Do not capture stderr in the compiler. Instead just panic silently for fatal errors 2018-01-26 04:52:30 +01:00
librustc_errors Auto merge of #47690 - estebank:for-block-277, r=nikomatsakis 2018-01-27 08:04:12 +00:00
librustc_incremental Allow runtime switching between trans backends 2018-01-19 20:27:10 +01:00
librustc_lint Adds support for immovable generators. Move checking of invalid borrows across suspension points to borrowck. Fixes #44197, #45259 and #45093. 2018-01-23 05:10:38 +01:00
librustc_llvm Rollup merge of #47710 - alexcrichton:llvm-6-compat, r=nikomatsakis 2018-01-25 13:49:54 -08:00
librustc_lsan
librustc_metadata Auto merge of #47494 - michaelwoerister:proc-macro-incremental, r=nikomatsakis 2018-01-19 04:45:22 +00:00
librustc_mir Auto merge of #47746 - varkor:never-type-ice, r=nikomatsakis 2018-01-28 00:40:10 +00:00
librustc_msan
librustc_passes AST/HIR: Add a separate structure for labels 2018-01-22 23:13:12 +03:00
librustc_platform_intrinsics Correct the return type for x86_mm256_sad_epu8 2017-12-21 22:58:03 +00:00
librustc_plugin Don't include DefIndex in plugin- and proc-macro registrar fn symbol. 2018-01-16 17:30:11 +01:00
librustc_privacy Reexport -> re-export in prose and documentation comments 2018-01-15 13:36:53 -05:00
librustc_resolve end_point handling multibyte characters correctly. 2018-01-27 11:46:27 +00:00
librustc_save_analysis Adds support for immovable generators. Move checking of invalid borrows across suspension points to borrowck. Fixes #44197, #45259 and #45093. 2018-01-23 05:10:38 +01:00
librustc_trans Merge branch 'simd-always-mem' of https://github.com/alexcrichton/rust into rollup 2018-01-26 06:51:43 -08:00
librustc_trans_utils Fix ICE 2018-01-20 11:55:55 +01:00
librustc_tsan
librustc_typeck end_point handling multibyte characters correctly. 2018-01-27 11:46:27 +00:00
librustdoc Merge branch 'rustdoc_masked' of https://github.com/ollie27/rust into rollup 2018-01-26 06:51:58 -08:00
libserialize Auto merge of #46919 - michaelwoerister:new-leb128, r=sfackler 2018-01-20 02:00:13 +00:00
libstd Print inlined functions on Windows 2018-01-26 04:49:54 +01:00
libstd_unicode Reexport -> re-export in prose and documentation comments 2018-01-15 13:36:53 -05:00
libsyntax Fixed infinite loop issues and added some improved logging. 2018-01-27 13:30:34 +00:00
libsyntax_ext Do not capture stderr in the compiler. Instead just panic silently for fatal errors 2018-01-26 04:52:30 +01:00
libsyntax_pos end_point handling multibyte characters correctly. 2018-01-27 11:46:27 +00:00
libterm
libtest libtest: Failing benchmarks no longer crash the harness. 2018-01-26 19:46:04 +02:00
libunwind Auto merge of #47571 - FenrirWolf:libunwind, r=alexcrichton 2018-01-27 00:28:34 +00:00
llvm@bc344d5bc2 Upgrade LLVM to incorporate a fix for #47364 2018-01-26 09:57:34 +01:00
rt
rtstartup Remove impl Foo for .. in favor of auto trait Foo 2018-01-13 18:48:00 +03:00
rustc
rustllvm Merge branch 'mlsm' of https://github.com/dotdash/rust into rollup 2018-01-26 06:53:18 -08:00
test Auto merge of #47746 - varkor:never-type-ice, r=nikomatsakis 2018-01-28 00:40:10 +00:00
tools Updated Cargo commit hash 2018-01-26 19:57:02 +02:00
Cargo.lock Update rls 2018-01-26 12:58:02 +09:00
Cargo.toml Update Cargo and its dependencies 2018-01-17 23:14:23 -08:00
stage0.txt Bump to 1.25.0 2018-01-04 07:21:22 -08:00