@@ -178,7 +178,7 @@ fn clean_lib(
178178 ( None , Some ( path) ) => path,
179179 ( None , None ) => {
180180 let legacy_path = package_root. join ( "src" ) . join ( format ! ( "{}.rs" , lib. name( ) ) ) ;
181- if edition < Edition :: Edition2018 && legacy_path. exists ( ) {
181+ if edition == Edition :: Edition2015 && legacy_path. exists ( ) {
182182 warnings. push ( format ! (
183183 "path `{}` was erroneously implicitly accepted for library `{}`,\n \
184184 please rename the file to `src/lib.rs` or set lib.path in Cargo.toml",
@@ -661,9 +661,8 @@ fn toml_targets_and_inferred(
661661
662662 let autodiscover = match autodiscover {
663663 Some ( autodiscover) => autodiscover,
664- None => match edition {
665- Edition :: Edition2018 => true ,
666- Edition :: Edition2015 => {
664+ None =>
665+ if edition == Edition :: Edition2015 {
667666 if !rem_targets. is_empty ( ) {
668667 let mut rem_targets_str = String :: new ( ) ;
669668 for t in rem_targets. iter ( ) {
@@ -694,8 +693,9 @@ https://github.com/rust-lang/cargo/issues/5330",
694693 ) ) ;
695694 } ;
696695 false
696+ } else {
697+ true
697698 }
698- } ,
699699 } ;
700700
701701 if autodiscover {
@@ -805,7 +805,7 @@ fn target_path(
805805 match ( first, second) {
806806 ( Some ( path) , None ) => Ok ( path) ,
807807 ( None , None ) | ( Some ( _) , Some ( _) ) => {
808- if edition < Edition :: Edition2018 {
808+ if edition == Edition :: Edition2015 {
809809 if let Some ( path) = legacy_path ( target) {
810810 return Ok ( path) ;
811811 }
0 commit comments