Remove asterisk suggestion for move errors in borrowck
As per the decision in #54985 completely removes the suggestion to add an asterisk when checking move errors. I believe I've preserved the correct behavior with the "consider borrowing here" branch of the original match arm, but I'm not positive on that.
This is my first PR to rustc so any feedback is greatly appreciated. Thanks.
As per issue #54985 removes the not useful suggestion to remove asterisk in
move errors. Includes minor changes to tests in the `ui` suite to account
for the removed suggestion.
Make cannot move errors more consistent with other borrowck errors
* Note the type of the place being moved in all cases.
* Note the place being moved from.
* Simplify the search for overloaded place operators
* Extend the note for move from overloaded deref apply to all types.
* Add a note for moves from overloaded index.
* Special case moves for closure captures.
r? @pnkfelix
Add more detail to type inference error
When encountering code where type inference fails, add more actionable
information:
```
fn main() {
let foo = Vec::new();
}
```
```
error[E0282]: type annotations needed in `std::vec::Vec<T>`
--> $DIR/vector-no-ann.rs:2:16
|
LL | let foo = Vec::new();
| --- ^^^^^^^^ cannot infer type for `T` in `std::vec::Vec<T>`
| |
| consider giving `foo` a type
```
Fix#25633.
Point at individual type args on arg count mismatch
- Point at individual type arguments on arg count mismatch
- Make generics always have a valid span, even when there are no args
- Explain that `impl Trait` introduces an implicit type argument
Fix#55991.
```
error[E0282]: type annotations needed in `std::result::Result<i32, E>`
--> file7.rs:3:13
|
3 | let b = Ok(4);
| - ^^ cannot infer type for `E` in `std::result::Result<i32, E>`
| |
| consider giving `b` a type`
```
When encountering code where type inference fails, add more actionable
information:
```
fn main() {
let foo = Vec::new();
}
```
```
error[E0282]: type annotations needed for `std::vec::Vec<_>`
--> $DIR/vector-no-ann.rs:2:16
|
LL | let foo = Vec::new();
| --- ^^^^^^^^ cannot infer type for `T`
| |
| consider giving `foo` the type `std::vec::Vec<_>` with the type parameter `T` specified
```
We still need to modify type printing to optionally accept a
`TypeVariableTable` in order to properly print `std::vec::Vec<T>`.
CC #25633.
Warn on bare_trait_objects by default
The `bare_trait_objects` lint is set to `warn` by default.
Most ui tests have been updated to use `dyn` to avoid creating noise in stderr files.
r? @Centril
cc #54910
Added ignore-sgx for appropriate tests in src/test
These are all the tests that make sense to ignore when targeting fortanix-unknonw-sgx, at least in test/runpass. Other suites not yet covered.
lint: convert incoherent_fundamental_impls into hard error
*Summary for affected authors:* If your crate depends on one of the following crates, please upgrade to a newer version:
- gtk-rs: upgrade to at least 0.4
- rusqlite: upgrade to at least 0.14
- nalgebra: upgrade to at least 0.15, or the last patch version of 0.14
- spade: upgrade or refresh the Cargo.lock file to use version 1.7
- imageproc: upgrade to at least 0.16 (newer versions no longer use nalgebra)
implement #46205
r? @nikomatsakis