Adds a --monomorpize flag to rustc to turn it on. You probably don't
want to use it yet, since it's broken in a whole bunch of ways, but it
successfully monomorphizes simple generic functions called from within
the crate.
Issue #1736
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).
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.
When no built-in interpretation is found for one of the operators
mentioned below, the typechecker will try to turn it into a method
call with the name written next to it. For binary operators, the
method will be called on the LHS with the RHS as only parameter.
Binary:
+ op_add
- op_sub
* op_mul
/ op_div
% op_rem
& op_and
| op_or
^ op_xor
<< op_shift_left
>> op_shift_right
>>> op_ashift_right
Unary:
- op_neg
! op_not
Overloading of the indexing ([]) operator isn't finished yet.
Issue #1520
Specifically box the string (to avoid unnecessary copies) and store it
in codemap::filemap.
Remove the hack in driver::diagnostic that rereads the source from the
file and instead just get the source from the filemap.
(This commit is also a prerequisite for issue #1612)
The former contain a codemap (which is per-crate), and the latter don't. This
will be useful in order to allow more than one crate to be compiled in one run
of the compiler.
This correctly fixes issue #1362.
chpos/byte_pos are now the offsets within a particular file, but
rather the offsets within a virtual file with is formed by combing all
of the modules within a crate. Thus, resetting them to 0 causes an
overlap and hence, bogus source locations.
Fix#1362 by moving chpos/byte_pos to parse_sess so that
new_parser_from_source_str has access to them and hence can chose an
initial value that is not already been used in the crate.
Note that the trigger for bug 1361 was that syntax/ext/expand.rs calls
parse_expr_from_source_str (which calls new_parser_from_source_str)
using the same codemap as the current crate (and hence causing overlap
with files in the crate as new_parser_from_source_str resets the
chpos/byte_pos to 0).
There is now only one path doing crate expanding and typechecking,
which should make it less likely for the pretty-printing code to be
broken by changes to the compilation pipeline.
Closes#1536
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).
Use ifaces instead of objs, stop wrapping everything in two (or three)
layers of no-value-added indirection, and remove some of the more
pointless/outdated idioms from the code.