I've been getting this weird rust analyzer bug where the None Option<T> type is not part of Option<T> at all and in fact it thinks None doesn't even exist.
Instead it auto fills with None::header
This happens in vs code purely with the rust analyzer
I tried clearing the cache, and reinstalling. but it spewed a bunch of errors and refused
It's across all my projects
Is there any way to delete some rust analyzer files myself perhaps?
#Rust Option::None doesn't exist in rust analyzer.
17 messages · Page 1 of 1 (latest)
Okay so it must be a setting, as deleted the entire extension folder. while it was uninstalled. and it still came back after reinstalling
it seems to be coming from misunderstanding this:
/// The `Option` type. See [the module level documentation](self) for more.
#[derive(Copy, PartialOrd, Eq, Ord, Debug, Hash)]
#[rustc_diagnostic_item = "Option"]
#[stable(feature = "rust1", since = "1.0.0")]
pub enum Option<T> {
/// No value.
#[lang = "None"]
#[stable(feature = "rust1", since = "1.0.0")]
self.header = None,
/// Some value of type `T`.
#[lang = "Some"]
#[stable(feature = "rust1", since = "1.0.0")]
Some(#[stable(feature = "rust1", since = "1.0.0")] T),
}
okay i did some slight botching, and removed the self.header = part
I do really hope it doesn't fuck everything up
but it seems to be working correctly now
if anyone can verify if that part is there for them too? or if it was just me with the self.header = part
where did you get that self.header = part? that doesnt exist in std and its not valid syntax in an enum
I might have done some extreme fat fingering a while back
i was pasting, when my mouse went crazy
autoclicker hotkey... together with some driver bug
so yeah, extreme fat fingering it is
ok, why copy paste Option though?
I didn't
well this is what it should be rs /// The `Option` type. See [the module level documentation](self) for more. #[derive(Copy, PartialOrd, Eq, Ord, Debug, Hash)] #[rustc_diagnostic_item = "Option"] #[stable(feature = "rust1", since = "1.0.0")] pub enum Option<T> { /// No value. #[lang = "None"] #[stable(feature = "rust1", since = "1.0.0")] None, /// Some value of type `T`. #[lang = "Some"] #[stable(feature = "rust1", since = "1.0.0")] Some(#[stable(feature = "rust1", since = "1.0.0")] T), }