@@ -426,14 +426,14 @@ pub fn building_library(options: &options, crate: &ast::Crate) -> bool {
426426 }
427427}
428428
429- pub fn collect_outputs ( options : & options ,
429+ pub fn collect_outputs ( session : & Session ,
430430 attrs : & [ ast:: Attribute ] ) -> ~[ OutputStyle ] {
431431 // If we're generating a test executable, then ignore all other output
432432 // styles at all other locations
433- if options . test {
433+ if session . opts . test {
434434 return ~[ OutputExecutable ] ;
435435 }
436- let mut base = options . outputs . clone ( ) ;
436+ let mut base = session . opts . outputs . clone ( ) ;
437437 let mut iter = attrs. iter ( ) . filter_map ( |a| {
438438 if "crate_type" == a. name ( ) {
439439 match a. value_str ( ) {
@@ -442,7 +442,16 @@ pub fn collect_outputs(options: &options,
442442 Some ( n) if "lib" == n => Some ( OutputDylib ) ,
443443 Some ( n) if "staticlib" == n => Some ( OutputStaticlib ) ,
444444 Some ( n) if "bin" == n => Some ( OutputExecutable ) ,
445- _ => None
445+ Some ( _) => {
446+ session. add_lint ( lint:: unknown_crate_type, ast:: CRATE_NODE_ID ,
447+ a. span , ~"invalid `crate_type` value") ;
448+ None
449+ }
450+ _ => {
451+ session. add_lint ( lint:: unknown_crate_type, ast:: CRATE_NODE_ID ,
452+ a. span , ~"`crate_type` requires a value") ;
453+ None
454+ }
446455 }
447456 } else {
448457 None
0 commit comments