From 64d98f8ee037282c35007b64c2649055c56af1db Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:03 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- .../type-alias-impl-trait/coherence_cross_crate.rs | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/ui/type-alias-impl-trait/coherence_cross_crate.rs (limited to 'tests/ui/type-alias-impl-trait/coherence_cross_crate.rs') diff --git a/tests/ui/type-alias-impl-trait/coherence_cross_crate.rs b/tests/ui/type-alias-impl-trait/coherence_cross_crate.rs new file mode 100644 index 000000000..a63e0a1ee --- /dev/null +++ b/tests/ui/type-alias-impl-trait/coherence_cross_crate.rs @@ -0,0 +1,24 @@ +// aux-build: coherence_cross_crate_trait_decl.rs +// This test ensures that adding an `impl SomeTrait for i32` within +// `coherence_cross_crate_trait_decl` is not a breaking change, by +// making sure that even without such an impl this test fails to compile. + +#![feature(type_alias_impl_trait)] + +extern crate coherence_cross_crate_trait_decl; + +use coherence_cross_crate_trait_decl::SomeTrait; + +trait OtherTrait {} + +type Alias = impl SomeTrait; + +fn constrain() -> Alias { + () +} + +impl OtherTrait for Alias {} +impl OtherTrait for i32 {} +//~^ ERROR: conflicting implementations of trait `OtherTrait` for type `Alias` + +fn main() {} -- cgit v1.2.3