Skip to content

Commit

Permalink
Store a valid name for the root module in metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
mitaa committed Nov 13, 2015
1 parent f1f5c04 commit 02f9a49
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustc/metadata/encoder.rs
Expand Up @@ -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 {
Expand Down
12 changes: 12 additions & 0 deletions src/test/auxiliary/issue-28927-1.rs
@@ -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;
11 changes: 11 additions & 0 deletions src/test/auxiliary/issue-28927-2.rs
@@ -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;
16 changes: 16 additions & 0 deletions src/test/rustdoc/issue-28927.rs
@@ -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;

0 comments on commit 02f9a49

Please sign in to comment.