So, I've encountered a couple (very weird) problems that (I think) are bugs with the 2021 edition of Rust.
First, this code:
if cover & ((1<<(hi+1))-(1<<lo)) > 0 {
eprintln!("{}: overspecified ", name);
exit(1)
}
Generates a compiler error about unknown string prefixes if the trailing whitespace is removed. This doesn't make any sense to me at all, since the word is a suffix, not a prefix, and isn't within the {}
, and I don't recall this ever being mentioned in the Rust 2021 blog post, and it is (not) the syntax described in the edition guide describing reserved syntax for the 2021 edition, so there is no reason that this error should be appearing.
Second, this code:
println!("Done");
(or any other string literal within the double quotes) generates error E0765 (unterminated double quote string). Again, this is a nonsensical error, and is (perfectly) valid rust. It is not reserved syntax nor does it violate any existing syntactic rules for the language. So I am extremely confused by this error. Am using Rust nightly (rustc 1.58.0-nightly (ff0e14829 2021-10-31)). Updating to rustc 1.58.0-nightly (0d1754e8b 2021-11-05) doesn't resolve the problem, nor does switching to stable or beta channels. Is this an actual bug or am I doing something wrong that I missed?