From 9072c8d274307c08ad0a7afb16681d43181c4033 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Sat, 29 Jan 2022 15:34:06 -0800 Subject: skip pointing out ambuguous impls in alloc/std crates too --- src/test/ui/impl-trait/equality.rs | 2 +- src/test/ui/impl-trait/equality.stderr | 19 ++----------------- 2 files changed, 3 insertions(+), 18 deletions(-) (limited to 'src/test/ui/impl-trait') diff --git a/src/test/ui/impl-trait/equality.rs b/src/test/ui/impl-trait/equality.rs index 9610618ca11..828b5aac896 100644 --- a/src/test/ui/impl-trait/equality.rs +++ b/src/test/ui/impl-trait/equality.rs @@ -17,7 +17,7 @@ fn two(x: bool) -> impl Foo { //~| expected `i32`, found `u32` } -fn sum_to(n: u32) -> impl Foo { //~ ERROR type annotations needed +fn sum_to(n: u32) -> impl Foo { if n == 0 { 0 } else { diff --git a/src/test/ui/impl-trait/equality.stderr b/src/test/ui/impl-trait/equality.stderr index d9819484a96..536a4726c6d 100644 --- a/src/test/ui/impl-trait/equality.stderr +++ b/src/test/ui/impl-trait/equality.stderr @@ -34,22 +34,7 @@ LL | n + sum_to(n - 1) | = help: the trait `Add` is not implemented for `u32` -error[E0283]: type annotations needed - --> $DIR/equality.rs:20:22 - | -LL | fn sum_to(n: u32) -> impl Foo { - | ^^^^^^^^ cannot infer type for type `{integer}` - | - = note: multiple `impl`s satisfying `{integer}: ToString` found in the `alloc` crate: - - impl ToString for i8; - - impl ToString for u8; -note: required because of the requirements on the impl of `Foo` for `{integer}` - --> $DIR/equality.rs:5:26 - | -LL | impl Foo for T {} - | ^^^ ^ - -error: aborting due to 3 previous errors; 1 warning emitted +error: aborting due to 2 previous errors; 1 warning emitted -Some errors have detailed explanations: E0277, E0283, E0308. +Some errors have detailed explanations: E0277, E0308. For more information about an error, try `rustc --explain E0277`. -- cgit 1.4.1-3-g733a5