]> git.lizzy.rs Git - rust.git/commitdiff
Store a valid name for the root module in metadata
authormitaa <mitaa.ceb@gmail.com>
Wed, 11 Nov 2015 21:10:21 +0000 (22:10 +0100)
committermitaa <mitaa.ceb@gmail.com>
Fri, 13 Nov 2015 08:05:38 +0000 (09:05 +0100)
src/librustc/metadata/encoder.rs
src/test/auxiliary/issue-28927-1.rs [new file with mode: 0644]
src/test/auxiliary/issue-28927-2.rs [new file with mode: 0644]
src/test/rustdoc/issue-28927.rs [new file with mode: 0644]

index 8e2c2e6a0bfbd2d0ce8fc09f787ee967edf3bd91..1cd196895e3a49873732099921b1b82160d576fe 100644 (file)
@@ -1500,7 +1500,7 @@ fn encode_info_for_items<'a, 'tcx>(ecx: &EncodeContext<'a, 'tcx>,
                         &[],
                         CRATE_NODE_ID,
                         [].iter().cloned().chain(LinkedPath::empty()),
-                        syntax::parse::token::special_idents::invalid.name,
+                        syntax::parse::token::intern(&ecx.link_meta.crate_name),
                         hir::Public);
 
     visit::walk_crate(&mut EncodeVisitor {
diff --git a/src/test/auxiliary/issue-28927-1.rs b/src/test/auxiliary/issue-28927-1.rs
new file mode 100644 (file)
index 0000000..7d6b448
--- /dev/null
@@ -0,0 +1,12 @@
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+extern crate issue_28927_2 as inner2;
+pub use inner2 as bar;
diff --git a/src/test/auxiliary/issue-28927-2.rs b/src/test/auxiliary/issue-28927-2.rs
new file mode 100644 (file)
index 0000000..c511700
--- /dev/null
@@ -0,0 +1,11 @@
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+pub struct Baz;
diff --git a/src/test/rustdoc/issue-28927.rs b/src/test/rustdoc/issue-28927.rs
new file mode 100644 (file)
index 0000000..b3096a9
--- /dev/null
@@ -0,0 +1,16 @@
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// aux-build:issue-28927-2.rs
+// aux-build:issue-28927-1.rs
+// ignore-cross-compile
+
+extern crate issue_28927_1 as inner1;
+pub use inner1 as foo;