| Age | Commit message (Collapse) | Author | Lines |
|
Get rid of expr_self_call, introduces def_self. `self` is now,
syntactically, simply a variable. A method implicitly brings a `self`
binding into scope.
Issue #1227
|
|
|
|
|
|
See src/test/run-pass/nested-patterns.rs for some examples. The syntax is
boundvar@subpattern
Which will match the subpattern as usual, but also bind boundvar to the
whole matched value.
Closes #838
|
|
Closes #1265
|
|
It seems inefficient to copy them around. Let's measure whether that's actually
> the case
|
|
|
|
|
|
This makes it possible to omit the semicolon after the block, and will
cause the pretty-printer to properly print such calls (if
pretty-printing of blocks wasn't so broken). Block calls (with the
block outside of the parentheses) can now only occur at statement
level, and their value can not be used. When calling a block-style
function that returns a useful value, the block must be put insde the
parentheses.
Issue #1054
|
|
Closes #1056
|
|
Issue #1056
|
|
Like the box unop.
Issue #409
|
|
Issue #918
|
|
It will include information about returning by alias.
|
|
|
|
Long lines were fixed in a very crude way, as I'll be following up
with another reformat in a bit.
|
|
Move expressions where the RHS is an upvar are now forbidden within
block expressions.
|
|
|
|
Propagate the if-check constraint into the consequent even when
there's no else branch. (Oops!)
|
|
|
|
|
|
Upvars are now marked with def_upvar throughout, not just when going
through freevars::lookup_def. This makes things less error-prone. One
thing to watch out for is that def_upvar is used in `for each` bodies
too, when they refer to a local outside the body.
|
|
Closes #868. Unfortunately, this causes certain invalid programs to
fail type-checking instead of failing type-state when a type-state
error message would probably be more intuitive. (Although, by any
reasonable interpretation of the static semantics, it technically
ought to be a type error.)
|
|
|
|
|
|
This leaves syntax::ast just defining the AST, which strikes me as somewhat
nicer
|
|
This changes the indexing syntax from .() to [], the vector syntax from ~[] to
[] and the extension syntax from #fmt() to #fmt[]
|
|
|
|
Add the infrastructure for arguments -- as well as local vars --
to be deinitialized with move-mode calls. Address Issue #819
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
compile-fail/move-arg.rs.
|
|
Previously, typestate was initializing the init constraint for
a declared-but-not-initialized variable (like x in "let x;") to False,
but other constraints to Don't-know. This led to over-lenient results
when a variable was used before declaration (see the included test
case). Now, everything gets initialized to False in the prestate/poststate-
finding phase, and Don't-know should only be used in pre/postconditions.
This aspect of the algorithm really needs formalization (just on paper),
but for now, this closes #700
|
|
And use it to get rid of some repetetive code
|
|
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
|
|
You can now say
let {bcx, val} = some_result_returner();
Similar for loop variables. Assigning to such variables is not safe
yet. Function arguments also remain a TODO.
|
|
To handle multiple-LHS declarations with initializers properly,
I changed seq_states to take a list of expressions paired with optional
names, not just a list of expressions. Then, the same logic that handles
ordered lists of subexpressions everywhere else can handle multi-
declarations.
|
|
(Also, some formatting and long-string cleanup.)
|
|
|
|
There are still things not handled properly: relying on other preconditions
of upvars is likely to cause bad things to happen. We probably want to
disallow it.
|
|
|
|
|