Skip to content

Don't ICE on empty name or vers crate link meta. #8933

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/librustc/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -607,8 +607,8 @@ pub fn build_link_meta(sess: Session,
fn crate_meta_name(sess: Session, output: &Path, opt_name: Option<@str>)
-> @str {
match opt_name {
Some(v) => v,
None => {
Some(v) if !v.is_empty() => v,
_ => {
// to_managed could go away if there was a version of
// filestem that returned an @str
let name = session::expect(sess,
Expand All @@ -624,8 +624,8 @@ pub fn build_link_meta(sess: Session,

fn crate_meta_vers(sess: Session, opt_vers: Option<@str>) -> @str {
match opt_vers {
Some(v) => v,
None => {
Some(v) if !v.is_empty() => v,
_ => {
let vers = @"0.0";
warn_missing(sess, "vers", vers);
vers
Expand Down
1 change: 0 additions & 1 deletion src/libsyntax/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,6 @@ pub fn require_unique_names(diagnostic: @mut span_handler,
for meta in metas.iter() {
let name = meta.name();

// FIXME: How do I silence the warnings? --pcw (#2619)
if !set.insert(name) {
diagnostic.span_fatal(meta.span,
fmt!("duplicate meta item `%s`", name));
Expand Down