| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
The check for whether a pat_ident is a variant or a binding
is simple and fast. Normalizing patterns again and again is
slow and error-prone (several places were forgetting to do it).
|
|
first step towards issue #1273
|
|
At some point, a refactor broke the code that handled local declarations
to no longer descend into the initializer expressions.
Closes #1846
|
|
It is only a way to flag an alt as intentionally non-exhaustive right now.
Issue #1679
|
|
|
|
Enough to be able to compile librustc with --monomorphize.
Issue #1736
|
|
|
|
It is now no longer needed to have a ty::ctxt to get at the contents
of a ty::t. The straight-forward approach of doing this, simply making
ty::t a box type, unfortunately killed our compiler performance (~15%
slower) through refcounting cost. Thus, this patch now represents
ty::t as an unsafe pointer, assuming that the ty::ctxt, which holds
these boxes alive, outlives any uses of the ty::t values. In the
current compiler this trivially holds, but it is does of course add a
new potential pitfall.
ty::get takes a ty::t and returns a boxed representation of the type.
I've changed calls to ty::struct(X) to do ty::get(X).struct. Type
structs are full of vectors, and copying them every time we wanted to
access them was a bit of a cost.
|
|
Conflicts:
src/libcore/vec.rs
src/libstd/getopts.rs
|
|
|
|
Issue #1673
|
|
Now that core exports "option" as a synonym for option::t, search-and-
replace option::t with option.
The only place that still refers to option::t are the modules in libcore
that use option, because fixing this requires a new snapshot
(forthcoming).
|
|
middle::check_alt does the work. Lots of changes to add default cases
into alts that were previously inexhaustive.
|
|
All the files below had at least one instance of the ternary operator
present in the source. All have been changed to the equivalent
if/then/else expression.
|
|
Almost all of the vec functions that predicates don't have a
corresponding function that takes a single element, so this
commit renames the common fn usecase to be the default.
|
|
It was being used as a clumsy synonym of ty_fn.
|
|
This should reduce confusion of people trying to read the code.
|
|
|
|
|
|
|
|
Does what it says on the tin.
The next commit will remove support for this syntax.
|
|
This commit allows patterns like:
alt x { some(_) { ... } none { } }
without the '.' after none. The parser suspends judgment about
whether a bare ident is a tag or a new bound variable; instead,
the resolver disambiguates.
This means that any code after resolution that pattern-matches on
patterns needs to call pat_util::normalize_pat, which consults
an environment to do this disambiguation.
In addition, local variables are no longer allowed to shadow
tag names, so this required changing some code (e.g. renaming
variables named "mut", and renaming ast::sub to subtract).
The parser currently accepts patterns with and without the '.'.
Once the compiler and libraries are changed, it will no longer
accept the '.'.
|
|
|
|
Removes the obj system from the compiler.
Closes #1484
|
|
Rather, it is now a struct where properties like opts are accessed
directly, and the error-reporting methods are part of a static impl
(with the same name as the type).
|
|
|
|
this will address the (crashing) new test added.
|
|
|
|
Removes some more code duplication.
|
|
|
|
|
|
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
|
|
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
|
|
|
|
Also shuffles around the organization of numeric literals and types,
separating by int/uint/float instead of machine-vs-non-machine types.
This simplifies some code.
Closes #974
Closes #1252
|
|
It seems inefficient to copy them around. Let's measure whether that's actually
> the case
|
|
It's proving too inflexible, so I'm ripping out the extra complexity
in the hope that regions will, at some point, provide something
similar.
Closes #918
|
|
|
|
|
|
The last-use pass now takes input from the alias pass to not mark things
as last uses that are still accessed through a reference.
Issue #925
|
|
This is intended to solve the problem of how to pass arguments to
constructor functions -- you want to move in rvalues, but not have to
explicitly copy stuff that is not an rvalue. The by-copy passing
convention will ensure the callee gets its own copy of the value. For
rvalues, it'll just pass off the value. For lvalues, it'll make a
copy.
Issue #1177
|
|
|
|
It now threads information about invalidated aliases through the AST
properly. This makes it more permissive for conditionals (invalidating
an alias in one branch doesn't prevent you from using it in another),
and less permissive for loops (it now properly notices when a loop
invalidates an alias that it might still use in another iteration).
Closes #1144
|
|
|
|
Remove implicit copying hack.
Closes #1118
|
|
Closes #1055
|