D-Programming-Language/druntime — pull request #221 by alexrp (2012-05-17 07:46:20+00:00)
Title: Apply attributes in the 'object' module.

* Avoid @safe for most things; use @trusted instead. This is to give
the runtime as much freedom as it needs while still giving the @safe
guarantee to users.
* Apply pure and nothrow on almost everything.
* Apply const on a lot of fields and return values.
* Make constructors on most type info classes private. Not done on
TypeInfo itself because introducing an explicit ctor has visibility
issues and also requires assigning fields.
* Fix some tests as a result of these changes.

Note that a lot of ugly cast()s are used. While unfortunate, there
isn't really any good way around them, given that D doesn't have head
const. Besides, they are hidden in the runtime implementation, so it's
not something that will affect users.

Note that this commit results in many breaking changes in the public
interface. However, I believe this is for the best, because users
really have no business creating TypeInfo* objects (or mutating them,
for that matter). We need to make this change sooner or later.

That said, please don't pull this in for 2.060. I'd rather wait until the next
release with these breaking changes.