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
55b6f649024b372af901b3412a6d36c4284ccf3d
rust/tests/ui/nll/return-ref-mut-issue-46557.rs

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

9 lines
198 B
Rust
Raw Normal View History

Add NLL tests for #46557 and #38899 Closes #47366 Adapt the sample code from the issues into mir-borrowck/nll test cases.
2018-01-11 18:08:28 -05:00
// Regression test for issue #46557
fn gimme_static_mut() -> &'static mut u32 {
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
let ref mut x = 1234543;
x //~ ERROR cannot return value referencing temporary value [E0515]
Add NLL tests for #46557 and #38899 Closes #47366 Adapt the sample code from the issues into mir-borrowck/nll test cases.
2018-01-11 18:08:28 -05:00
}
fn main() {}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 3435ms 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