Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 2 Packages Projects Releases Wiki Activity
Files
51b51b51d7931da85280382a81c4dd80c73ca754
rust/tests/ui/nll/issue-52534-2.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
169 B
Rust
Raw Normal View History

Only annotate if borrow is returned. Error now correctly checks whether the borrow that does not live long enough is being returned before annotating the error with the arguments and return type from the signature - as this would not be relevant if the borrow was not being returned.
2018-09-19 02:48:47 +02:00
fn foo(x: &u32) -> &u32 {
let y;
{
let x = 32;
y = &x
Update tests
2018-11-27 10:56:36 +01:00
//~^ ERROR does not live long enough
Only annotate if borrow is returned. Error now correctly checks whether the borrow that does not live long enough is being returned before annotating the error with the arguments and return type from the signature - as this would not be relevant if the borrow was not being returned.
2018-09-19 02:48:47 +02:00
}
println!("{}", y);
x
}
fn main() { }
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 2887ms 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