Skip to content

Commit 462604a

Browse files
committed
librustc: Check for empty crate link meta name and vers.
1 parent 0691c01 commit 462604a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/librustc/back/link.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -607,8 +607,8 @@ pub fn build_link_meta(sess: Session,
607607
fn crate_meta_name(sess: Session, output: &Path, opt_name: Option<@str>)
608608
-> @str {
609609
match opt_name {
610-
Some(v) => v,
611-
None => {
610+
Some(v) if !v.is_empty() => v,
611+
_ => {
612612
// to_managed could go away if there was a version of
613613
// filestem that returned an @str
614614
let name = session::expect(sess,
@@ -624,8 +624,8 @@ pub fn build_link_meta(sess: Session,
624624

625625
fn crate_meta_vers(sess: Session, opt_vers: Option<@str>) -> @str {
626626
match opt_vers {
627-
Some(v) => v,
628-
None => {
627+
Some(v) if !v.is_empty() => v,
628+
_ => {
629629
let vers = @"0.0";
630630
warn_missing(sess, "vers", vers);
631631
vers

0 commit comments

Comments
 (0)