From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/inference/issue-72690.stderr | 229 +++++++++++++++++++++++++++++++ 1 file changed, 229 insertions(+) create mode 100644 src/test/ui/inference/issue-72690.stderr (limited to 'src/test/ui/inference/issue-72690.stderr') diff --git a/src/test/ui/inference/issue-72690.stderr b/src/test/ui/inference/issue-72690.stderr new file mode 100644 index 000000000..d4eeda073 --- /dev/null +++ b/src/test/ui/inference/issue-72690.stderr @@ -0,0 +1,229 @@ +error[E0283]: type annotations needed + --> $DIR/issue-72690.rs:7:5 + | +LL | String::from("x".as_ref()); + | ^^^^^^^^^^^^ cannot infer type for reference `&_` + | + = note: multiple `impl`s satisfying `String: From<&_>` found in the `alloc` crate: + - impl<> From<&String> for String; + - impl<> From<&str> for String; + +error[E0283]: type annotations needed + --> $DIR/issue-72690.rs:7:22 + | +LL | String::from("x".as_ref()); + | ^^^^^^ + | + = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`: + - impl AsRef for str; + - impl AsRef for str; + - impl AsRef<[u8]> for str; + - impl AsRef for str; +help: try using a fully qualified path to specify the expected types + | +LL | String::from(>::as_ref("x")); + | ++++++++++++++++++++++++++ ~ + +error[E0282]: type annotations needed + --> $DIR/issue-72690.rs:12:6 + | +LL | |x| String::from("x".as_ref()); + | ^ + | +help: consider giving this closure parameter an explicit type + | +LL | |x: _| String::from("x".as_ref()); + | +++ + +error[E0283]: type annotations needed + --> $DIR/issue-72690.rs:12:26 + | +LL | |x| String::from("x".as_ref()); + | ^^^^^^ + | + = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`: + - impl AsRef for str; + - impl AsRef for str; + - impl AsRef<[u8]> for str; + - impl AsRef for str; +help: try using a fully qualified path to specify the expected types + | +LL | |x| String::from(>::as_ref("x")); + | ++++++++++++++++++++++++++ ~ + +error[E0283]: type annotations needed for `&T` + --> $DIR/issue-72690.rs:17:9 + | +LL | let _ = "x".as_ref(); + | ^ ------ type must be known at this point + | + = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`: + - impl AsRef for str; + - impl AsRef for str; + - impl AsRef<[u8]> for str; + - impl AsRef for str; +help: consider giving this pattern a type, where the type for type parameter `T` is specified + | +LL | let _: &T = "x".as_ref(); + | ++++ + +error[E0283]: type annotations needed + --> $DIR/issue-72690.rs:21:5 + | +LL | String::from("x".as_ref()); + | ^^^^^^^^^^^^ cannot infer type for reference `&_` + | + = note: multiple `impl`s satisfying `String: From<&_>` found in the `alloc` crate: + - impl<> From<&String> for String; + - impl<> From<&str> for String; + +error[E0283]: type annotations needed + --> $DIR/issue-72690.rs:21:22 + | +LL | String::from("x".as_ref()); + | ^^^^^^ + | + = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`: + - impl AsRef for str; + - impl AsRef for str; + - impl AsRef<[u8]> for str; + - impl AsRef for str; +help: try using a fully qualified path to specify the expected types + | +LL | String::from(>::as_ref("x")); + | ++++++++++++++++++++++++++ ~ + +error[E0283]: type annotations needed + --> $DIR/issue-72690.rs:28:5 + | +LL | String::from("x".as_ref()); + | ^^^^^^^^^^^^ cannot infer type for reference `&_` + | + = note: multiple `impl`s satisfying `String: From<&_>` found in the `alloc` crate: + - impl<> From<&String> for String; + - impl<> From<&str> for String; + +error[E0283]: type annotations needed + --> $DIR/issue-72690.rs:28:22 + | +LL | String::from("x".as_ref()); + | ^^^^^^ + | + = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`: + - impl AsRef for str; + - impl AsRef for str; + - impl AsRef<[u8]> for str; + - impl AsRef for str; +help: try using a fully qualified path to specify the expected types + | +LL | String::from(>::as_ref("x")); + | ++++++++++++++++++++++++++ ~ + +error[E0283]: type annotations needed + --> $DIR/issue-72690.rs:37:5 + | +LL | String::from("x".as_ref()); + | ^^^^^^^^^^^^ cannot infer type for reference `&_` + | + = note: multiple `impl`s satisfying `String: From<&_>` found in the `alloc` crate: + - impl<> From<&String> for String; + - impl<> From<&str> for String; + +error[E0283]: type annotations needed + --> $DIR/issue-72690.rs:37:22 + | +LL | String::from("x".as_ref()); + | ^^^^^^ + | + = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`: + - impl AsRef for str; + - impl AsRef for str; + - impl AsRef<[u8]> for str; + - impl AsRef for str; +help: try using a fully qualified path to specify the expected types + | +LL | String::from(>::as_ref("x")); + | ++++++++++++++++++++++++++ ~ + +error[E0283]: type annotations needed + --> $DIR/issue-72690.rs:46:5 + | +LL | String::from("x".as_ref()); + | ^^^^^^^^^^^^ cannot infer type for reference `&_` + | + = note: multiple `impl`s satisfying `String: From<&_>` found in the `alloc` crate: + - impl<> From<&String> for String; + - impl<> From<&str> for String; + +error[E0283]: type annotations needed + --> $DIR/issue-72690.rs:46:22 + | +LL | String::from("x".as_ref()); + | ^^^^^^ + | + = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`: + - impl AsRef for str; + - impl AsRef for str; + - impl AsRef<[u8]> for str; + - impl AsRef for str; +help: try using a fully qualified path to specify the expected types + | +LL | String::from(>::as_ref("x")); + | ++++++++++++++++++++++++++ ~ + +error[E0283]: type annotations needed + --> $DIR/issue-72690.rs:53:5 + | +LL | String::from("x".as_ref()); + | ^^^^^^^^^^^^ cannot infer type for reference `&_` + | + = note: multiple `impl`s satisfying `String: From<&_>` found in the `alloc` crate: + - impl<> From<&String> for String; + - impl<> From<&str> for String; + +error[E0283]: type annotations needed + --> $DIR/issue-72690.rs:53:22 + | +LL | String::from("x".as_ref()); + | ^^^^^^ + | + = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`: + - impl AsRef for str; + - impl AsRef for str; + - impl AsRef<[u8]> for str; + - impl AsRef for str; +help: try using a fully qualified path to specify the expected types + | +LL | String::from(>::as_ref("x")); + | ++++++++++++++++++++++++++ ~ + +error[E0283]: type annotations needed + --> $DIR/issue-72690.rs:62:5 + | +LL | String::from("x".as_ref()); + | ^^^^^^^^^^^^ cannot infer type for reference `&_` + | + = note: multiple `impl`s satisfying `String: From<&_>` found in the `alloc` crate: + - impl<> From<&String> for String; + - impl<> From<&str> for String; + +error[E0283]: type annotations needed + --> $DIR/issue-72690.rs:62:22 + | +LL | String::from("x".as_ref()); + | ^^^^^^ + | + = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`: + - impl AsRef for str; + - impl AsRef for str; + - impl AsRef<[u8]> for str; + - impl AsRef for str; +help: try using a fully qualified path to specify the expected types + | +LL | String::from(>::as_ref("x")); + | ++++++++++++++++++++++++++ ~ + +error: aborting due to 17 previous errors + +Some errors have detailed explanations: E0282, E0283. +For more information about an error, try `rustc --explain E0282`. -- cgit v1.2.3