Don't run const propagation on items with inconsistent bounds
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.
This commit is contained in:
parent
e82febc78e
commit
5896998e76
3 changed files with 31 additions and 0 deletions
|
|
@ -1,4 +1,8 @@
|
|||
// run-pass
|
||||
// Force mir to be emitted, to ensure that const
|
||||
// propagation doesn't ICE on a function
|
||||
// with an 'impossible' body. See issue #67696
|
||||
// compile-flags: --emit=mir,link
|
||||
// Inconsistent bounds with trait implementations
|
||||
|
||||
#![feature(trivial_bounds)]
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
warning: due to multiple output types requested, the explicitly specified output file name will be adapted for each output type
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue