2020-10-19 11:42:57 -05:00
|
|
|
error[E0283]: type annotations needed
|
2023-10-04 22:57:10 -05:00
|
|
|
--> $DIR/issue-77982.rs:9:10
|
2020-10-19 11:42:57 -05:00
|
|
|
|
|
|
|
|
LL | opts.get(opt.as_ref());
|
2022-08-16 01:27:22 -05:00
|
|
|
| ^^^ ------------ type must be known at this point
|
|
|
|
| |
|
2023-02-21 15:11:08 -06:00
|
|
|
| cannot infer type of the type parameter `Q` declared on the method `get`
|
2020-10-19 11:42:57 -05:00
|
|
|
|
|
2021-10-01 08:05:17 -05:00
|
|
|
= note: multiple `impl`s satisfying `String: Borrow<_>` found in the following crates: `alloc`, `core`:
|
|
|
|
- impl Borrow<str> for String;
|
|
|
|
- impl<T> Borrow<T> for T
|
|
|
|
where T: ?Sized;
|
2021-10-05 18:04:09 -05:00
|
|
|
note: required by a bound in `HashMap::<K, V, S>::get`
|
|
|
|
--> $SRC_DIR/std/src/collections/hash/map.rs:LL:COL
|
2022-08-16 01:27:22 -05:00
|
|
|
help: consider specifying the generic argument
|
2021-10-05 18:04:09 -05:00
|
|
|
|
|
|
|
|
LL | opts.get::<Q>(opt.as_ref());
|
|
|
|
| +++++
|
2020-10-19 11:42:57 -05:00
|
|
|
|
|
|
|
error[E0283]: type annotations needed
|
2023-10-04 22:57:10 -05:00
|
|
|
--> $DIR/issue-77982.rs:9:10
|
2021-10-01 08:05:17 -05:00
|
|
|
|
|
|
|
|
LL | opts.get(opt.as_ref());
|
2022-08-16 19:21:40 -05:00
|
|
|
| ^^^ ------ type must be known at this point
|
|
|
|
| |
|
2023-02-21 15:11:08 -06:00
|
|
|
| cannot infer type of the type parameter `Q` declared on the method `get`
|
2021-10-01 08:05:17 -05:00
|
|
|
|
|
|
|
|
= note: multiple `impl`s satisfying `String: AsRef<_>` found in the following crates: `alloc`, `std`:
|
|
|
|
- impl AsRef<OsStr> for String;
|
|
|
|
- impl AsRef<Path> for String;
|
|
|
|
- impl AsRef<[u8]> for String;
|
|
|
|
- impl AsRef<str> for String;
|
2022-02-14 06:25:26 -06:00
|
|
|
help: consider specifying the generic argument
|
|
|
|
|
|
|
|
|
LL | opts.get::<Q>(opt.as_ref());
|
|
|
|
| +++++
|
2021-10-01 08:05:17 -05:00
|
|
|
|
2023-08-14 08:09:53 -05:00
|
|
|
error[E0283]: type annotations needed
|
2023-10-04 22:57:10 -05:00
|
|
|
--> $DIR/issue-77982.rs:14:59
|
2020-10-19 11:42:57 -05:00
|
|
|
|
|
|
|
|
LL | let ips: Vec<_> = (0..100_000).map(|_| u32::from(0u32.into())).collect();
|
2023-08-14 08:09:53 -05:00
|
|
|
| --- ^^^^
|
|
|
|
| |
|
|
|
|
| type must be known at this point
|
|
|
|
|
|
|
|
|
= note: multiple `impl`s satisfying `u32: From<_>` found in the `core` crate:
|
2024-01-25 09:32:44 -06:00
|
|
|
- impl From<Char> for u32;
|
2023-08-14 08:09:53 -05:00
|
|
|
- impl From<Ipv4Addr> for u32;
|
|
|
|
- impl From<bool> for u32;
|
|
|
|
- impl From<char> for u32;
|
|
|
|
- impl From<u16> for u32;
|
|
|
|
- impl From<u8> for u32;
|
2022-02-14 06:25:26 -06:00
|
|
|
help: try using a fully qualified path to specify the expected types
|
|
|
|
|
|
|
|
|
LL | let ips: Vec<_> = (0..100_000).map(|_| u32::from(<u32 as Into<T>>::into(0u32))).collect();
|
|
|
|
| +++++++++++++++++++++++ ~
|
2020-10-19 11:42:57 -05:00
|
|
|
|
Use `fn` ptr signature instead of `{closure@..}` in infer error
When suggesting a type on inference error, do not use `{closure@..}`.
Instead, replace with an appropriate `fn` ptr.
On the error message, use `short_ty_string` and write long types to
disk.
```
error[E0284]: type annotations needed for `Select<{closure@lib.rs:2782:13}, _, Expression<'_>, _>`
--> crates/lang/src/parser.rs:41:13
|
41 | let lit = select! {
| ^^^
42 | Token::Int(i) = e => Expression::new(Expr::Lit(ast::Lit::Int(i.parse().unwrap())), e.span()),
| ---- type must be known at this point
|
= note: the full type name has been written to '/home/gh-estebank/iowo/target/debug/deps/lang-e2d6e25819442273.long-type-4587393693885174369.txt'
= note: cannot satisfy `<_ as chumsky::input::Input<'_>>::Span == SimpleSpan`
help: consider giving `lit` an explicit type, where the type for type parameter `I` is specified
|
41 | let lit: Select<for<'a, 'b> fn(tokens::Token<'_>, &'a mut MapExtra<'_, 'b, _, _>) -> Option<Expression<'_>>, _, Expression<'_>, _> = select! {
| +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
```
instead of
```
error[E0284]: type annotations needed for `Select<{closure@/home/gh-estebank/.cargo/registry/src/index.crates.io-6f17d22bba15001f/chumsky-1.0.0-alpha.6/src/lib.rs:2782:13: 2782:28}, _, Expression<'_>, _>`
--> crates/lang/src/parser.rs:41:13
|
41 | let lit = select! {
| ^^^
42 | Token::Int(i) = e => Expression::new(Expr::Lit(ast::Lit::Int(i.parse().unwrap())), e.span()),
| ---- type must be known at this point
|
= note: cannot satisfy `<_ as chumsky::input::Input<'_>>::Span == SimpleSpan`
help: consider giving `lit` an explicit type, where the type for type parameter `I` is specified
|
41 | let lit: Select<{closure@/home/gh-estebank/.cargo/registry/src/index.crates.io-6f17d22bba15001f/chumsky-1.0.0-alpha.6/src/lib.rs:2782:13: 2782:28}, _, Expression<'_>, _> = select! {
| ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
```
Fix #123630.
2024-04-09 19:11:52 -05:00
|
|
|
error[E0283]: type annotations needed for `Box<_>`
|
2023-10-04 22:57:10 -05:00
|
|
|
--> $DIR/issue-77982.rs:37:9
|
2020-10-19 11:42:57 -05:00
|
|
|
|
|
|
|
|
LL | let _ = ().foo();
|
2022-08-16 19:21:40 -05:00
|
|
|
| ^ --- type must be known at this point
|
2020-10-19 11:42:57 -05:00
|
|
|
|
|
2021-10-01 08:05:17 -05:00
|
|
|
note: multiple `impl`s satisfying `(): Foo<'_, _>` found
|
2023-10-04 22:57:10 -05:00
|
|
|
--> $DIR/issue-77982.rs:30:1
|
2021-10-01 08:05:17 -05:00
|
|
|
|
|
|
|
|
LL | impl Foo<'static, u32> for () {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
LL | impl<'a> Foo<'a, i16> for () {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-02-14 06:25:26 -06:00
|
|
|
help: consider giving this pattern a type, where the type for type parameter `T` is specified
|
|
|
|
|
|
|
|
|
LL | let _: Box<T> = ().foo();
|
|
|
|
| ++++++++
|
2020-10-19 11:42:57 -05:00
|
|
|
|
Use `fn` ptr signature instead of `{closure@..}` in infer error
When suggesting a type on inference error, do not use `{closure@..}`.
Instead, replace with an appropriate `fn` ptr.
On the error message, use `short_ty_string` and write long types to
disk.
```
error[E0284]: type annotations needed for `Select<{closure@lib.rs:2782:13}, _, Expression<'_>, _>`
--> crates/lang/src/parser.rs:41:13
|
41 | let lit = select! {
| ^^^
42 | Token::Int(i) = e => Expression::new(Expr::Lit(ast::Lit::Int(i.parse().unwrap())), e.span()),
| ---- type must be known at this point
|
= note: the full type name has been written to '/home/gh-estebank/iowo/target/debug/deps/lang-e2d6e25819442273.long-type-4587393693885174369.txt'
= note: cannot satisfy `<_ as chumsky::input::Input<'_>>::Span == SimpleSpan`
help: consider giving `lit` an explicit type, where the type for type parameter `I` is specified
|
41 | let lit: Select<for<'a, 'b> fn(tokens::Token<'_>, &'a mut MapExtra<'_, 'b, _, _>) -> Option<Expression<'_>>, _, Expression<'_>, _> = select! {
| +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
```
instead of
```
error[E0284]: type annotations needed for `Select<{closure@/home/gh-estebank/.cargo/registry/src/index.crates.io-6f17d22bba15001f/chumsky-1.0.0-alpha.6/src/lib.rs:2782:13: 2782:28}, _, Expression<'_>, _>`
--> crates/lang/src/parser.rs:41:13
|
41 | let lit = select! {
| ^^^
42 | Token::Int(i) = e => Expression::new(Expr::Lit(ast::Lit::Int(i.parse().unwrap())), e.span()),
| ---- type must be known at this point
|
= note: cannot satisfy `<_ as chumsky::input::Input<'_>>::Span == SimpleSpan`
help: consider giving `lit` an explicit type, where the type for type parameter `I` is specified
|
41 | let lit: Select<{closure@/home/gh-estebank/.cargo/registry/src/index.crates.io-6f17d22bba15001f/chumsky-1.0.0-alpha.6/src/lib.rs:2782:13: 2782:28}, _, Expression<'_>, _> = select! {
| ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
```
Fix #123630.
2024-04-09 19:11:52 -05:00
|
|
|
error[E0283]: type annotations needed for `Box<_>`
|
2023-10-04 22:57:10 -05:00
|
|
|
--> $DIR/issue-77982.rs:41:9
|
2020-10-19 11:42:57 -05:00
|
|
|
|
|
|
|
|
LL | let _ = (&()).bar();
|
2022-08-16 19:21:40 -05:00
|
|
|
| ^ --- type must be known at this point
|
2020-10-19 11:42:57 -05:00
|
|
|
|
|
2021-10-01 08:05:17 -05:00
|
|
|
note: multiple `impl`s satisfying `&(): Bar<'_, _>` found
|
2023-10-04 22:57:10 -05:00
|
|
|
--> $DIR/issue-77982.rs:33:1
|
2021-10-01 08:05:17 -05:00
|
|
|
|
|
|
|
|
LL | impl<'a> Bar<'static, u32> for &'a () {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
LL | impl<'a> Bar<'a, i16> for &'a () {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-02-14 06:25:26 -06:00
|
|
|
help: consider giving this pattern a type, where the type for type parameter `T` is specified
|
|
|
|
|
|
|
|
|
LL | let _: Box<T> = (&()).bar();
|
|
|
|
| ++++++++
|
2020-10-19 11:42:57 -05:00
|
|
|
|
2022-08-16 19:21:40 -05:00
|
|
|
error: aborting due to 5 previous errors
|
2020-10-19 11:42:57 -05:00
|
|
|
|
2023-08-14 08:09:53 -05:00
|
|
|
For more information about this error, try `rustc --explain E0283`.
|