D-Programming-Language/dmd — pull request #3907 by 9rnsr (2014-08-27 14:52:07+00:00)
Title: [enh] Issue 12567 - Modules can't be marked as deprecated

https://issues.dlang.org/show_bug.cgi?id=12567

Points:

1. Compiler checks the deprecation when the module is imported.

```d
deprecated("std.regexp is deprecated. Please use std.regex instead.")
module std.regexp
```
```d
module test;
import std.regexp; // This line will report the message
```

2. `ModuleDeclaraion` is necessary if you want to make the module deprecated.

3. Deprecating a module does not deprecate its members automatically.

It's useful if you want to merely rename modules.

```d
deprecated("std.regexp is renamed to std.regex.")
module std.regexp;
/* All members are not implicitly marked as deprecated */
```
```d
module std.regex;
/* Exactly same contents with in std.regexp. */
```