about summary refs log tree commit diff
path: root/src/rt/rust_kernel.cpp
diff options
context:
space:
mode:
authorRamkumar Ramachandra <artagnon@gmail.com>2013-06-23 22:18:43 +0530
committerRamkumar Ramachandra <artagnon@gmail.com>2013-06-25 23:58:48 +0530
commit9f80591d84790a9571707a85cf4bc5d8f6df114d (patch)
treea03261cb60137dcf127e54148616b7137a9e6ca6 /src/rt/rust_kernel.cpp
parent3b126e4d6dda1eac3881b8ca19772071997a7992 (diff)
downloadrust-9f80591d84790a9571707a85cf4bc5d8f6df114d.tar.gz
rust-9f80591d84790a9571707a85cf4bc5d8f6df114d.zip
resolve: report duplicate module definitions
add_child() is responsible for reporting errors about type, value, and
module duplicate definitions.  Although it checks for all three, it uses
namespace_to_str() to convert a Namespace value into a string before
printing an error like:

  error: duplicate definition of type `foo`
                                 ^^^^
  note: first definition of type foo here:
                            ^^^^

Unfortunately, this string can only be one of "type" or
"value" (corresponding to TypeNS and ValueNS respectively), and it
reports duplicate modules as duplicate types.

To alleviate the problem, define a special NamespaceError enum to define
more specialized errors, and use it instead of attempting to reuse the
Namespace enum.

Reported-by: Corey Richardson <corey@octayn.net>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Diffstat (limited to 'src/rt/rust_kernel.cpp')
0 files changed, 0 insertions, 0 deletions