about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2018-04-20Speed up `nearest_common_ancestor()`.Nicholas Nethercote-80/+60
`nearest_common_ancestor()` uses an algorithm that requires computing the full scope chain for both scopes, which is expensive because each element involves a hash table lookup, and then looking for a common tail. This patch changes `nearest_common_ancestor()` to use a different algorithm, which starts at the given scopes and works outwards (i.e. up the scope tree) until a common ancestor is found. This is much faster because in most cases the common ancestor is found well before the end of the scope chains. Also, the use of a SmallVec avoids the need for any allocation most of the time.
2018-04-20Fix a copy-and-paste bug in nearest_common_ancestor.Nicholas Nethercote-1/+1
This code path is rarely hit, which likely explains why this bug hasn't been detected before now. (I only noticed it via code inspection.)
2018-04-18Auto merge of #49972 - Mark-Simulacrum:remove-build, r=alexcrichtonbors-939/+873
Remove uses of Build across Builder steps This is purely a code cleanup; there should be no functional changes. r? @alexcrichton
2018-04-18Auto merge of #49969 - mark-i-m:allocator_fmt, r=estebankbors-648/+743
Various rustfmt and commenting changes These are factored out of #49320 There aren't actually any changes in functionality, just rustfmt and doccomments.
2018-04-17Remove uses of Build across Builder stepsMark Simulacrum-939/+873
2018-04-18Auto merge of #49950 - Zoxc:default-span, r=estebankbors-171/+138
Improve query cycle error message r? @michaelwoerister
2018-04-17Auto merge of #50036 - nrc:update, r=alexcrichtonbors-29/+29
Update Rustfmt Fixes RLS and Rustfmt and enables a new nightly r? @alexcrichton
2018-04-18Update RustfmtNick Cameron-29/+29
2018-04-17Auto merge of #49904 - michaelwoerister:no-debug-attr, r=alexcrichtonbors-7/+22
Work around LLVM debuginfo problem in librustc_driver. Works around a problem (https://github.com/rust-lang/rust/issues/48910) with global variable debuginfo generation for `rustc_driver::get_trans::LOAD` by applying `#[no_debug]` to it (which just disables debuginfo generation for that variable). This way we can build the compiler with debuginfo again. Since the problem is also present in beta, this workaround might have to be backported. r? @alexcrichton
2018-04-17Auto merge of #50033 - GuillaumeGomez:rollup, r=GuillaumeGomezbors-158/+217
Rollup of 4 pull requests Successful merges: - #49699 (Removed 'proc' from the reserved keywords list) - #49966 (Multiple query search) - #50013 (Remove no longer necessary comparison to Vec::splice.) - #50032 (rustdoc: Don't include private paths in all.html) Failed merges:
2018-04-17Rollup merge of #50032 - ollie27:rustdoc_all_private, r=GuillaumeGomezGuillaume Gomez-1/+11
rustdoc: Don't include private paths in all.html For example the `std` [`all.html`](https://doc.rust-lang.org/nightly/std/all.html) includes references to the `coresimd` module which is a private implementation detail. r? @GuillaumeGomez
2018-04-17Rollup merge of #50013 - frewsxcv:frewsxcv-ssplice, r=GuillaumeGomezGuillaume Gomez-3/+0
Remove no longer necessary comparison to Vec::splice. `String::replace_range` was previously called `String::splice`, so this note was necessary to differentiate it from the `Vec` method. Now that it's renamed, this note no longer seems necessary.
2018-04-17Rollup merge of #49966 - GuillaumeGomez:comma-search, r=QuietMisdreavusGuillaume Gomez-131/+203
Multiple query search Part of #49757. r? @QuietMisdreavus
2018-04-17Rollup merge of #49699 - zesterer:master, r=joshtriplettGuillaume Gomez-33/+13
Removed 'proc' from the reserved keywords list Remove 'proc' from the reserved keywords list. 'proc' is a very useful identifier name for a lot of things. It's especially useful when dealing with processes, operating system internals, and kernel development.
2018-04-17Turn some comments into doccommentsMark Mansi-53/+54
2018-04-17run rustfmt on rustc_driver/driver.rsMark Mansi-526/+610
2018-04-17Run rustfmtMark Mansi-69/+79
2018-04-17Auto merge of #49836 - nikomatsakis:nll-facts-prep, r=pnkfelixbors-1128/+1141
prep work for using timely dataflow with NLL Two major changes: **Two-phase borrows are overhauled.** We no longer have two bits per borrow. Instead, we track -- for each borrow -- an (optional) "activation point". Then, for each point P where the borrow is in scope, we check where P falls relative to the activation point. If P is between the reservation point and the activation point, then this is the "reservation" phase of the borrow, else the borrow is considered active. This is simpler and means that the dataflow doesn't have to care about 2-phase at all, at last not yet. **We no longer support using the MIR borrow checker without NLL.** It is going to be increasingly untenable to support lexical mode as we go forward, I think, and also of increasingly little value. This also exposed a few bugs in NLL mode due to increased testing. r? @pnkfelix cc @bobtwinkles
2018-04-17Clean up attribute handling in create_function_debug_context().Michael Woerister-4/+5
2018-04-17Use #[no_debug] to work around LLVM problem with rustc_driver::get_trans::LOAD.Michael Woerister-0/+4
2018-04-17Support #[no_debug] for global variables.Michael Woerister-3/+10
2018-04-17Add #[no_debug] to trans_fn_attrs() query.Michael Woerister-0/+3
2018-04-17Auto merge of #49626 - fanzier:chalk-lowering, r=scalexmbors-5/+87
Implement Chalk lowering rule Normalize-From-Impl This extends the Chalk lowering pass with the "Normalize-From-Impl" rule for generating program clauses from a trait definition as part of #49177. r? @nikomatsakis
2018-04-17Auto merge of #49542 - GuillaumeGomez:intra-link-resolution-error, ↵bors-58/+224
r=GuillaumeGomez Add warning if a resolution failed r? @QuietMisdreavus
2018-04-17Auto merge of #49882 - Zoxc:sync-misc2, r=michaelwoeristerbors-53/+159
More thread-safety changes r? @michaelwoerister
2018-04-17Auto merge of #49664 - alexcrichton:stable-simd, r=BurntSushibors-165/+242
Stabilize x86/x86_64 SIMD This commit stabilizes the SIMD in Rust for the x86/x86_64 platforms. Notably this commit is stabilizing: * The `std::arch::{x86, x86_64}` modules and the intrinsics contained inside. * The `is_x86_feature_detected!` macro in the standard library * The `#[target_feature(enable = "...")]` attribute * The `#[cfg(target_feature = "...")]` matcher Stabilization of the module and intrinsics were primarily done in rust-lang-nursery/stdsimd#414 and the two attribute stabilizations are done in this commit. The standard library is also tweaked a bit with the new way that stdsimd is integrated. Note that other architectures like `std::arch::arm` are not stabilized as part of this commit, they will likely stabilize in the future after they've been implemented and fleshed out. Similarly the `std::simd` module is also not being stabilized in this commit, only `std::arch`. Finally, nothing related to `__m64` is stabilized in this commit either (MMX), only SSE and up types and intrinsics are stabilized. Closes #29717 Closes #44839 Closes #48556
2018-04-17Auto merge of #50012 - Zoxc:msvc-fix, r=Mark-Simulacrumbors-4/+8
Don't look for cc/cxx when testing with bogus targets This fixes test builds on Windows. r? @Mark-Simulacrum
2018-04-17Remove no longer necessary comparison to Vec::splice.Corey Farwell-3/+0
`String::replace_range` was previously called `String::splice`, so this note was necessary to differentiate it from the `Vec` method. Now that it's renamed, this note no longer seems necessary.
2018-04-17Don't look for cc/cxx when testing with bogus targetsJohn Kåre Alsaker-4/+8
2018-04-16Auto merge of #49488 - alexcrichton:small-wasm-panic, r=sfacklerbors-72/+296
std: Minimize size of panicking on wasm This commit applies a few code size optimizations for the wasm target to the standard library, namely around panics. We notably know that in most configurations it's impossible for us to print anything in wasm32-unknown-unknown so we can skip larger portions of panicking that are otherwise simply informative. This allows us to get quite a nice size reduction. Finally we can also tweak where the allocation happens for the `Box<Any>` that we panic with. By only allocating once unwinding starts we can reduce the size of a panicking wasm module from 44k to 350 bytes.
2018-04-16Remove unwanted auto-linking and updateGuillaume Gomez-13/+14
2018-04-16Fix empty testsGuillaume Gomez-3/+1
2018-04-16Fix nitsGuillaume Gomez-4/+0
2018-04-16Add rustdoc-ui test suiteGuillaume Gomez-34/+85
2018-04-16Add error-format and color-config options to rustdocGuillaume Gomez-12/+89
2018-04-16Add warning if a resolution failedGuillaume Gomez-0/+43
2018-04-16Update testsJohn Kåre Alsaker-133/+83
2018-04-16Improve query cycle error messageJohn Kåre Alsaker-18/+32
2018-04-16Call default_span lazily when query cycles occur instead of in the hot path ↵John Kåre Alsaker-25/+28
for queries
2018-04-16Separately gate each target_feature featureAlex Crichton-70/+218
Use an explicit whitelist for what features are actually stable and can be enabled.
2018-04-17Rollup merge of #49647 - kennytm:duplicated-features, r=aturonkennytm-48/+129
Remove `underscore_lifetimes` and `match_default_bindings` from active feature list These are already stabilized in 1.26.
2018-04-17Rollup merge of #49994 - frewsxcv:frewsxcv-doc-tests, r=QuietMisdreavuskennytm-19/+19
Remove unnecessary indentation in rustdoc book codeblock. None
2018-04-17Rollup merge of #49965 - nikic:fix-49622, r=rkruppekennytm-4/+0
Remove warning about f64->f32 cast being potential UB As discussed in #15536, the LLVM documentation incorrect described overflowing f64->f32 casts as being undefined behavior. LLVM never treated them as such, and the documentation has been adjusted in https://reviews.llvm.org/rL329065. As such, this warning can now be removed. Closes #49622. --- I could not find any existing test checking for this warning. Should I be adding a test for the absence of the warning instead?
2018-04-17Rollup merge of #49959 - cuviper:debuginfo-tools, r=Mark-Simulacrumkennytm-4/+14
rustbuild: allow building tools with debuginfo Debugging information for the extended tools is currently disabled for concerns about the size. This patch adds `--enable-debuginfo-tools` to let one opt into having that debuginfo. This is useful for debugging the tools in distro packages. We always strip debuginfo into separate packages anyway, so the extra size is not a concern in regular use.
2018-04-17Rollup merge of #49931 - csmoe:end_span, r=estebankkennytm-5/+19
Fix incorrect span in `&mut` suggestion Fixes #49859
2018-04-17Remove `underscore_lifetimes` and `match_default_bindings` from active ↵kennytm-8/+0
feature list These are already stabilized in 1.26.
2018-04-17Rollup merge of #49646 - glandium:uninitialized-box, r=alexcrichtonkennytm-1/+1
Use box syntax instead of Box::new in Mutex::remutex on Windows The Box::new(mem::uninitialized()) pattern actually actively copies uninitialized bytes from the stack into the box, which is a waste of time. Using the box syntax instead avoids the useless copy.
2018-04-17Rollup merge of #49606 - varkor:pipe-repair, r=alexcrichtonkennytm-3/+19
Prevent broken pipes causing ICEs As the private `std::io::print_to` panics if there is an I/O error, which is used by `println!`, the compiler would ICE if one attempted to use a broken pipe (e.g. `rustc --help | false`). This introduces a new (private) macro `try_println!` which allows us to avoid this. As a side note, it seems this macro might be useful publicly (and actually there seems to be [a crate specifically for this purpose](https://crates.io/crates/try_print/)), though that can probably be left for a future discussion. One slight alternative approach would be to simply early exit without an error (i.e. exit code `0`), which [this comment](https://github.com/rust-lang/rust/issues/34376#issuecomment-377822526) suggests is the usual approach. I've opted not to take that approach initially, because I think it's more helpful to know when there is a broken pipe. Fixes #34376.
2018-04-17Rollup merge of #49555 - nox:inline-into-boxed, r=alexcrichtonkennytm-1/+9
Inline most of the code paths for conversions with boxed slices This helps with the specific problem described in #49541, obviously without making any large change to how inlining works in the general case. Everything involved in the conversions is made `#[inline]`, except for the `<Vec<T>>::into_boxed_slice` entry point which is made `#[inline(always)]` after checking that duplicating the function mentioned in the issue prevented its inlining if I only annotate it with `#[inline]`. For the record, that function was: ```rust pub fn foo() -> Box<[u8]> { vec![0].into_boxed_slice() } ``` To help the inliner's job, we also hoist a `self.capacity() != self.len` check in `<Vec<T>>::shrink_to_fit` and mark it as `#[inline]` too.
2018-04-16Auto merge of #49130 - smmalis37:range, r=alexcrichtonbors-40/+129
Move Range*::contains to a single default impl on RangeBounds Per the ongoing discussion in #32311. This is my first PR to Rust (woo!), so I don't know if this requires an amendment to the original range_contains RFC, or not, or if we can just do a psuedo-RFC here. While this may no longer follow the explicit decision made in that RFC, I believe this better follows its spirit by adding the new contains method to all Ranges. It also allows users to be generic over all ranges and use this method without writing it themselves (my personal desired use case). This also somewhat answers the unanswered question about Wrapping ranges in the above issue by instead just punting it to the question of what those types should return for start() & end(), or if they should implement RangeArgument at all. Those types could also implement their own contains method without implementing this trait, in which case the question remains the same. This does add a new contains method to types that already implemented RangeArgument but not contains. These types are RangeFull, (Bound<T>, Bound<T>), (Bound<&'a T>, Bound<&'a T>). No tests have been added for these types yet. No inherent method has been added either. r? @alexcrichton