Skip to content

Commit

Permalink
Implemented less strict version requirements for pre-1.0.0 versions.
Browse files Browse the repository at this point in the history
Closes rust-lang#46.
  • Loading branch information
ibabushkin committed Feb 7, 2018
1 parent 9191fb2 commit 35c85d4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/semcheck/changes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -674,10 +674,14 @@ impl<'tcx> ChangeSet<'tcx> {
/// Format the contents of a change set for user output.
pub fn output(&self, session: &Session, version: &str, verbose: bool) {
if let Ok(mut new_version) = Version::parse(version) {
match self.max {
Patch => new_version.increment_patch(),
NonBreaking | TechnicallyBreaking => new_version.increment_minor(),
Breaking => new_version.increment_major(),
if new_version.major == 0 {
new_version.increment_patch();
} else {
match self.max {
Patch => new_version.increment_patch(),
NonBreaking | TechnicallyBreaking => new_version.increment_minor(),
Breaking => new_version.increment_major(),
}
}

println!("version bump: {} -> ({}) -> {}", version, self.max, new_version);
Expand Down

0 comments on commit 35c85d4

Please sign in to comment.