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
Currently, rustc requires that a linkage be a product of 100% rlibs or 100%
dylibs. This is to satisfy the requirement that each object appear at most once
in the final output products. This is a bit limiting, and the upcoming libcore
library cannot exist as a dylib, so these rules must change.
The goal of this commit is to enable *some* use cases for mixing rlibs and
dylibs, primarily libcore's use case. It is not targeted at allowing an
exhaustive number of linkage flavors.
There is a new dependency_format module in rustc which calculates what format
each upstream library should be linked as in each output type of the current
unit of compilation. The module itself contains many gory details about what's
going on here.
cc #10729
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
In the process, `Splits` got changed to be more like `CharSplits` in `str` to present the DEI interface.
Note that `treemap` still has a `rev_iter` function because it seems like it would be a significant interface change to expose a DEI - the iterator would have to gain an extra pointer, the completion checks would be more complicated, and it isn't easy to check that such an implementation is correct due to the use of unsafety to subvert the aliasing properties of `&mut`.
This fixes#9391.
Two selector fixes for rustdoc:
- links colored in blue (#13807) was also affecting headers, which are anchored to their respective ids
- the header unstyling from #13776 was being applied to all headers also
Additionally, remove a stray title in the documentation. This makes the crate title of prelude appear as header instead of an inline paragraph of text (all others work normally and do not have that header tag).
The design is unchanged from my previous template (e.g. [here](http://adrientetar.legtux.org/cached/rust-docs/struct.CChars.htm)), however it is now properly applied.
The last fix remaining is to enable webfonts service from `static.rust-lang.org`, this is #13593.
r? @alexcrichton, @brson
Previously, windows was using the CREATE_NEW flag which fails if the file
previously existed, which differed from the unix semantics. This alters the
opening to use the OPEN_ALWAYS flag to mirror the unix semantics.
Closes#13861
Most important: distinguish function decl sugar for omitting `-> ()`
from type inference on closures. I also tried to add a couple more
examples to further emphasize this distinction. Note that this sugar
(of omitting `-> ()`) is actually already briefly mentioned in an
earlier section, so it is a little tricky deciding whether to put more
material here, or to move it up to the previous section.
Other drive-by fixes:
* Fix the line length of the code blocks to fit in the width provided
in the rendered HTML
* Some minor revisions to wording (e.g. try to clarify in some cases
where a type mismatch is arising).