]> git.lizzy.rs Git - rust.git/commit
Make `TooGeneric` error in WF checking a proper error
authorvarkor <github@varkor.com>
Mon, 20 Jan 2020 15:22:12 +0000 (15:22 +0000)
committervarkor <github@varkor.com>
Tue, 21 Jan 2020 01:03:15 +0000 (01:03 +0000)
commitdd0507c054ea27ae836025761908d339a478e0ab
tree46d1061dacc21dd0d2a235604364ec3db08077d9
parent900811e43047fc5593f39b0363373530b02c87e0
Make `TooGeneric` error in WF checking a proper error

`TooGeneric` is encountered during WF checking when we cannot determine that a constant involving a generic parameter will always be evaluated successfully (rather than resulting in an error). In these cases, the burden of proof should be with the caller, so that we can avoid post-monomorphisation tim errors (which was the previous previous behaviour). This commit ensures that this situation produces a proper compiler error, rather than silently ignoring it or ICEing.
src/librustc/traits/error_reporting/mod.rs
src/test/ui/const-generics/array-size-in-generic-struct-param.rs
src/test/ui/const-generics/array-size-in-generic-struct-param.stderr