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
300901b70509a0af2d971aa6f6104300da24212c
rust/tests/ui/nll/borrowed-universal-error.rs

12 lines
202 B
Rust
Raw Normal View History

Make explain borrow work for Universal lifetimes
2018-03-01 11:56:43 -03:00
fn gimme(x: &(u32,)) -> &u32 {
&x.0
}
fn foo<'a>(x: &'a (u32,)) -> &'a u32 {
let v = 22;
gimme(&(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 value referencing temporary value [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: 2128ms 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