Closed
Description
pub const bar: u8 = 1;
fn foo(bar: bool) { }
gives me a type error, because it resolves bar
to the constant and then realizes it's the wrong type.
Resolving bar
to a constant isn't something that will ever work anyway, because if you write something like
pub const bar: bool = true;
fn foo(bar: bool) { }
it will move on to the "refutable pattern in function argument" error.
We should just not attempt constant resolution for irrefutable patterns.
This is technically a language change -- code that would previously not compile will now compile. cc @rust-lang/lang