Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
51b51b51d7931da85280382a81c4dd80c73ca754
rust/tests/ui/borrowck/borrowck-move-out-of-overloaded-auto-deref.fixed

8 lines
158 B
Rust
Raw Normal View History

[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives
2024-02-16 20:02:50 +00:00
//@ run-rustfix
Mark more tests as `run-rustfix`
2023-11-20 23:57:59 +00:00
use std::rc::Rc;
pub fn main() {
Suggest `.clone()` in some move errors ``` error[E0507]: cannot move out of `*x` which is behind a shared reference --> $DIR/borrowck-fn-in-const-a.rs:6:16 | LL | return *x | ^^ move occurs because `*x` has type `String`, which does not implement the `Copy` trait | help: consider cloning the value if the performance cost is acceptable | LL - return *x LL + return x.clone() | ```
2024-03-13 03:41:41 +00:00
let _x = <Vec<i32> as Clone>::clone(&Rc::new(vec![1, 2]).clone()).into_iter();
Mark more tests as `run-rustfix`
2023-11-20 23:57:59 +00:00
//~^ ERROR [E0507]
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 434ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API