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
901b340c1f5d208561d4261cc3ee634973b35326
rust/tests/ui/nll/borrowed-universal-error-2.rs

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

8 lines
147 B
Rust
Raw Normal View History

Make explain borrow work for Universal lifetimes
2018-03-01 11:56:43 -03:00
fn foo<'a>(x: &'a (u32,)) -> &'a u32 {
let v = 22;
&v
Use new region infer errors for explaining borrows This gives at least some explanation for why a borrow is expected to last for a certain free region. Also: * Reports E0373: "closure may outlive the current function" with NLL. * Special cases the case of returning a reference to (or value referencing) a local variable or temporary (E0515). * Special case assigning a reference to a local variable in a closure to a captured variable.
2018-10-14 15:12:02 +01:00
//~^ ERROR cannot return reference to local variable `v` [E0515]
Make explain borrow work for Universal lifetimes
2018-03-01 11:56:43 -03:00
}
fn main() {}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 3070ms Template: 3ms
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