about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2018-12-15Rollup merge of #56746 - ↵Pietro Albini-0/+74
pnkfelix:issue-56537-add-test-of-closure-using-region-from-containing-fn, r=nikomatsakis Add test of current behavior (infer free region within closure body) This behavior was previously not encoded in our test suite. it is pretty important that we test this behavior. In particular, in #56537 I had proposed expanding the lifetime elision rules so that they would apply to some of the cases encoded in this test, which would cause them to start failing to compile successfully (because the lifetime attached to the return type would start being treated as connected to the lifetime on the input parameter to the lambda expression, which is explicitly *not* what the code wants in this particular case). In other words, I am trying to ensure that anyone who tries such experiments with lifetime elision in the future quickly finds out why we don't support lifetime elision on lambda expressions (at least not in the naive manner described on #56537).
2018-12-15Rollup merge of #56738 - turboladen:fix-private_no_mangle_fns-message, ↵Pietro Albini-2/+2
r=zackmdavis Fix private_no_mangle_fns message grammar Simply changes "an warning" to "a warning" in the `private_no_mangle_fns` warning. I started getting this in some code after upgrading to 1.31.0.
2018-12-15Auto merge of #56584 - davidtwco:issue-53990, r=nikomatsakisbors-2/+10
2018 edition - confusing error message when declaring unnamed parameters Fixes #53990. This PR adds a note providing context for the change to argument names being required in the 2018 edition for trait methods and a suggestion for the fix.
2018-12-15Auto merge of #56540 - oli-obk:less_const_hackery, r=varkorbors-12/+159
Don't depend on `Allocation` sizes for pattern length And generally be more explicit about shortcomings of the implementation cc @RalfJung
2018-12-14Call poly_project_and_unify_type on types that contain inference typesAaron Hill-0/+34
Commit f57247c48cb59 (Ensure that Rusdoc discovers all necessary auto trait bounds) added a check to ensure that we only attempt to unify a projection predicatre with inference variables. However, the check it added was too strict - instead of checking that a type *contains* an inference variable (e.g. '&_', 'MyType<_>'), it required the type to *be* an inference variable (i.e. only '_' would match). This commit relaxes the check to use 'ty.has_infer_types', ensuring that we perform unification wherever possible. Fixes #56822
2018-12-15Improve `match` MIR generation for rangesShotaro Yamada-0/+83
Makes testing a range rule out ranges/constant covered by the range that is being tested
2018-12-14Auto merge of #56572 - kevgrasso:let_self_err_dev, r=estebankbors-1/+8
Contexually dependent error message for E0424 when value is assigned to "self" This is an improvement for pull request #54495 referencing issue #54369. If the "self" keyword is assigned a value as though it were a valid identifier, it will now report: ``` let self = "self"; ^^^^ `self` value is a keyword and may not be bound to variables or shadowed ``` instead of ``` let self = "self"; ^^^^ `self` value is a keyword only available in methods with `self` parameter ``` If anyone has a better idea for what the error should be I'd be happy to modify it appropriately.
2018-12-14rustc: Add an unstable `simd_select_bitmask` intrinsicAlex Crichton-4/+22
This is going to be required for binding a number of AVX-512 intrinsics in the `stdsimd` repository, and this intrinsic is the same as `simd_select` except that it takes a bitmask as the first argument instead of a SIMD vector. This bitmask is then transmuted into a `<NN x i8>` argument, depending on how many bits it is. cc rust-lang-nursery/stdsimd#310
2018-12-14use tracking issue instead of original issueAriel Ben-Yehuda-3/+3
2018-12-14add coherence future-compat warnings for marker-only trait objectsAriel Ben-Yehuda-0/+167
The future-compat warnings break code that assumes that `dyn Send + Sync != dyn Sync + Send`, and are the first step in making them equal. cc #33140. It should be possible to revert this commit when we're done with the warnings.
2018-12-14process nested obligations in autoderefAriel Ben-Yehuda-0/+34
This is a hack-fix to #53843, but I am worried it might break things because it makes the "inference pollution" problem worse. Fixes #53843 (but introduces a bug that someone might notice).
2018-12-14simplify deprecation and stability renderingAndy Russell-10/+30
2018-12-14Auto merge of #56818 - kennytm:rollup-2, r=kennytmbors-9/+105
Rollup of 14 pull requests (first batch) Successful merges: - #56562 (Update libc version required by rustc) - #56609 (Unconditionally emit the target-cpu LLVM attribute.) - #56637 (rustdoc: Fix local reexports of proc macros) - #56658 (Add non-panicking `maybe_new_parser_from_file` variant) - #56695 (Fix irrefutable matches on integer ranges) - #56699 (Use a `newtype_index!` within `Symbol`.) - #56702 ([self-profiler] Add column for percent of total time) - #56708 (Remove some unnecessary feature gates) - #56709 (Remove unneeded extra chars to reduce search-index size) - #56744 (specialize: remove Boxes used by Children::insert) - #56748 (Update panic message to be clearer about env-vars) - #56749 (x86: Add the `adx` target feature to whitelist) - #56756 (Disable btree pretty-printers on older gdbs) - #56789 (rustc: Add an unstable `simd_select_bitmask` intrinsic) r? @ghost
2018-12-14add test for parsing comments in doctest headersQuietMisdreavus-0/+30
2018-12-14Rollup merge of #56789 - alexcrichton:simd_select_bitmask, r=rkruppekennytm-4/+74
rustc: Add an unstable `simd_select_bitmask` intrinsic This is going to be required for binding a number of AVX-512 intrinsics in the `stdsimd` repository, and this intrinsic is the same as `simd_select` except that it takes a bitmask as the first argument instead of a SIMD vector. This bitmask is then transmuted into a `<NN x i8>` argument, depending on how many bits it is. cc rust-lang-nursery/stdsimd#310
2018-12-14Rollup merge of #56756 - tromey:Bug-56730-btree-pretty-printer, r=alexcrichtonkennytm-1/+5
Disable btree pretty-printers on older gdbs gdb versions before 8.1 have a bug that prevents the BTreeSet and BTreeMap pretty-printers from working. This patch disables the test on those versions, and also disables the pretty-printers there as well. Closes #56730
2018-12-14Rollup merge of #56748 - kinnison:kinnison/fix-56734, r=dtolnaykennytm-4/+5
Update panic message to be clearer about env-vars Esteban Kuber requested that the panic message make it clear that `RUST_BACKTRACE=1` is an environment variable. This change makes that clear. I understand that this may simply be closed if the concept isn't accepted, and I'd be fine with that :-) Fixes #56734
2018-12-14Rollup merge of #56695 - varkor:let-exhaustive-range, r=estebankkennytm-0/+8
Fix irrefutable matches on integer ranges Fixes https://github.com/rust-lang/rust/issues/56659.
2018-12-14Rollup merge of #56637 - ollie27:rustdoc_proc_macro_local_reexport, ↵kennytm-0/+13
r=QuietMisdreavus rustdoc: Fix local reexports of proc macros Filter out `ProcMacroStub`s to avoid an ICE during cleaning. Also add proc macros to `cache().paths` so it can generate links. r? @QuietMisdreavus
2018-12-14Auto merge of #56568 - notriddle:master, r=alexcrichtonbors-1/+1
Remove dependency on shell32.dll Closes #56510 if it works on MinGW (I've only tested it on MSVC).
2018-12-14fix issue 54153 by ignoring issue-18804 test on windows/mac.Felix S. Klock II-0/+5
As a drive-by, add `-C no-prepopulate-passes` as suggested by nikic.
2018-12-13debug logging, added conditional error message, tests updatedKevyn Grasso-1/+8
2018-12-14Auto merge of #56351 - davidtwco:issue-55396-stabilize-linker-flavor, r=nagisabors-30/+2
Stabilize `linker-flavor` flag. Part of #55396. This commit moves the linker-flavor flag from a debugging option to a codegen option, thus stabilizing it. There are no feature flags associated with this flag. r? @nagisa
2018-12-13Update panic message to be clearer about env-varsDaniel Silverstone-4/+5
Esteban Kuber requested that the panic message make it clear that `RUST_BACKTRACE=1` is an environment variable. This change makes that clear. Wording provided in part by David Tolnay.
2018-12-13rustc: Add an unstable `simd_select_bitmask` intrinsicAlex Crichton-4/+74
This is going to be required for binding a number of AVX-512 intrinsics in the `stdsimd` repository, and this intrinsic is the same as `simd_select` except that it takes a bitmask as the first argument instead of a SIMD vector. This bitmask is then transmuted into a `<NN x i8>` argument, depending on how many bits it is. cc rust-lang-nursery/stdsimd#310
2018-12-13Make determining the discriminant a normal Shallow readMatthew Jasper-7/+60
Enum layout optimizations mean that the discriminant of an enum may not be stored in a tag disjoint from the rest of the fields of the enum. Stop borrow checking as though they are.
2018-12-13Wording changesEsteban Küber-2/+2
2018-12-13Add targets thumbv7neon-linux-androideabi and ↵Henri Sivonen-0/+2
thumbv7neon-unknown-linux-gnueabihf These two targets enable both thumb-mode and NEON for ARMv7 CPUs.
2018-12-13Update tests to show diagnosticsOliver Scherer-20/+129
2018-12-13Stabilize `linker-flavor` flag.David Wood-30/+2
This commit moves the linker-flavor flag from a debugging option to a codegen option, thus stabilizing it. There are no feature flags associated with this flag.
2018-12-13Make SimplifyCfg collapse goto chains from bb0Shotaro Yamada-0/+54
2018-12-12Suggest using `.display()` when trying to print a `Path`Esteban Küber-0/+21
2018-12-12Deduplicate unsatisfied trait boundsEsteban Küber-2/+25
2018-12-12Disable btree pretty-printers on older gdbsTom Tromey-1/+5
gdb versions before 8.1 have a bug that prevents the BTreeSet and BTreeMap pretty-printers from working. This patch disables the test on those versions, and also disables the pretty-printers there as well. Closes #56730
2018-12-12Account for `impl Trait` when suggesting lifetimeEsteban Küber-0/+55
2018-12-12rustc: Switch `extern` functions to abort by default on panicAlex Crichton-3/+17
This was intended to land way back in 1.24, but it was backed out due to breakage which has long since been fixed. An unstable `#[unwind]` attribute can be used to tweak the behavior here, but this is currently simply switching rustc's internal default to abort-by-default if an `extern` function panics, making our codegen sound primarily (as currently you can produce UB with safe code) Closes #52652
2018-12-12Add test of current behavior (infer free region within closure body) ↵Felix S. Klock II-0/+74
previously not in test suite.
2018-12-12Auto merge of #56092 - alexcrichton:no-more-std-subodules, r=Mark-Simulacrumbors-60/+56
std: Depend directly on crates.io crates Ever since we added a Cargo-based build system for the compiler the standard library has always been a little special, it's never been able to depend on crates.io crates for runtime dependencies. This has been a result of various limitations, namely that Cargo doesn't understand that crates from crates.io depend on libcore, so Cargo tries to build crates before libcore is finished. I had an idea this afternoon, however, which lifts the strategy from #52919 to directly depend on crates.io crates from the standard library. After all is said and done this removes a whopping three submodules that we need to manage! The basic idea here is that for any crate `std` depends on it adds an *optional* dependency on an empty crate on crates.io, in this case named `rustc-std-workspace-core`. This crate is overridden via `[patch]` in this repository to point to a local crate we write, and *that* has a `path` dependency on libcore. Note that all `no_std` crates also depend on `compiler_builtins`, but if we're not using submodules we can publish `compiler_builtins` to crates.io and all crates can depend on it anyway! The basic strategy then looks like: * The standard library (or some transitive dep) decides to depend on a crate `foo`. * The standard library adds ```toml [dependencies] foo = { version = "0.1", features = ['rustc-dep-of-std'] } ``` * The crate `foo` has an optional dependency on `rustc-std-workspace-core` * The crate `foo` has an optional dependency on `compiler_builtins` * The crate `foo` has a feature `rustc-dep-of-std` which activates these crates and any other necessary infrastructure in the crate. A sample commit for `dlmalloc` [turns out to be quite simple][commit]. After that all `no_std` crates should largely build "as is" and still be publishable on crates.io! Notably they should be able to continue to use stable Rust if necessary, since the `rename-dependency` feature of Cargo is soon stabilizing. As a proof of concept, this commit removes the `dlmalloc`, `libcompiler_builtins`, and `libc` submodules from this repository. Long thorns in our side these are now gone for good and we can directly depend on crates.io! It's hoped that in the long term we can bring in other crates as necessary, but for now this is largely intended to simply make it easier to manage these crates and remove submodules. This should be a transparent non-breaking change for all users, but one possible stickler is that this almost for sure breaks out-of-tree `std`-building tools like `xargo` and `cargo-xbuild`. I think it should be relatively easy to get them working, however, as all that's needed is an entry in the `[patch]` section used to build the standard library. Hopefully we can work with these tools to solve this problem! [commit]: https://github.com/alexcrichton/dlmalloc-rs/commit/28ee12db813a3b650a7c25d1c36d2c17dcb88ae3
2018-12-12Auto merge of #56010 - euclio:intra-doc-spans, r=QuietMisdreavusbors-24/+163
fix intra-link resolution spans in block comments This commit improves the calculation of code spans for intra-doc resolution failures. All sugared doc comments should now have the correct spans, including those where the comment is longer than the docs. It also fixes an issue where the spans were calculated incorrectly for certain unsugared doc comments. The diagnostic will now always use the span of the attributes, as originally intended. Fixes #55964. r? @QuietMisdreavus
2018-12-11Fix private_no_mangle_fns message grammarSteve Loveless-2/+2
2018-12-11std: Depend directly on crates.io cratesAlex Crichton-60/+56
Ever since we added a Cargo-based build system for the compiler the standard library has always been a little special, it's never been able to depend on crates.io crates for runtime dependencies. This has been a result of various limitations, namely that Cargo doesn't understand that crates from crates.io depend on libcore, so Cargo tries to build crates before libcore is finished. I had an idea this afternoon, however, which lifts the strategy from #52919 to directly depend on crates.io crates from the standard library. After all is said and done this removes a whopping three submodules that we need to manage! The basic idea here is that for any crate `std` depends on it adds an *optional* dependency on an empty crate on crates.io, in this case named `rustc-std-workspace-core`. This crate is overridden via `[patch]` in this repository to point to a local crate we write, and *that* has a `path` dependency on libcore. Note that all `no_std` crates also depend on `compiler_builtins`, but if we're not using submodules we can publish `compiler_builtins` to crates.io and all crates can depend on it anyway! The basic strategy then looks like: * The standard library (or some transitive dep) decides to depend on a crate `foo`. * The standard library adds ```toml [dependencies] foo = { version = "0.1", features = ['rustc-dep-of-std'] } ``` * The crate `foo` has an optional dependency on `rustc-std-workspace-core` * The crate `foo` has an optional dependency on `compiler_builtins` * The crate `foo` has a feature `rustc-dep-of-std` which activates these crates and any other necessary infrastructure in the crate. A sample commit for `dlmalloc` [turns out to be quite simple][commit]. After that all `no_std` crates should largely build "as is" and still be publishable on crates.io! Notably they should be able to continue to use stable Rust if necessary, since the `rename-dependency` feature of Cargo is soon stabilizing. As a proof of concept, this commit removes the `dlmalloc`, `libcompiler_builtins`, and `libc` submodules from this repository. Long thorns in our side these are now gone for good and we can directly depend on crates.io! It's hoped that in the long term we can bring in other crates as necessary, but for now this is largely intended to simply make it easier to manage these crates and remove submodules. This should be a transparent non-breaking change for all users, but one possible stickler is that this almost for sure breaks out-of-tree `std`-building tools like `xargo` and `cargo-xbuild`. I think it should be relatively easy to get them working, however, as all that's needed is an entry in the `[patch]` section used to build the standard library. Hopefully we can work with these tools to solve this problem! [commit]: https://github.com/alexcrichton/dlmalloc-rs/commit/28ee12db813a3b650a7c25d1c36d2c17dcb88ae3
2018-12-11Auto merge of #53497 - fukatani:test-debuginfo-function-call, r=tromeybors-0/+52
Test with gdb8.2 and add debuginfo printing function call test As far as I can see, `print function()` is not tested. It is important feature for debugging.
2018-12-11Auto merge of #56243 - RalfJung:test-deterministic, r=alexcrichtonbors-1/+1
libtest: Use deterministic HashMap, avoid spawning thread if there is no concurrency It seems desirable to make a test and bench runner deterministic, which this achieves by using a deterministic hasher. Also, we we only have 1 thread, we don't bother spawning one and just use the main thread. The motivation for this is to be able to run the test harness in miri, where we can neither access the OS RNG, nor spawn threads.
2018-12-11Add function call test, Update gdb and test docker image install gdb by ppa.Unknown-0/+52
2018-12-11Update testsvarkor-3/+3
2018-12-11Add a mir-opt testvarkor-0/+37
2018-12-11Restore old match behaviourvarkor-3/+27
2018-12-11Fix some misbehaving testsvarkor-3/+5
2018-12-11Make liveness analysis respect privacyvarkor-2/+3
2018-12-11Add privately uninhabited dead code testvarkor-0/+19