{"slug": "chat-bot-mistakes-rust-vecs", "title": "Chat Bot Mistakes Rust Vecs", "summary": "A user testing a well-known online chat bot found it confidently incorrect about Rust's memory layout, claiming a Vec<bool> stores each bool as a single bit. In reality, a bool in Rust requires 1 byte (8 bits), as confirmed by the user's test program allocating 100 million bools in a Vec, which used about 100,000 kB, indicating roughly 1 byte per bool. The incident highlights that AI chat bots can provide plausible but false technical information.", "body_md": "Today I was using an **online chat bot** (a well-known one) and exploring changes to my Rust code. The chat bot confidently told me that in Rust a `Vec`\n\nof `bool`\n\nis encoded as a single bit per `bool`\n\n. I even asked if this was \"truly\" the case in Rust, as I was not familiar with this.\n\nIn Rust the `Vec`\n\ntype does not tend to have type-specific optimizations like for `bool`\n\n. It is **supposed** to be **simple**. The chat bot explained that yes, in Rust a Vector of bools only requires 1 bit per `bool`\n\n.\n\nThis is not correct. A `bool`\n\nrequires 1 byte in Rust, and 1 byte is 8 bits. Further online searches **supported** this—the chat bot was **confidently wrong**.\n\nI created a test program that allocated **100 million bools** in a `Vec`\n\n, and then used the bools in an infinite loop. It required about 100000 kB, which means that about 1000 bools fit in 1 kB of memory. Which means that 1 `bool`\n\nrequires about 1 byte. There has to be some source of truth—and AI chat bots can be wrong.", "url": "https://wpnews.pro/news/chat-bot-mistakes-rust-vecs", "canonical_source": "https://www.dotnetperls.com/2026_8_12_chat-bot-mistakes-rust-vecs", "published_at": "2026-08-12 07:00:00+00:00", "updated_at": "2026-08-12 22:14:00.530448+00:00", "lang": "en", "topics": ["artificial-intelligence", "large-language-models"], "entities": ["Rust"], "alternates": {"html": "https://wpnews.pro/news/chat-bot-mistakes-rust-vecs", "markdown": "https://wpnews.pro/news/chat-bot-mistakes-rust-vecs.md", "text": "https://wpnews.pro/news/chat-bot-mistakes-rust-vecs.txt", "jsonld": "https://wpnews.pro/news/chat-bot-mistakes-rust-vecs.jsonld"}}