@@ -1490,29 +1490,38 @@ fn ignore_llvm(config: &Config, line: &str) -> IgnoreDecision {
1490
1490
}
1491
1491
}
1492
1492
if let Some ( actual_version) = config. llvm_version {
1493
- if let Some ( rest ) = line . strip_prefix ( "min-llvm-version:" ) . map ( str :: trim ) {
1494
- let min_version = extract_llvm_version ( rest ) . unwrap ( ) ;
1495
- // Ignore if actual version is smaller the minimum required
1496
- // version
1493
+ if let Some ( value ) = config . parse_name_value_directive ( line , "min-llvm-version" ) {
1494
+ let value = value . trim ( ) ;
1495
+ let min_version = extract_llvm_version ( value ) . unwrap ( ) ;
1496
+ // Ignore if actual version is smaller than the minimum required version.
1497
1497
if actual_version < min_version {
1498
1498
return IgnoreDecision :: Ignore {
1499
- reason : format ! ( "ignored when the LLVM version is older than {rest}" ) ,
1499
+ reason : format ! (
1500
+ "ignored when the LLVM version ({actual_version}) is older than {min_version}"
1501
+ ) ,
1500
1502
} ;
1501
1503
}
1502
- } else if let Some ( rest) = line. strip_prefix ( "min-system-llvm-version:" ) . map ( str:: trim) {
1503
- let min_version = extract_llvm_version ( rest) . unwrap ( ) ;
1504
- // Ignore if using system LLVM and actual version
1505
- // is smaller the minimum required version
1504
+ } else if let Some ( value) =
1505
+ config. parse_name_value_directive ( line, "min-system-llvm-version" )
1506
+ {
1507
+ let value = value. trim ( ) ;
1508
+ let min_version = extract_llvm_version ( value) . unwrap ( ) ;
1509
+ // Ignore if using system LLVM and actual version is smaller the minimum required
1510
+ // version.
1506
1511
if config. system_llvm && actual_version < min_version {
1507
1512
return IgnoreDecision :: Ignore {
1508
- reason : format ! ( "ignored when the system LLVM version is older than {rest}" ) ,
1513
+ reason : format ! (
1514
+ "ignored when the system LLVM version ({actual_version})\
1515
+ is older than {min_version}"
1516
+ ) ,
1509
1517
} ;
1510
1518
}
1511
- } else if let Some ( rest) = line. strip_prefix ( "ignore-llvm-version:" ) . map ( str:: trim) {
1512
- // Syntax is: "ignore-llvm-version: <version1> [- <version2>]"
1519
+ } else if let Some ( value) = config. parse_name_value_directive ( line, "ignore-llvm-version" ) {
1520
+ let value = value. trim ( ) ;
1521
+ // Syntax is: "ignore-llvm-version: <version1> [- <version2>]".
1513
1522
let ( v_min, v_max) =
1514
- extract_version_range ( rest , extract_llvm_version) . unwrap_or_else ( || {
1515
- panic ! ( "couldn't parse version range: {:?}" , rest ) ;
1523
+ extract_version_range ( value , extract_llvm_version) . unwrap_or_else ( || {
1524
+ panic ! ( "couldn't parse version range: {:?}" , value ) ;
1516
1525
} ) ;
1517
1526
if v_max < v_min {
1518
1527
panic ! ( "Malformed LLVM version range: max < min" )
@@ -1521,11 +1530,13 @@ fn ignore_llvm(config: &Config, line: &str) -> IgnoreDecision {
1521
1530
if actual_version >= v_min && actual_version <= v_max {
1522
1531
if v_min == v_max {
1523
1532
return IgnoreDecision :: Ignore {
1524
- reason : format ! ( "ignored when the LLVM version is {rest }" ) ,
1533
+ reason : format ! ( "ignored when the LLVM version is {actual_version }" ) ,
1525
1534
} ;
1526
1535
} else {
1527
1536
return IgnoreDecision :: Ignore {
1528
- reason : format ! ( "ignored when the LLVM version is between {rest}" ) ,
1537
+ reason : format ! (
1538
+ "ignored when the LLVM version ({actual_version}) is between {v_min}-{v_max}"
1539
+ ) ,
1529
1540
} ;
1530
1541
}
1531
1542
}
0 commit comments