]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #67914 - Aaron1011:fix/const-prop-impossible, r=matthewjasper,oli-obk
authorYuki Okushi <huyuumi.dev@gmail.com>
Wed, 15 Jan 2020 12:51:43 +0000 (21:51 +0900)
committerGitHub <noreply@github.com>
Wed, 15 Jan 2020 12:51:43 +0000 (21:51 +0900)
Don't run const propagation on items with inconsistent bounds

Fixes #67696

Using `#![feature(trivial_bounds)]`, it's possible to write functions
with unsatisfiable 'where' clauses, making them uncallable. However, the
user can act as if these 'where' clauses are true inside the body of the
function, leading to code that would normally be impossible to write.

Since const propgation can run even without any user-written calls to a
function, we need to explcitly check for these uncallable functions.

1  2 
src/librustc/query/mod.rs
src/librustc/ty/query/keys.rs

Simple merge
Simple merge