That is, the `b` branch in `if true { a } else { b }` will not be
trans'd, and that expression will be exactly the same as `a`. This
means that, for example, macros conditionally expanding to `if false
{ .. }` (like debug!) will not waste time in LLVM (or trans).
An alloca in an unreachable block would shortcircuit with Undef, but with type
`Type`, rather than type `*Type` (i.e. a plain value, not a pointer) but it is
expected to return a pointer into the stack, leading to confusion and LLVM
asserts later.
Similarly, attaching the range metadata to a Load in an unreachable block
makes LLVM unhappy, since the Load returns Undef.
Fixes#7344.
The Ord impl of Version refered to the algorithm in release candidate versions of semver. [Semantic Versioning 2.0.0](http://semver.org/spec/v2.0.0.html) says, "Build metadata SHOULD be ignored when determining version precedence."
Note that Version's `le` is not "less than or equal to" now, since `lt` ignores build metadata. I think the new ordering algorithm satisfies strict weak ordering which C++ STL requires, instead of strict total ordering.
BTW, is `a || b || ... || x`-style code better or idiomatic in Rust than `if a { return true; } if b { return true; } ... if x { return true; } return false;`-style one?
Note that Version's `le` is not "less than or equal to" now, since `lt`
ignores build metadata. I think the new ordering algorithm satisfies
strict weak ordering which C++ STL requires, instead of strict total
ordering.
Macros can be conditionally defined because stripping occurs before macro
expansion, but, the built-in macros were only added as part of the actual
expansion process and so couldn't be stripped to have definitions conditional
on cfg flags.
debug! is defined conditionally in terms of the debug config, expanding to
nothing unless the --cfg debug flag is passed (to be precise it expands to
`if false { normal_debug!(...) }` so that they are still type checked, and
to avoid unused variable lints).
Note that the headers are still on `~[T]` when `T` is managed. This is continued from #7605, which removed all the code relying on the headers and removed them from `~T` for non-managed `T`.
Implement set difference, sym. difference, intersection and union using Iterators.
The set methods are left since they are part of the Set trait. A grep over the tree indicates that the four hashset operations have no users at all.
Also remove HashMap::mutate_values since it is unused, replaced by .mut_iter(), and not part of a trait.
Implement the difference, union, etc iterators with the help of a custom
iterator combinator with explicit closure environment. Reported issue #7814
to be able to use the std::iterator filter combinator.
r? @graydon rustpkg can now build code from a local git repository. In the
case where the local repo is in a directory not in the RUST_PATH,
it checks out the repository into a directory in the first workspace
in the RUST_PATH.
The tests no longer try to connect to github.com, which should
solve some of the sporadic failures we've been seeing.
rustpkg can now build code from a local git repository. In the
case where the local repo is in a directory not in the RUST_PATH,
it checks out the repository into a directory in the first workspace
in the RUST_PATH.
The tests no longer try to connect to github.com, which should
solve some of the sporadic failures we've been seeing.
This should be pretty self-explanatory. The most important component is region/lifetime annotation highlighting, as previously they were interpreted as character literals and would ruin the rest of the line. The attribute regex is fairly crude, but it gets the job done and there's not much within attributes that would benefit from individual highlighting, so fancier handling didn't seem worth the trouble.
The ident regex was copied from the vim highlighter.
Teach `extra::term` to support more terminal attributes than just color.
Fix the compiler diagnostic messages to print in bold instead of bright white. This matches Clang's output.
Cache the term::Terminal instead of re-parsing for every diagnostic (fixes#6827).
Clang actually highlights using bold, not using bright white. Match
clang on this so our diagnostics are still readable on terminals with a
white background.
Implement size_hint for the ringbuf iterators.
Do small cleanups in dlist, use Option's .map and .map_mut properly, and put inline on all the small methods.
This changes the interface to `get`, and it also changes the keys to be static slices instead of static functions.
This allows the removal of the `unsafe` interface because while functions can monomorphize from different types to the same actual function, static slices cannot do this.
From at least what I can tell, we don't need to worry about LLVM coalescing these addresses. If we ever use the `unnamed_addr` it looks like there's cause for worry, but there doesn't appear to be any coalescing atm.
If the TLS key is 0-sized, then the linux linker is apparently smart enough to
put everything at the same pointer. OSX on the other hand, will reserve some
space for all of them. To get around this, the TLS key now actuall consumes
space to ensure that it gets a unique pointer