about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2018-04-19Auto merge of #49900 - pnkfelix:compare-mode-nll-followup-3, r=nikomatsakisbors-256/+249
Add src/test/ui regression testing for NLL This PR changes `x.py test` so that when you are running the `ui` test suite, it will also always run `compiletest` in the new `--compare-mode=nll`, which just double-checks that when running under the experimental NLL mode, the output matches the `<source-name>.nll.stderr` file, if present. In order to reduce the chance of a developer revolt in response to this change, this PR also includes some changes to make the `--compare-mode=nll` more user-friendly: 1. It now generates nll-specific .stamp files, and uses them (so that repeated runs can reuse previously cached results). 2. Each line of terminal output distinguishes whether we are running under `--compare-mode=nll` by printing with the prefix `[ui (nll)]` instead of just the prefix `[ui]`. Subtask of rust-lang/rust#48879
2018-04-19Sign extend constants in range patternsOliver Schneider-0/+19
2018-04-18Auto merge of #50017 - tinaun:stabilize-all-the-things, r=sfacklerbors-1/+1
stabilize a bunch of minor api additions besides `ptr::NonNull::cast` (which is 4 days away from end of FCP) all of these have been finished with FCP for a few weeks now with minimal issues raised * Closes #41020 * Closes #42818 * Closes #44030 * Closes #44400 * Closes #46507 * Closes #47653 * Closes #46344 the following functions will be stabilized in 1.27: * `[T]::rsplit` * `[T]::rsplit_mut` * `[T]::swap_with_slice` * `ptr::swap_nonoverlapping` * `NonNull::cast` * `Duration::from_micros` * `Duration::from_nanos` * `Duration::subsec_millis` * `Duration::subsec_micros` * `HashMap::remove_entry`
2018-04-18Auto merge of #50006 - rcoh:reorder-compiler-builtins, r=oli-obkbors-0/+25
Reorder injection of std to get better compilation error Per #49851, reorder injection imports to get a better error message. r? @oli-obk
2018-04-18When running under compare-mode=nll, generate expected output to ↵Felix S. Klock II-0/+6
`foo.nll.stderr` This allows easy revision of the update-references.sh script (included here) so that it can update the expected output for nll rather than stderr. It also reminds the rustc developer via the filename that they are looking at output generated under comapre-mode=nll. One could argue that there is still a problem with the strategy encoded here: if we reach a scenario where a change to the compiler brings the output under AST and NLL modes back into sync, this code will continue to still generate output to distinct `foo.stderr` and `foo.nll.stderr` files, and will continue to copy those two files back to corresponding distinct files in the source tree, even if the *content* of the two files is now the same. * Arguably the "right thing" to do in that case is to remove the `foo.nll.stderr` file entirely. * However, I think the real answer is that we will probably want to double-check such cases by hand anyway. We should be regularly double-checking the diffs between `foo.stderr` and `foo.nll.stderr`, and if we see a zero-diff case, then we should evaluate whether that is correct, and if so, remove the file by hand.) * In any case, I think the default behavior encoded here (or at least *intended* to be encoded here) is superior to the alternative of *only* generating a `foo.nll.stderr` file if one already existed in the source tree at the time that `compiletest` was invoked (and otherwise unconditionally generating a `foo.stderr` file, as was the behavior prior to this commit), because that alternative is more likely to cause rustc developers to overwrite a `foo.stderr` file with the stderr output from a compare-mode=nll run, which will then break the *normal* `compiletest` run and probably be much more confusing for the average rustc developer.
2018-04-18Workaround rust-lang/rust#49998 by opting into experimental `-Z ↵Felix S. Klock II-9/+12
nll-subminimal-causes` flag This commit only applies the flag to the one test case, ui/span/dropck_vec_cycle_checked.rs, that absolutely needs it. Without the flag, that test takes an unknown amount of time (greater than 1 minute) to compile. But its possible that other tests would also benefit from the flag, and we may want to make it the default (after evaluating its impact on other tests). In terms of its known impact on other tests, I have only evaluated the ui tests, and the *only* ui test I have found that the flag impacts (running under NLL mode, of course), is src/test/ui/nll/issue-31567.rs In particular: ``` % ./build/x86_64-unknown-linux-gnu/stage1/bin/rustc ../src/test/ui/nll/issue-31567.rs error[E0597]: `*v.0` does not live long enough --> ../src/test/ui/nll/issue-31567.rs:22:26 | 22 | let s_inner: &'a S = &*v.0; //~ ERROR `*v.0` does not live long enough | ^^^^^ borrowed value does not live long enough 23 | &s_inner.0 24 | } | - borrowed value only lives until here | note: borrowed value must be valid for the lifetime 'a as defined on the function body at 21:1... --> ../src/test/ui/nll/issue-31567.rs:21:1 | 21 | fn get_dangling<'a>(v: VecWrapper<'a>) -> &'a u32 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error For more information about this error, try `rustc --explain E0597`. % ./build/x86_64-unknown-linux-gnu/stage1/bin/rustc ../src/test/ui/nll/issue-31567.rs -Z nll-subminimal-causes error[E0597]: `*v.0` does not live long enough --> ../src/test/ui/nll/issue-31567.rs:22:26 | 22 | let s_inner: &'a S = &*v.0; //~ ERROR `*v.0` does not live long enough | ^^^^^ borrowed value does not live long enough 23 | &s_inner.0 24 | } | - | | | borrowed value only lives until here | borrow later used here, when `v` is dropped error: aborting due to previous error For more information about this error, try `rustc --explain E0597`. % ```
2018-04-18Removed `.nll.stderr` files that currently match their corresponding ↵Felix S. Klock II-140/+0
`.stderr` files.
2018-04-18Trivial updates to `.nll.stderr` files post-rebase, reflecting s/-Znll/nll/ ↵Felix S. Klock II-57/+57
in messages.
2018-04-18Update the previously checkpointed (but unused by bors) tests to reflect ↵Felix S. Klock II-50/+174
current reality.
2018-04-18Auto merge of #49981 - nox:fix-signed-niches, r=eddybbors-0/+20
Properly handle ranges of signed enums using both extremums (fixes #49973) Fixes #49973.
2018-04-18Auto merge of #49950 - Zoxc:default-span, r=estebankbors-133/+83
Improve query cycle error message r? @michaelwoerister
2018-04-17Auto merge of #50033 - GuillaumeGomez:rollup, r=GuillaumeGomezbors-9/+18
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-0/+8
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 #49966 - GuillaumeGomez:comma-search, r=QuietMisdreavusGuillaume Gomez-0/+20
Multiple query search Part of #49757. r? @QuietMisdreavus
2018-04-17Rollup merge of #49699 - zesterer:master, r=joshtriplettGuillaume Gomez-19/+0
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-17Auto merge of #49836 - nikomatsakis:nll-facts-prep, r=pnkfelixbors-331/+430
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-17Auto merge of #49626 - fanzier:chalk-lowering, r=scalexmbors-1/+16
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-1/+24
r=GuillaumeGomez Add warning if a resolution failed r? @QuietMisdreavus
2018-04-17stabilize `nonnull_cast` featuretinaun-1/+1
2018-04-17Auto merge of #49664 - alexcrichton:stable-simd, r=BurntSushibors-83/+46
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-16Auto merge of #49488 - alexcrichton:small-wasm-panic, r=sfacklerbors-0/+46
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-2/+2
2018-04-16Fix nitsGuillaume Gomez-2/+0
2018-04-16Add rustdoc-ui test suiteGuillaume Gomez-0/+25
2018-04-16Update testsJohn Kåre Alsaker-133/+83
2018-04-16Separately gate each target_feature featureAlex Crichton-3/+46
Use an explicit whitelist for what features are actually stable and can be enabled.
2018-04-17Rollup merge of #49931 - csmoe:end_span, r=estebankkennytm-1/+1
Fix incorrect span in `&mut` suggestion Fixes #49859
2018-04-16Reorder injection of std to get better compilation errorRussell Cohen-0/+25
2018-04-16Stabilize x86/x86_64 SIMDAlex Crichton-80/+0
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-16Auto merge of #49956 - QuietMisdreavus:rustdoc-codegen, r=GuillaumeGomezbors-0/+21
rustdoc: port the -C option from rustc Blocked on https://github.com/rust-lang/rust/pull/49864. The included test won't work without those changes, so this PR includes those commits as well. When documenting items that require certain target features, it helps to be able to force those target features into existence. Rather than include a flag just to parse those features, i instead decided to port the `-C` flag from rustc in its entirety. It takes the same parameters, because it runs through the same parsing function. This has the added benefit of being able to control the codegen of doctests as well. One concern i have with the flag is that i set it to stable here. My rationale is that it is a direct port of functionality on rustc that is currently stable, used only in mechanisms that it is originally used for. If needed, i can set it back to be unstable.
2018-04-16Auto merge of #49847 - sinkuu:save_analysis_implicit_extern, r=petrochenkovbors-0/+77
Fix save-analysis generation with extern_in_paths/extern_absolute_paths Fixes #48742.
2018-04-16Auto merge of #49719 - mark-i-m:no_sep, r=petrochenkovbors-89/+50
Update `?` repetition disambiguation. **Do not merge** (yet) This is a test implementation of some ideas from discussion in https://github.com/rust-lang/rust/issues/48075 . This PR - disallows `?` repetition from taking a separator, since the separator is never used. - disallows the use of `?` as a separator. This allows patterns like `$(a)?+` to match `+` and `a+` rather than `a?a?a`. This is a _breaking change_, but maybe that's ok? Perhaps a crater run is the right approach? cc @durka @alexreg @nikomatsakis
2018-04-15Stop duplicating where clauses from impl's.Fabian Zaiser-1/+1
2018-04-15Implement Chalk lowering rule Normalize-From-ImplFabian Zaiser-1/+16
2018-04-15Check generated save-analysis, instead of `bug!()`ingShotaro Yamada-0/+19
Injected crates don't have extern info. Let's skip them.
2018-04-15Auto merge of #49833 - oli-obk:incremental_miri_regression, r=michaelwoeristerbors-0/+19
Don't recurse into allocations, use a global table instead r? @michaelwoerister fixes #49663
2018-04-15Properly handle ranges of signed enums using both extremums (fixes #49973)Anthony Ramine-0/+20
2018-04-15remove -Znll -- borrowck=mir implies nll nowNiko Matsakis-331/+396
2018-04-15determine whether a borrow is active based solely on the locationNiko Matsakis-0/+34
2018-04-15Auto merge of #49885 - spastorino:fn_ref_unsound, r=nikomatsakisbors-0/+40
Fix unsoundness bug in functions input references Fixes #48803 r? @nikomatsakis
2018-04-15Auto merge of #49881 - varkor:partialord-opt, r=Manishearthbors-4/+32
Fix derive(PartialOrd) and optimise final field operation ```rust // Before (`lt` on 2-field struct) self.f1 < other.f1 || (!(other.f1 < self.f1) && (self.f2 < other.f2 || (!(other.f2 < self.f2) && (false) )) ) // After self.f1 < other.f1 || (!(other.f1 < self.f1) && self.f2 < other.f2 ) // Before (`le` on 2-field struct) self.f1 < other.f1 || (!(other.f1 < self.f1) && (self.f2 < other.f2 || (!(other.f2 < self.f2) && (true) )) ) // After self.f1 < other.f1 || (self.f1 == other.f1 && self.f2 <= other.f2 ) ``` (The big diff is mainly because of a past faulty rustfmt application that I corrected 😒) Fixes #49650 and fixes #49505.
2018-04-15Auto merge of #48173 - GuillaumeGomez:error-codes-libsyntax_ext, r=estebankbors-2/+50
Add error codes for libsyntax_ext I intend to add error codes for `libsyntax_ext` as well. However, they cannot be used at stage 0 directly so I thought it might be possible to enable them at the stage 1 only so we can have access to the macros. However, the error code registration seems to not work this way. Currently I get the following error: ``` error: used diagnostic code E0660 not registered --> libsyntax_ext/asm.rs:93:25 | 93 | span_err!(cx, sp, E0660, "malformed inline assembly"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) error: used diagnostic code E0661 not registered --> libsyntax_ext/asm.rs:151:33 | 151 | / span_err!(cx, sp, E0661, 152 | | "output operand constraint lacks '=' or '+'"); | |________________________________________________________________________________________^ | = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) error: aborting due to 2 previous errors error: Could not compile `syntax_ext`. ``` If anyone has an idea, I'd gladly take it. I'm trying to figure this out on my side as well. I also opened this PR to know if it was worth it to continue (maybe we don't want this?). Anyway, any answer for both questions is very welcome! cc @rust-lang/compiler
2018-04-14ignore stage1 testingGuillaume Gomez-3/+10
2018-04-14Add tests and longer error explanationGuillaume Gomez-2/+43
2018-04-14Add multi-query searchGuillaume Gomez-0/+20
2018-04-14Rollup merge of #49864 - QuietMisdreavus:doctest-target-features, ↵kennytm-0/+31
r=GuillaumeGomez add target features when extracting and running doctests When rendering documentation, rustdoc will happily load target features into the cfg environment from the current target, but fails to do this when doing anything with doctests. This would lead to situations where, thanks to https://github.com/rust-lang/rust/pull/48759, functions tagged with `#[target_feature]` couldn't run doctests, thanks to the automatic `#[doc(cfg(target_feature = "..."))]`. Currently, there's no way to pass codegen options to rustdoc that will affect its rustc sessions, but for now this will let you use target features that come default on the platform you're targeting. Fixes https://github.com/rust-lang/rust/issues/49723
2018-04-14Rollup merge of #49958 - glandium:cleanup, r=SimonSapinkennytm-14/+14
Cleanup liballoc use statements Some modules were still using the deprecated `allocator` module, use the `alloc` module instead. Some modules were using `super` while it's not needed. Some modules were more or less ordering them, and other not, so the latter have been modified to match the others.
2018-04-14Don't recurse into allocations, use a global table insteadOliver Schneider-0/+19
2018-04-14Replace remaining uses of deprecated Heap with GlobalMike Hommey-8/+8
2018-04-14Replace remaining uses of deprecated std::heap with std::allocMike Hommey-8/+8