summaryrefslogtreecommitdiffstats
path: root/src/test/ui/svh
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/svh')
-rw-r--r--src/test/ui/svh/auxiliary/changing-crates-a1.rs3
-rw-r--r--src/test/ui/svh/auxiliary/changing-crates-a2.rs3
-rw-r--r--src/test/ui/svh/auxiliary/changing-crates-b.rs5
-rw-r--r--src/test/ui/svh/auxiliary/svh-a-base.rs25
-rw-r--r--src/test/ui/svh/auxiliary/svh-a-change-lit.rs25
-rw-r--r--src/test/ui/svh/auxiliary/svh-a-change-significant-cfg.rs27
-rw-r--r--src/test/ui/svh/auxiliary/svh-a-change-trait-bound.rs25
-rw-r--r--src/test/ui/svh/auxiliary/svh-a-change-type-arg.rs25
-rw-r--r--src/test/ui/svh/auxiliary/svh-a-change-type-ret.rs25
-rw-r--r--src/test/ui/svh/auxiliary/svh-a-change-type-static.rs25
-rw-r--r--src/test/ui/svh/auxiliary/svh-b.rs13
-rw-r--r--src/test/ui/svh/auxiliary/svh-uta-base.rs22
-rw-r--r--src/test/ui/svh/auxiliary/svh-uta-change-use-trait.rs22
-rw-r--r--src/test/ui/svh/auxiliary/svh-utb.rs12
-rw-r--r--src/test/ui/svh/changing-crates.rs10
-rw-r--r--src/test/ui/svh/changing-crates.stderr13
-rw-r--r--src/test/ui/svh/svh-change-lit.rs12
-rw-r--r--src/test/ui/svh/svh-change-lit.stderr13
-rw-r--r--src/test/ui/svh/svh-change-significant-cfg.rs12
-rw-r--r--src/test/ui/svh/svh-change-significant-cfg.stderr13
-rw-r--r--src/test/ui/svh/svh-change-trait-bound.rs12
-rw-r--r--src/test/ui/svh/svh-change-trait-bound.stderr13
-rw-r--r--src/test/ui/svh/svh-change-type-arg.rs12
-rw-r--r--src/test/ui/svh/svh-change-type-arg.stderr13
-rw-r--r--src/test/ui/svh/svh-change-type-ret.rs12
-rw-r--r--src/test/ui/svh/svh-change-type-ret.stderr13
-rw-r--r--src/test/ui/svh/svh-change-type-static.rs12
-rw-r--r--src/test/ui/svh/svh-change-type-static.stderr13
-rw-r--r--src/test/ui/svh/svh-use-trait.rs17
-rw-r--r--src/test/ui/svh/svh-use-trait.stderr13
30 files changed, 460 insertions, 0 deletions
diff --git a/src/test/ui/svh/auxiliary/changing-crates-a1.rs b/src/test/ui/svh/auxiliary/changing-crates-a1.rs
new file mode 100644
index 000000000..bc0559b8b
--- /dev/null
+++ b/src/test/ui/svh/auxiliary/changing-crates-a1.rs
@@ -0,0 +1,3 @@
+#![crate_name = "a"]
+
+pub fn foo<T>() {}
diff --git a/src/test/ui/svh/auxiliary/changing-crates-a2.rs b/src/test/ui/svh/auxiliary/changing-crates-a2.rs
new file mode 100644
index 000000000..fafc6d5b1
--- /dev/null
+++ b/src/test/ui/svh/auxiliary/changing-crates-a2.rs
@@ -0,0 +1,3 @@
+#![crate_name = "a"]
+
+pub fn foo<T>() { println!("hello!"); }
diff --git a/src/test/ui/svh/auxiliary/changing-crates-b.rs b/src/test/ui/svh/auxiliary/changing-crates-b.rs
new file mode 100644
index 000000000..f9ce29e4c
--- /dev/null
+++ b/src/test/ui/svh/auxiliary/changing-crates-b.rs
@@ -0,0 +1,5 @@
+#![crate_name = "b"]
+
+extern crate a;
+
+pub fn foo() { a::foo::<isize>(); }
diff --git a/src/test/ui/svh/auxiliary/svh-a-base.rs b/src/test/ui/svh/auxiliary/svh-a-base.rs
new file mode 100644
index 000000000..36b41fc81
--- /dev/null
+++ b/src/test/ui/svh/auxiliary/svh-a-base.rs
@@ -0,0 +1,25 @@
+//! 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).
+
+#![crate_name = "a"]
+
+macro_rules! three {
+ () => { 3 }
+}
+
+pub trait U {}
+pub trait V {}
+impl U for () {}
+impl V for () {}
+
+static A_CONSTANT : isize = 2;
+
+pub fn foo<T:U>(_: isize) -> isize {
+ 3
+}
+
+pub fn an_unused_name() -> isize {
+ 4
+}
diff --git a/src/test/ui/svh/auxiliary/svh-a-change-lit.rs b/src/test/ui/svh/auxiliary/svh-a-change-lit.rs
new file mode 100644
index 000000000..c76f2c992
--- /dev/null
+++ b/src/test/ui/svh/auxiliary/svh-a-change-lit.rs
@@ -0,0 +1,25 @@
+//! 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).
+
+#![crate_name = "a"]
+
+macro_rules! three {
+ () => { 3 }
+}
+
+pub trait U {}
+pub trait V {}
+impl U for () {}
+impl V for () {}
+
+static A_CONSTANT : isize = 2;
+
+pub fn foo<T:U>(_: isize) -> isize {
+ 0
+}
+
+pub fn an_unused_name() -> isize {
+ 4
+}
diff --git a/src/test/ui/svh/auxiliary/svh-a-change-significant-cfg.rs b/src/test/ui/svh/auxiliary/svh-a-change-significant-cfg.rs
new file mode 100644
index 000000000..37f59c97e
--- /dev/null
+++ b/src/test/ui/svh/auxiliary/svh-a-change-significant-cfg.rs
@@ -0,0 +1,27 @@
+//! 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).
+
+#![crate_name = "a"]
+
+macro_rules! three {
+ () => { 3 }
+}
+
+pub trait U {}
+pub trait V {}
+impl U for () {}
+impl V for () {}
+
+static A_CONSTANT : isize = 2;
+
+#[cfg(some_flag)]
+pub fn foo<T:U>(_: isize) -> isize {
+ 3
+}
+
+#[cfg(not(some_flag))]
+pub fn an_unused_name() -> isize {
+ 4
+}
diff --git a/src/test/ui/svh/auxiliary/svh-a-change-trait-bound.rs b/src/test/ui/svh/auxiliary/svh-a-change-trait-bound.rs
new file mode 100644
index 000000000..be24b1e22
--- /dev/null
+++ b/src/test/ui/svh/auxiliary/svh-a-change-trait-bound.rs
@@ -0,0 +1,25 @@
+//! 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).
+
+#![crate_name = "a"]
+
+macro_rules! three {
+ () => { 3 }
+}
+
+pub trait U {}
+pub trait V {}
+impl U for () {}
+impl V for () {}
+
+static A_CONSTANT : isize = 2;
+
+pub fn foo<T:V>(_: isize) -> isize {
+ 3
+}
+
+pub fn an_unused_name() -> isize {
+ 4
+}
diff --git a/src/test/ui/svh/auxiliary/svh-a-change-type-arg.rs b/src/test/ui/svh/auxiliary/svh-a-change-type-arg.rs
new file mode 100644
index 000000000..3fe102245
--- /dev/null
+++ b/src/test/ui/svh/auxiliary/svh-a-change-type-arg.rs
@@ -0,0 +1,25 @@
+//! 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).
+
+#![crate_name = "a"]
+
+macro_rules! three {
+ () => { 3 }
+}
+
+pub trait U {}
+pub trait V {}
+impl U for () {}
+impl V for () {}
+
+static A_CONSTANT : isize = 2;
+
+pub fn foo<T:U>(_: i32) -> isize {
+ 3
+}
+
+pub fn an_unused_name() -> isize {
+ 4
+}
diff --git a/src/test/ui/svh/auxiliary/svh-a-change-type-ret.rs b/src/test/ui/svh/auxiliary/svh-a-change-type-ret.rs
new file mode 100644
index 000000000..06e4fad06
--- /dev/null
+++ b/src/test/ui/svh/auxiliary/svh-a-change-type-ret.rs
@@ -0,0 +1,25 @@
+//! 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).
+
+#![crate_name = "a"]
+
+macro_rules! three {
+ () => { 3 }
+}
+
+pub trait U {}
+pub trait V {}
+impl U for () {}
+impl V for () {}
+
+static A_CONSTANT : isize = 2;
+
+pub fn foo<T:U>(_: isize) -> i64 {
+ 3
+}
+
+pub fn an_unused_name() -> i32 {
+ 4
+}
diff --git a/src/test/ui/svh/auxiliary/svh-a-change-type-static.rs b/src/test/ui/svh/auxiliary/svh-a-change-type-static.rs
new file mode 100644
index 000000000..440cb3213
--- /dev/null
+++ b/src/test/ui/svh/auxiliary/svh-a-change-type-static.rs
@@ -0,0 +1,25 @@
+//! 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).
+
+#![crate_name = "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>(_: isize) -> isize {
+ 3
+}
+
+pub fn an_unused_name() -> isize {
+ 4
+}
diff --git a/src/test/ui/svh/auxiliary/svh-b.rs b/src/test/ui/svh/auxiliary/svh-b.rs
new file mode 100644
index 000000000..57029f708
--- /dev/null
+++ b/src/test/ui/svh/auxiliary/svh-b.rs
@@ -0,0 +1,13 @@
+//! This is a client of the `a` crate defined in `svn-a-base.rs`. The
+//! rpass and cfail tests (such as `run-pass/svh-add-comment.rs`) use
+//! it by swapping in a different object code library crate built from
+//! some variant of `svn-a-base.rs`, and then we are checking if the
+//! compiler properly ignores or accepts the change, based on whether
+//! the change could affect the downstream crate content or not
+//! (#14132).
+
+#![crate_name = "b"]
+
+extern crate a;
+
+pub fn foo() { assert_eq!(a::foo::<()>(0), 3); }
diff --git a/src/test/ui/svh/auxiliary/svh-uta-base.rs b/src/test/ui/svh/auxiliary/svh-uta-base.rs
new file mode 100644
index 000000000..221a096e0
--- /dev/null
+++ b/src/test/ui/svh/auxiliary/svh-uta-base.rs
@@ -0,0 +1,22 @@
+//! "svh-uta-trait.rs" is checking that we detect a
+//! change from `use foo::TraitB` to use `foo::TraitB` in the hash
+//! (SVH) computation (#14132), since that will affect method
+//! resolution.
+//!
+//! This is the upstream crate.
+
+#![crate_name = "uta"]
+
+mod traits {
+ pub trait TraitA { fn val(&self) -> isize { 2 } }
+ pub trait TraitB { fn val(&self) -> isize { 3 } }
+}
+
+impl traits::TraitA for () {}
+impl traits::TraitB for () {}
+
+pub fn foo<T>(_: isize) -> isize {
+ use traits::TraitA;
+ let v = ();
+ v.val()
+}
diff --git a/src/test/ui/svh/auxiliary/svh-uta-change-use-trait.rs b/src/test/ui/svh/auxiliary/svh-uta-change-use-trait.rs
new file mode 100644
index 000000000..823d29571
--- /dev/null
+++ b/src/test/ui/svh/auxiliary/svh-uta-change-use-trait.rs
@@ -0,0 +1,22 @@
+//! "svh-uta-trait.rs" is checking that we detect a
+//! change from `use foo::TraitB` to use `foo::TraitB` in the hash
+//! (SVH) computation (#14132), since that will affect method
+//! resolution.
+//!
+//! This is the upstream crate.
+
+#![crate_name = "uta"]
+
+mod traits {
+ pub trait TraitA { fn val(&self) -> isize { 2 } }
+ pub trait TraitB { fn val(&self) -> isize { 3 } }
+}
+
+impl traits::TraitA for () {}
+impl traits::TraitB for () {}
+
+pub fn foo<T>(_: isize) -> isize {
+ use traits::TraitB;
+ let v = ();
+ v.val()
+}
diff --git a/src/test/ui/svh/auxiliary/svh-utb.rs b/src/test/ui/svh/auxiliary/svh-utb.rs
new file mode 100644
index 000000000..a03e29dce
--- /dev/null
+++ b/src/test/ui/svh/auxiliary/svh-utb.rs
@@ -0,0 +1,12 @@
+//! "svh-uta-trait.rs" is checking that we detect a
+//! change from `use foo::TraitB` to use `foo::TraitB` in the hash
+//! (SVH) computation (#14132), since that will affect method
+//! resolution.
+//!
+//! This is the downstream crate.
+
+#![crate_name = "utb"]
+
+extern crate uta;
+
+pub fn foo() { assert_eq!(uta::foo::<()>(0), 3); }
diff --git a/src/test/ui/svh/changing-crates.rs b/src/test/ui/svh/changing-crates.rs
new file mode 100644
index 000000000..66298e06e
--- /dev/null
+++ b/src/test/ui/svh/changing-crates.rs
@@ -0,0 +1,10 @@
+// note that these aux-build directives must be in this order
+// aux-build:changing-crates-a1.rs
+// aux-build:changing-crates-b.rs
+// aux-build:changing-crates-a2.rs
+// normalize-stderr-test: "(crate `(\w+)`:) .*" -> "$1 $$PATH_$2"
+
+extern crate a;
+extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on
+
+fn main() {}
diff --git a/src/test/ui/svh/changing-crates.stderr b/src/test/ui/svh/changing-crates.stderr
new file mode 100644
index 000000000..7244919e8
--- /dev/null
+++ b/src/test/ui/svh/changing-crates.stderr
@@ -0,0 +1,13 @@
+error[E0460]: found possibly newer version of crate `a` which `b` depends on
+ --> $DIR/changing-crates.rs:8:1
+ |
+LL | extern crate b;
+ | ^^^^^^^^^^^^^^^
+ |
+ = note: perhaps that crate needs to be recompiled?
+ = note: the following crate versions were found:
+ crate `a`: $PATH_a
+ crate `b`: $PATH_b
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/svh/svh-change-lit.rs b/src/test/ui/svh/svh-change-lit.rs
new file mode 100644
index 000000000..ea500711b
--- /dev/null
+++ b/src/test/ui/svh/svh-change-lit.rs
@@ -0,0 +1,12 @@
+// 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-lit.rs
+// normalize-stderr-test: "(crate `(\w+)`:) .*" -> "$1 $$PATH_$2"
+
+extern crate a;
+extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on
+
+fn main() {
+ b::foo()
+}
diff --git a/src/test/ui/svh/svh-change-lit.stderr b/src/test/ui/svh/svh-change-lit.stderr
new file mode 100644
index 000000000..1e97e9d05
--- /dev/null
+++ b/src/test/ui/svh/svh-change-lit.stderr
@@ -0,0 +1,13 @@
+error[E0460]: found possibly newer version of crate `a` which `b` depends on
+ --> $DIR/svh-change-lit.rs:8:1
+ |
+LL | extern crate b;
+ | ^^^^^^^^^^^^^^^
+ |
+ = note: perhaps that crate needs to be recompiled?
+ = note: the following crate versions were found:
+ crate `a`: $PATH_a
+ crate `b`: $PATH_b
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/svh/svh-change-significant-cfg.rs b/src/test/ui/svh/svh-change-significant-cfg.rs
new file mode 100644
index 000000000..ff919ea83
--- /dev/null
+++ b/src/test/ui/svh/svh-change-significant-cfg.rs
@@ -0,0 +1,12 @@
+// 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-significant-cfg.rs
+// normalize-stderr-test: "(crate `(\w+)`:) .*" -> "$1 $$PATH_$2"
+
+extern crate a;
+extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on
+
+fn main() {
+ b::foo()
+}
diff --git a/src/test/ui/svh/svh-change-significant-cfg.stderr b/src/test/ui/svh/svh-change-significant-cfg.stderr
new file mode 100644
index 000000000..f04046f4c
--- /dev/null
+++ b/src/test/ui/svh/svh-change-significant-cfg.stderr
@@ -0,0 +1,13 @@
+error[E0460]: found possibly newer version of crate `a` which `b` depends on
+ --> $DIR/svh-change-significant-cfg.rs:8:1
+ |
+LL | extern crate b;
+ | ^^^^^^^^^^^^^^^
+ |
+ = note: perhaps that crate needs to be recompiled?
+ = note: the following crate versions were found:
+ crate `a`: $PATH_a
+ crate `b`: $PATH_b
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/svh/svh-change-trait-bound.rs b/src/test/ui/svh/svh-change-trait-bound.rs
new file mode 100644
index 000000000..a4ba06eaf
--- /dev/null
+++ b/src/test/ui/svh/svh-change-trait-bound.rs
@@ -0,0 +1,12 @@
+// 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-trait-bound.rs
+// normalize-stderr-test: "(crate `(\w+)`:) .*" -> "$1 $$PATH_$2"
+
+extern crate a;
+extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on
+
+fn main() {
+ b::foo()
+}
diff --git a/src/test/ui/svh/svh-change-trait-bound.stderr b/src/test/ui/svh/svh-change-trait-bound.stderr
new file mode 100644
index 000000000..a778c6180
--- /dev/null
+++ b/src/test/ui/svh/svh-change-trait-bound.stderr
@@ -0,0 +1,13 @@
+error[E0460]: found possibly newer version of crate `a` which `b` depends on
+ --> $DIR/svh-change-trait-bound.rs:8:1
+ |
+LL | extern crate b;
+ | ^^^^^^^^^^^^^^^
+ |
+ = note: perhaps that crate needs to be recompiled?
+ = note: the following crate versions were found:
+ crate `a`: $PATH_a
+ crate `b`: $PATH_b
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/svh/svh-change-type-arg.rs b/src/test/ui/svh/svh-change-type-arg.rs
new file mode 100644
index 000000000..d1651814b
--- /dev/null
+++ b/src/test/ui/svh/svh-change-type-arg.rs
@@ -0,0 +1,12 @@
+// 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
+// normalize-stderr-test: "(crate `(\w+)`:) .*" -> "$1 $$PATH_$2"
+
+extern crate a;
+extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on
+
+fn main() {
+ b::foo()
+}
diff --git a/src/test/ui/svh/svh-change-type-arg.stderr b/src/test/ui/svh/svh-change-type-arg.stderr
new file mode 100644
index 000000000..f09babf93
--- /dev/null
+++ b/src/test/ui/svh/svh-change-type-arg.stderr
@@ -0,0 +1,13 @@
+error[E0460]: found possibly newer version of crate `a` which `b` depends on
+ --> $DIR/svh-change-type-arg.rs:8:1
+ |
+LL | extern crate b;
+ | ^^^^^^^^^^^^^^^
+ |
+ = note: perhaps that crate needs to be recompiled?
+ = note: the following crate versions were found:
+ crate `a`: $PATH_a
+ crate `b`: $PATH_b
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/svh/svh-change-type-ret.rs b/src/test/ui/svh/svh-change-type-ret.rs
new file mode 100644
index 000000000..a4be50a64
--- /dev/null
+++ b/src/test/ui/svh/svh-change-type-ret.rs
@@ -0,0 +1,12 @@
+// 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
+// normalize-stderr-test: "(crate `(\w+)`:) .*" -> "$1 $$PATH_$2"
+
+extern crate a;
+extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on
+
+fn main() {
+ b::foo()
+}
diff --git a/src/test/ui/svh/svh-change-type-ret.stderr b/src/test/ui/svh/svh-change-type-ret.stderr
new file mode 100644
index 000000000..0998cd4b5
--- /dev/null
+++ b/src/test/ui/svh/svh-change-type-ret.stderr
@@ -0,0 +1,13 @@
+error[E0460]: found possibly newer version of crate `a` which `b` depends on
+ --> $DIR/svh-change-type-ret.rs:8:1
+ |
+LL | extern crate b;
+ | ^^^^^^^^^^^^^^^
+ |
+ = note: perhaps that crate needs to be recompiled?
+ = note: the following crate versions were found:
+ crate `a`: $PATH_a
+ crate `b`: $PATH_b
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/svh/svh-change-type-static.rs b/src/test/ui/svh/svh-change-type-static.rs
new file mode 100644
index 000000000..c470761be
--- /dev/null
+++ b/src/test/ui/svh/svh-change-type-static.rs
@@ -0,0 +1,12 @@
+// 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
+// normalize-stderr-test: "(crate `(\w+)`:) .*" -> "$1 $$PATH_$2"
+
+extern crate a;
+extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on
+
+fn main() {
+ b::foo()
+}
diff --git a/src/test/ui/svh/svh-change-type-static.stderr b/src/test/ui/svh/svh-change-type-static.stderr
new file mode 100644
index 000000000..9c48cbd30
--- /dev/null
+++ b/src/test/ui/svh/svh-change-type-static.stderr
@@ -0,0 +1,13 @@
+error[E0460]: found possibly newer version of crate `a` which `b` depends on
+ --> $DIR/svh-change-type-static.rs:8:1
+ |
+LL | extern crate b;
+ | ^^^^^^^^^^^^^^^
+ |
+ = note: perhaps that crate needs to be recompiled?
+ = note: the following crate versions were found:
+ crate `a`: $PATH_a
+ crate `b`: $PATH_b
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/svh/svh-use-trait.rs b/src/test/ui/svh/svh-use-trait.rs
new file mode 100644
index 000000000..e144fdffb
--- /dev/null
+++ b/src/test/ui/svh/svh-use-trait.rs
@@ -0,0 +1,17 @@
+// note that these aux-build directives must be in this order
+// aux-build:svh-uta-base.rs
+// aux-build:svh-utb.rs
+// aux-build:svh-uta-change-use-trait.rs
+// normalize-stderr-test: "(crate `(\w+)`:) .*" -> "$1 $$PATH_$2"
+
+//! "svh-uta-trait.rs" is checking that we detect a
+//! change from `use foo::TraitB` to use `foo::TraitB` in the hash
+//! (SVH) computation (#14132), since that will affect method
+//! resolution.
+
+extern crate uta;
+extern crate utb; //~ ERROR: found possibly newer version of crate `uta` which `utb` depends
+
+fn main() {
+ utb::foo()
+}
diff --git a/src/test/ui/svh/svh-use-trait.stderr b/src/test/ui/svh/svh-use-trait.stderr
new file mode 100644
index 000000000..5780cfef3
--- /dev/null
+++ b/src/test/ui/svh/svh-use-trait.stderr
@@ -0,0 +1,13 @@
+error[E0460]: found possibly newer version of crate `uta` which `utb` depends on
+ --> $DIR/svh-use-trait.rs:13:1
+ |
+LL | extern crate utb;
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = note: perhaps that crate needs to be recompiled?
+ = note: the following crate versions were found:
+ crate `uta`: $PATH_uta
+ crate `utb`: $PATH_utb
+
+error: aborting due to previous error
+