This is a first patch towards an opt-in built-in trait world. This patch removes the restriction on built-in traits and allows such traits to be derived.
[RFC#3]
cc #13231
@nikomatsakis r?
This change allow a speedup of ~1.5 on shootout-pidigits on a i32
system. `MachineUint` is used to abstract the internal machine
unsigned integer to simplity future architecture specialization.
This ensures that private functions exported through static initializers will
actually end up being public in the object file (so other objects can continue
to reference the function).
Closes#13620
This has long since not been too relevant since the introduction of many crate
type outputs. This commit removes the flag entirely, adjusting all logic to do
the most reasonable thing when building both a library and an executable.
Closes#13337
Namely:
* Added conversion traits both to and from the various vector types,
analogous to how `str::MaybeOwned` works with `str::IntoMaybeOwned`
and `str::Str`. This led me to add the `FixedLen` variant of
`MaybeOwnedVector` for interoperability with `std::slice`.
* Revised client example code to make use of `into_maybe_owned`
* Added implementations of `Show` and `CloneableVector` for
`MaybeOwnedVector`.
* As suggested by kballard, added `into_vec` method that is analogous
to `CloneableVector::into_owned` except it produces a `Vec` rather
than a `~[T]`.
Commits for details.
This shouldn't change the generated code at all (except for switching to `LitBinary` from an explicit ExprVec of individual ExprLit bytes for `prefix_bytes`).
char literals now work in a quotation.
There were several instances of duplicated functionality in regex_macros
compared to AstBuilder so refactor those out.
Clearly storing them as `char` is semantically nicer, but this also
fixes a bug whereby `quote_expr!(cx, 'a')` wasn't working, because the
code created by quotation was not matching the actual AST definitions.
I switched the `assert!` calls in `RefCell` over to `debug_assert!`.
There are probably other instances that should be converted as well, but
I couldn't think of any off the top of my head.
RFC: 0015-assert
This change allow a speedup of ~1.5 on shootout-pidigits on a i32
system. `DoubleBigDigit` is used to abstract the internal
unsigned integer used in computation to simplity future
architecture specialization.
`BigDigit::from_uint` and `BigDigit::to_uint` become
`BigDigit::from_doublebigdigit` and `BigDigit::to_doublebigdigit`.
[breaking-change]
Pre-step towards issue #12624 and others: Introduce ExprUseVisitor, remove the
moves computation. ExprUseVisitor is a visitor that walks the AST for a
function and calls a delegate to inform it where borrows, copies, and moves
occur.
In this patch, I rewrite the gather_loans visitor to use ExprUseVisitor, but in
future patches, I think we could rewrite regionck, check_loans, and possibly
other passes to use it as well. This would refactor the repeated code between
those places that tries to determine where copies/moves/etc occur.
r? @alexcrichton