This website requires JavaScript.
Explore
Help
Register
Sign In
mikros
/
rust
Watch
1
Star
0
Fork
0
You've already forked rust
Code
Issues
Pull Requests
Packages
Projects
Releases
Wiki
Activity
e1b14f6d5b
rust
/
src
/
test
/
compile-fail
/
bang-tailexpr.rs
4 lines
80 B
Rust
Raw
Normal View
History
Unescape
Escape
Handle bang functions correctly in typestate The logic for how the "returns" constraint was handled was always dodgy, for reasons explained in the comments I added to auxiliary::fn_info in this commit. Fixed it by adding distinct "returns" and "diverges" constraints for each function, which are both handled positively (that is: for a ! function, the "diverges" constraint must be true on every exit path; for any other function, the "returns" constraint must be true on every exit path). Closes #779
2011-08-01 22:55:04 -05:00
// error-pattern: some control paths may return
fn
f
(
)
->
!
{
3
}
Reformat This changes the indexing syntax from .() to [], the vector syntax from ~[] to [] and the extension syntax from #fmt() to #fmt[]
2011-08-19 17:16:48 -05:00
fn
main
(
)
{
}
Reference in New Issue
Copy Permalink