Yes, but that explains how you can develop programs in Rust without OOP, it doesn't explain why “classic” Simula 67-style OOP was never added to Rust.
And it wasn't added because OOP is fundamentally flawed. It's three pillars (inheritance, polymorphism, and encapsulation) are incompatible.
Usually people start with inheritance, polymorphism, then try to add encapsulation… and it doesn't work.
Because the official OOP-term for a property that ensures that your program is doing something useful and not just shuffling random bits around is called LSP and it looks innocent enough:
In layman terms in says: for every property ϕ you have to be able to replace superclass with subclass… but what is ϕ? What kind of property is that?
The answer is hilarious and sad: ϕ is any property which your program may need!
It can not be “any property imaginable” (because then you wouldn't be able to use classes which differ in even minutiae details, which would defeat the purpose of OOP). It can not be “any property from the list of properties defined in advance” (because there are no limits on how you may [ab]use these types). It have to be any property which your program may need… and how do you plan to ensure that?
Basically: you can not, really, ever say whether inheriting from
shape would work or not — except if you study the rest of the programs that rely on these two types (millions, sometimes billions of lines) and collect all the important properties these millions (or billions) of lines may need.
What kind of encapsulation is that? How can you say “it's Ok to inherit from
shape and add
width fields… except when you program does certain things which make it illegal”?
Well… in the “you have to hold it right” language like C++ or “if there are no memory corruption, then we don't care whether your program works or not” like Java it's acceptable approach.
But in Rust… in a language designed around the idea that compiler have to know about your program to stop you from doing mistakes… that if
B in one place then
B in any other place, always and forever approach… it just doesn't fit!