← Latest papers
💻 computer science

MISRust: Mapping MISRA-C++ Coding Guidelines to the Rust Programming Language

This paper systematically maps the 179 MISRA C++ 2023 guidelines to the Rust programming language, categorizing them by applicability to demonstrate how Rust's design enforces nearly half of the rules automatically while providing specific adaptations and identifying gaps for the remaining guidelines to support safety-critical system development.

Original authors: Marius Molz, Niels Schneider, Sven Lechner, Stefan Kowalewski, Alexandru Kampmann

Published 2026-05-25
📖 5 min read🧠 Deep dive

Original authors: Marius Molz, Niels Schneider, Sven Lechner, Stefan Kowalewski, Alexandru Kampmann

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are building a high-stakes machine, like a self-driving car or a medical device. You can't afford for a single bolt to come loose or a wire to short-circuit. For decades, engineers building these machines with the C++ programming language have followed a massive, strict rulebook called MISRA. Think of MISRA as a 179-page "Safety Manual" that says things like, "Never do this," "Always do that," and "If you touch this specific part, you must wear a helmet."

Now, a new, safer language called Rust has arrived. Rust is like a super-advanced construction kit that automatically prevents many common mistakes (like dropping a bolt or crossing wires) just by how it's built. Because Rust is so safe by design, engineers are starting to use it for those same high-stakes machines.

The Problem:
The old safety manual (MISRA) was written for C++. It has rules about things that Rust doesn't even have, and it misses things that Rust handles differently. If you try to use the old manual for the new kit, you'll end up with a lot of confusing, unnecessary rules.

The Solution (The Paper's Mission):
The authors of this paper acted like translators and safety inspectors. They took every single one of the 179 rules from the old C++ manual and asked: "Does this rule still make sense for Rust?"

They created a new system to sort these rules into six different bins:

  1. The "Trash" Bin (Not Applicable): These are rules about things that simply don't exist in Rust.
    • Analogy: Imagine a rule saying, "Don't use a horse-drawn carriage." If you are driving a Tesla, this rule is useless. You don't have a horse, so you don't need to worry about it. About 32% of the old rules fell into this category.
  2. The "Magic" Bin (Already Satisfied): These are rules that Rust enforces automatically.
    • Analogy: Imagine a rule saying, "Don't let the car drive off a cliff." In Rust, the car literally cannot drive off a cliff because the steering wheel is locked until you check the map. The rule is still true, but you don't need to write it down because the car's design makes it impossible to break. About 30% of the rules fell here.
  3. The "Still Needed" Bin (Required in Safe Rust): These are rules about general good sense that Rust doesn't automatically fix.
    • Analogy: Even with a perfect car, you still need a rule saying, "Don't drive while asleep." Rust prevents mechanical failures, but it can't stop a sleepy driver from making a bad decision. About 12% of the rules are still needed even when using the "safe" version of Rust.
  4. The "Danger Zone" Bin (Required in Unsafe Rust): Rust has a special "break glass in case of emergency" mode called Unsafe. This lets you bypass the safety locks to do powerful, low-level things.
    • Analogy: If you decide to take the safety locks off the car to race, you suddenly need all those old safety rules back. The paper found that 36 rules, which were automatically handled by Rust's safety, suddenly become critical again if you use this "Unsafe" mode.
  5. The "Translation" Bin (Needs Adaptation): Some rules are about concepts that exist in both languages but work differently.
    • Analogy: A rule might say, "Don't use a screwdriver to hammer a nail." In Rust, you don't use screwdrivers at all; you use a specialized tool. The intent (don't use the wrong tool) is the same, but the specific instruction needs to be rewritten to fit Rust's tools. About 6% of the rules needed this kind of translation.
  6. The "Missing" Bin: The paper notes that there are some safety gaps where Rust needs new rules that don't exist in the old manual yet.

The Big Takeaways:

  • Rust is a Game Changer: Because Rust is built so safely, nearly 61% of the old C++ safety rules are either unnecessary or automatically handled by the language itself. This means a future safety manual for Rust could be much shorter and easier to follow.
  • The "Unsafe" Catch: If you use Rust's "Safe" mode, you are very protected. But if you use the "Unsafe" mode (which is sometimes necessary for high-performance tasks), you lose those automatic protections. The paper highlights that safety certification for Rust must focus heavily on how these "Unsafe" sections are managed.
  • It's Not Done Yet: While Rust is great, the paper notes that the tools and industry standards aren't fully mature yet. It's like having a fantastic new car, but the traffic laws and insurance companies haven't fully caught up to it. For now, Rust is likely to be used alongside C++ (like adding a new, safer engine to an old car) rather than replacing it entirely immediately.

In Summary:
The authors didn't just say "Rust is good." They did the hard work of mapping the old safety rules to the new language, proving that Rust's design eliminates a huge chunk of the old rulebook, while clearly identifying which specific rules still matter and where new rules need to be written. They made all their findings public so engineers can start building safer systems with Rust today.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →