|
|
|
|
|
by tialaramex
21 days ago
|
|
> The resolution of `foo` in `foo(x)` should not depend on the type of `x` This depends on how you're squinting at this word "resolution". Remember on a modern CPU an XOR R1 R1 does not result in an ALU operation, the decoder understands this idiom and just renames a zero'd register as R1, whereas of course it can't do that for say XOR R2 R3 because that's an actual XOR operation. So if "resolution" means "exactly what happens on the CPU" apparently there is no such facility provided even in assembler. So apparently we mean only that it should have, in some sense, the same effect. I think the fact Rust is OK with assert!("Goose".contains('o'))
assert!("Goose".contains("Goo"))
assert!("Goose".contains(&['a', 'e', 'i', 'o', 'u']))
.. meets this criterion, whereas presumably you do not agree. |
|