Added tests checking that changes in type sig are recognized in SVH.
(Only after adding the tests did I realize that this is not really a special case at the AST level; as far as the visitor is concerned, `int` and `i32` and `i64` are just idents.)
This commit is contained in:
parent
930308b16e
commit
5236af8c0f
|
@ -0,0 +1,37 @@
|
|||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
//! The `svh-a-*.rs` files are all deviations from the base file
|
||||
//! svh-a-base.rs with some difference (usually in `fn foo`) that
|
||||
//! should not affect the strict version hash (SVH) computation
|
||||
//! (#14132).
|
||||
|
||||
#![feature(macro_rules)]
|
||||
|
||||
#![crate_id = "a"]
|
||||
|
||||
macro_rules! three {
|
||||
() => { 3 }
|
||||
}
|
||||
|
||||
pub trait U {}
|
||||
pub trait V {}
|
||||
impl U for () {}
|
||||
impl V for () {}
|
||||
|
||||
static A_CONSTANT : int = 2;
|
||||
|
||||
pub fn foo<T:U>(_: i32) -> int {
|
||||
3
|
||||
}
|
||||
|
||||
pub fn an_unused_name() -> int {
|
||||
4
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
//! The `svh-a-*.rs` files are all deviations from the base file
|
||||
//! svh-a-base.rs with some difference (usually in `fn foo`) that
|
||||
//! should not affect the strict version hash (SVH) computation
|
||||
//! (#14132).
|
||||
|
||||
#![feature(macro_rules)]
|
||||
|
||||
#![crate_id = "a"]
|
||||
|
||||
macro_rules! three {
|
||||
() => { 3 }
|
||||
}
|
||||
|
||||
pub trait U {}
|
||||
pub trait V {}
|
||||
impl U for () {}
|
||||
impl V for () {}
|
||||
|
||||
static A_CONSTANT : int = 2;
|
||||
|
||||
pub fn foo<T:U>(_: int) -> i64 {
|
||||
3
|
||||
}
|
||||
|
||||
pub fn an_unused_name() -> i32 {
|
||||
4
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
//! The `svh-a-*.rs` files are all deviations from the base file
|
||||
//! svh-a-base.rs with some difference (usually in `fn foo`) that
|
||||
//! should not affect the strict version hash (SVH) computation
|
||||
//! (#14132).
|
||||
|
||||
#![feature(macro_rules)]
|
||||
|
||||
#![crate_id = "a"]
|
||||
|
||||
macro_rules! three {
|
||||
() => { 3 }
|
||||
}
|
||||
|
||||
pub trait U {}
|
||||
pub trait V {}
|
||||
impl U for () {}
|
||||
impl V for () {}
|
||||
|
||||
static A_CONSTANT : i32 = 2;
|
||||
|
||||
pub fn foo<T:U>(_: int) -> int {
|
||||
3
|
||||
}
|
||||
|
||||
pub fn an_unused_name() -> int {
|
||||
4
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// note that these aux-build directives must be in this order
|
||||
// aux-build:svh-a-base.rs
|
||||
// aux-build:svh-b.rs
|
||||
// aux-build:svh-a-change-type-arg.rs
|
||||
|
||||
#![feature(macro_rules)]
|
||||
|
||||
extern crate a;
|
||||
extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on
|
||||
//~^ NOTE: perhaps this crate needs to be recompiled
|
||||
|
||||
fn main() {
|
||||
b::foo()
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// note that these aux-build directives must be in this order
|
||||
// aux-build:svh-a-base.rs
|
||||
// aux-build:svh-b.rs
|
||||
// aux-build:svh-a-change-type-ret.rs
|
||||
|
||||
#![feature(macro_rules)]
|
||||
|
||||
extern crate a;
|
||||
extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on
|
||||
//~^ NOTE: perhaps this crate needs to be recompiled
|
||||
|
||||
fn main() {
|
||||
b::foo()
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// note that these aux-build directives must be in this order
|
||||
// aux-build:svh-a-base.rs
|
||||
// aux-build:svh-b.rs
|
||||
// aux-build:svh-a-change-type-static.rs
|
||||
|
||||
#![feature(macro_rules)]
|
||||
|
||||
extern crate a;
|
||||
extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on
|
||||
//~^ NOTE: perhaps this crate needs to be recompiled
|
||||
|
||||
fn main() {
|
||||
b::foo()
|
||||
}
|
Loading…
Reference in New Issue