Better error for non const PartialEq
call generated by match
This commit is contained in:
parent
ed7281e784
commit
89c24af133
35 changed files with 211 additions and 100 deletions
|
@ -0,0 +1,12 @@
|
|||
// revisions: stock gated
|
||||
#![cfg_attr(gated, feature(const_trait_impl))]
|
||||
|
||||
const fn foo(input: &'static str) {
|
||||
match input {
|
||||
"a" => (), //[gated]~ ERROR can't compare `str` with `str` in const contexts
|
||||
//~^ ERROR cannot match on `str` in constant functions
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
Loading…
Add table
Add a link
Reference in a new issue