about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2018-03-25Test that pgo-gen works properly.Emilio Cobos Álvarez-0/+19
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2018-03-25Rollup merge of #49299 - SimonSapin:ubiquity, r=nikomatsakiskennytm-98/+8
Stabilize the copy_closures and clone_closures features In addition to the `Fn*` family of traits, closures now implement `Copy` (and similarly `Clone`) if all of the captures do. Tracking issue: https://github.com/rust-lang/rust/issues/44490
2018-03-25Rollup merge of #49268 - ordovicia:dotdot-pattern-diag, r=petrochenkovkennytm-0/+37
Better diagnostics for '..' pattern fragment not in the last position Fixes #49257.
2018-03-25Rollup merge of #49194 - Zoxc:unsafe-generator, r=cramertjkennytm-94/+70
Make resuming generators unsafe instead of the creation of immovable generators cc @withoutboats Fixes #47787
2018-03-25Rollup merge of #49162 - tmandry:stabilize-termination-trait, r=nikomatsakiskennytm-19/+40
Stabilize termination_trait, split out termination_trait_test For #48453. First time contribution, so I'd really appreciate any feedback on how this PR can be better. Not sure exactly what kind of documentation update is needed. If there is no PR to update the reference, I can try doing that this week as I have time.
2018-03-25Rollup merge of #49046 - Zoxc:error-summary, r=michaelwoeristerkennytm-15/+68
Always print `aborting due to n previous error(s)` r? @michaelwoerister
2018-03-24Auto merge of #49251 - nikomatsakis:issue-15872-elision-impl-header, r=cramertjbors-0/+399
support elision in impl headers You can now do things like: ``` impl MyTrait<'_> for &u32 { ... } ``` Each `'_` or elided lifetime is a fresh parameter. `'_` and elision are still not permitted in associated type values. (Plausibly we could support that if there is a single input lifetime.) The original lifetime elision RFC was a bit unclear on this point: [as documented here, I think this is the correct interpretation, both because it fits existing impls and it's most analogous to the behavior in fns](https://github.com/rust-lang/rust/issues/15872#issuecomment-338700138). We do not support elision with deprecated forms: ``` impl MyTrait for std::cell::Ref<u32> { } // ERROR ``` Builds on the in-band lifetime stuff. r? @cramertj Fixes #15872
2018-03-24Auto merge of #48552 - kennytm:lower-unstable-priority, r=nikomatsakisbors-9/+157
Lower the priority of unstable methods when picking a candidate. Previously, when searching for the impl of a method, we do not consider the stability of the impl. This leads to lots of insta-inference-regressions due to method ambiguity when a popular name is chosen. This has happened multiple times in Rust's history e.g. * `f64::from_bits` #40470 * `Ord::{min, max}` #42496 * `Ord::clamp` #44095 (eventually got reverted due to these breakages) * `Iterator::flatten` #48115 (recently added) This PR changes the probing order so that unstable items are considered last. If a stable item is found, the unstable items will not be considered (but a future-incompatible warning will still be emitted), thus allowing stable code continue to function without using qualified names. Once the unstable feature is stabilized, the ambiguity error will still be emitted, but the user can also use newly stable std methods, while the current situation is that downstream user is forced to update the code without any immediate benefit. (I hope that we could bring back `Ord::clamp` if this PR is merged.)
2018-03-24Auto merge of #48482 - davidtwco:issue-47184, r=nikomatsakisbors-3/+37
NLL should identify and respect the lifetime annotations that the user wrote Part of #47184. r? @nikomatsakis
2018-03-24Fix test for PR #49268Hidehito Yabuuchi-11/+4
2018-03-24Filed a proper tracking issue.kennytm-1/+1
2018-03-24Specialize future-incompatibility warning for UNSTABLE_NAME_COLLISION.kennytm-4/+4
2018-03-24When picking a candidate, consider the unstable ones last.kennytm-0/+154
If there is potential ambiguity after stabilizing those candidates, a warning will be emitted.
2018-03-24Provide a proper span when demanding for the return type of `box x`.kennytm-9/+3
2018-03-24Fix error annotations in testHidehito Yabuuchi-2/+2
2018-03-24Better diagnostics for '..' pattern fragment not in the last positionHidehito Yabuuchi-0/+44
2018-03-23Test fixesAlex Crichton-0/+8
2018-03-23Merge branch '49001_epoch' of https://github.com/klnusbaum/rust into rollupAlex Crichton-7/+7
2018-03-23Merge branch 'master' of https://github.com/Lymia/rust into rollupAlex Crichton-2/+269
2018-03-23Rollup merge of #49295 - csmoe:nll_test_48238, r=alexcrichtonAlex Crichton-0/+30
Add test for issue-48238 Fixes #48238 test case made from comments in #48238
2018-03-23Rollup merge of #49262 - oli-obk:fixed_size_array_len, r=estebankAlex Crichton-1/+41
Produce nice array lengths on a best effort basis fixes #49208 r? @estebank
2018-03-23Rollup merge of #49169 - sanxiyn:doc-only, r=aturonAlex Crichton-0/+2
Document only-X test header This was added in #47487 without documentation.
2018-03-23Rollup merge of #49160 - estebank:issue-47457-missing-fields, r=oli-obkAlex Crichton-9/+44
Reduce the diagnostic spam when multiple fields are missing in pattern Fix #47457.
2018-03-23Rollup merge of #49030 - Zoxc:misc, r=michaelwoeristerAlex Crichton-2/+1
Misc changes from my parallel rustc branch r? @michaelwoerister
2018-03-23Rollup merge of #48909 - RalfJung:type_alias_bounds, r=petrochenkovAlex Crichton-65/+164
Improve lint for type alias bounds First of all, I learned just today that I was wrong assuming that the bounds in type aliases are entirely ignored: It turns out they are used to resolve associated types in type aliases. So: ```rust type T1<U: Bound> = U::Assoc; // compiles type T2<U> = U::Assoc; // fails type T3<U> = <U as Bound>::Assoc; // "correct" way to write this, maybe? ``` I am sorry for creating this mess. This PR changes the wording of the lint accordingly. Moreover, since just removing the bound is no longer always a possible fix, I tried to detect cases like `T1` above and show a helpful message to the user: ``` warning: bounds on generic parameters are not enforced in type aliases --> $DIR/type-alias-bounds.rs:57:12 | LL | type T1<U: Bound> = U::Assoc; //~ WARN not enforced in type aliases | ^^^^^ | = help: the bound will not be checked when the type alias is used, and should be removed help: use absolute paths (i.e., <T as Trait>::Assoc) to refer to associated types in type aliases --> $DIR/type-alias-bounds.rs:57:21 | LL | type T1<U: Bound> = U::Assoc; //~ WARN not enforced in type aliases | ^^^^^^^^ ``` I am not sure if I got this entirely right. Ideally, we could provide a suggestion involving the correct trait and type name -- however, while I have access to the HIR in the lint, I do not know how to get access to the resolved name information, like which trait `Assoc` belongs to above. The lint does not even run if that resolution fails, so I assume that information is available *somewhere*... This is a follow-up for (parts of) https://github.com/rust-lang/rust/pull/48326. Also see https://github.com/rust-lang/rust/issues/21903. This changes the name of a lint, but that lint was just merged to master yesterday and has never even been on beta.
2018-03-23Rollup merge of #48883 - alexcrichton:wasm-custom-sections, r=nikomatsakisAlex Crichton-0/+411
rustc: Add a `#[wasm_custom_section]` attribute This commit is an implementation of adding custom sections to wasm artifacts in rustc. The intention here is to expose the ability of the wasm binary format to contain custom sections with arbitrary user-defined data. Currently neither our version of LLVM nor LLD supports this so the implementation is currently custom to rustc itself. The implementation here is to attach a `#[wasm_custom_section = "foo"]` attribute to any `const` which has a type like `[u8; N]`. Other types of constants aren't supported yet but may be added one day! This should hopefully be enough to get off the ground with *some* custom section support. The current semantics are that any constant tagged with `#[wasm_custom_section]` section will be *appended* to the corresponding section in the final output wasm artifact (and this affects dependencies linked in as well, not just the final crate). This means that whatever is interpreting the contents must be able to interpret binary-concatenated sections (or each constant needs to be in its own custom section). To test this change the existing `run-make` test suite was moved to a `run-make-fulldeps` folder and a new `run-make` test suite was added which applies to all targets by default. This test suite currently only has one test which only runs for the wasm target (using a node.js script to use `WebAssembly` in JS to parse the wasm output).
2018-03-23Rollup merge of #48624 - bdrewery:freebsd-posix-spawn, r=alexcrichtonAlex Crichton-0/+23
Command: Support posix_spawn() on FreeBSD/OSX/GNU Linux
2018-03-23Rollup merge of #48265 - SimonSapin:nonzero, r=KodrAusAlex Crichton-30/+22
Add 12 num::NonZero* types for primitive integers, deprecate core::nonzero RFC: https://github.com/rust-lang/rfcs/pull/2307 Tracking issue: ~~https://github.com/rust-lang/rust/issues/27730~~ https://github.com/rust-lang/rust/issues/49137 Fixes https://github.com/rust-lang/rust/issues/27730
2018-03-23Fixed issues with incremental tests.David Wood-1/+1
2018-03-23Updated MIR with UserAssertTy in mir-opt tests.David Wood-2/+5
2018-03-23Stabilize the copy_closures and clone_closures featuresSimon Sapin-98/+8
In addition to the `Fn*` family of traits, closures now implement `Copy` (and similarly `Clone`) if all of the captures do.
2018-03-23add test for issue-48238csmoe-0/+30
2018-03-22Added flag to disable user type assertion.David Wood-0/+1
2018-03-22Updated test with expected error message.David Wood-2/+16
2018-03-22Added initial test for #47184David Wood-0/+16
2018-03-22permit `'_` and `&T` in impl headersNiko Matsakis-0/+357
Deprecated forms of elision are not supported.
2018-03-22add new test for `dyn<Trait + '_>` used in a structNiko Matsakis-0/+42
`'_` is illegal in structs; this currently gets a duplicate error
2018-03-22rustc: Add a `#[wasm_import_module]` attributeAlex Crichton-2/+147
This commit adds a new attribute to the Rust compiler specific to the wasm target (and no other targets). The `#[wasm_import_module]` attribute is used to specify the module that a name is imported from, and is used like so: #[wasm_import_module = "./foo.js"] extern { fn some_js_function(); } Here the import of the symbol `some_js_function` is tagged with the `./foo.js` module in the wasm output file. Wasm-the-format includes two fields on all imports, a module and a field. The field is the symbol name (`some_js_function` above) and the module has historically unconditionally been `"env"`. I'm not sure if this `"env"` convention has asm.js or LLVM roots, but regardless we'd like the ability to configure it! The proposed ES module integration with wasm (aka a wasm module is "just another ES module") requires that the import module of wasm imports is interpreted as an ES module import, meaning that you'll need to encode paths, NPM packages, etc. As a result, we'll need this to be something other than `"env"`! Unfortunately neither our version of LLVM nor LLD supports custom import modules (aka anything not `"env"`). My hope is that by the time LLVM 7 is released both will have support, but in the meantime this commit adds some primitive encoding/decoding of wasm files to the compiler. This way rustc postprocesses the wasm module that LLVM emits to ensure it's got all the imports we'd like to have in it. Eventually I'd ideally like to unconditionally require this attribute to be placed on all `extern { ... }` blocks. For now though it seemed prudent to add it as an unstable attribute, so for now it's not required (as that'd force usage of a feature gate). Hopefully it doesn't take too long to "stabilize" this! cc rust-lang-nursery/rust-wasm#29
2018-03-22rustc: Add a `#[wasm_custom_section]` attributeAlex Crichton-0/+266
This commit is an implementation of adding custom sections to wasm artifacts in rustc. The intention here is to expose the ability of the wasm binary format to contain custom sections with arbitrary user-defined data. Currently neither our version of LLVM nor LLD supports this so the implementation is currently custom to rustc itself. The implementation here is to attach a `#[wasm_custom_section = "foo"]` attribute to any `const` which has a type like `[u8; N]`. Other types of constants aren't supported yet but may be added one day! This should hopefully be enough to get off the ground with *some* custom section support. The current semantics are that any constant tagged with `#[wasm_custom_section]` section will be *appended* to the corresponding section in the final output wasm artifact (and this affects dependencies linked in as well, not just the final crate). This means that whatever is interpreting the contents must be able to interpret binary-concatenated sections (or each constant needs to be in its own custom section). To test this change the existing `run-make` test suite was moved to a `run-make-fulldeps` folder and a new `run-make` test suite was added which applies to all targets by default. This test suite currently only has one test which only runs for the wasm target (using a node.js script to use `WebAssembly` in JS to parse the wasm output).
2018-03-22Auto merge of #49210 - oli-obk:pango_crash, r=eddybbors-0/+27
Fix the conversion between bit representations and i128 representations fixes #49181 the `Discr` type now encodes the bit representation instead of `i128` or `u128` casted to `u128`. r? @eddyb
2018-03-22Rollup merge of #49244 - varkor:type_dependent_defs_ExprMethodCall, r=estebankkennytm-0/+33
Fix type_dependent_defs ICE on method calls Fixes #49241.
2018-03-22Rollup merge of #49211 - varkor:chalk-lowering-Implemented-From-Env, ↵kennytm-0/+30
r=nikomatsakis Implement Chalk lowering rule "Implemented-From-Env" This extends the Chalk lowering pass with the "Implemented-From-Env" rule for generating program clauses from a trait definition as part of #49177. r? @nikomatsakis
2018-03-22Rollup merge of #49189 - GuillaumeGomez:fix-implied-shortcut-links, ↵kennytm-0/+18
r=QuietMisdreavus Fix automatic urls with backticks Fixes #49164. r? @QuietMisdreavus
2018-03-22Rollup merge of #49158 - varkor:compiletest-triples, r=rkruppekennytm-0/+10
Make compiletest do exact matching on triples This avoids the issues of the previous substring matching, ensuring `ARCH_TABLE` and `OS_TABLE` will no longer contain redundant entries. Fixes #48893. r? @rkruppe
2018-03-22Rollup merge of #49140 - semarie:rustdoc-test-path, r=alexcrichtonkennytm-1/+1
Allow test target to pass without installing explicitly pass -L target-lib to rustdoc on OpenBSD, without it, it fails on several tests with: ``` error[E0463]: can't find crate for `std` ```
2018-03-22Rollup merge of #49117 - nivkner:fixme_fixup3, r=estebankkennytm-2/+1
address some FIXME whose associated issues were marked as closed part of #44366
2018-03-22Rollup merge of #49109 - SimonSapin:deprecate-asciiext, r=alexcrichtonkennytm-2/+0
Deprecate the AsciiExt trait in favor of inherent methods The trait and some of its methods are stable and will remain. Some of the newer methods are unstable and can be removed later. Fixes https://github.com/rust-lang/rust/issues/39658
2018-03-22Fix the conversion between bit representations and i128 representationsOliver Schneider-0/+27
2018-03-22Rollup merge of #48759 - QuietMisdreavus:simd-feature-docs, r=GuillaumeGomezkennytm-0/+24
rustdoc: expose #[target_feature] attributes as doc(cfg) flags This change exposes `#[target_feature(enable = "feat")]` attributes on an item as if they were also `#[doc(cfg(target_feature = "feat"))]` attributes. This gives them a banner on their documentation listing which feature is required to use the item. It also modifies the rendering code for doc(cfg) tags to handle `target_feature` tags. I made it print just the feature name on "short" printings (as in the function listing on a module page), and use "target feature `feat`" in the full banner on the item page itself. This way, the function listing in `std::arch` shows which feature is required for each function: ![image](https://user-images.githubusercontent.com/5217170/37003222-f41b9d66-2091-11e8-9656-8719e5b34832.png) ![image](https://user-images.githubusercontent.com/5217170/37003234-feb1a7a2-2091-11e8-94de-6d1d76a2d3ee.png)
2018-03-22Produce nice array lengths on a best effort basisOliver Schneider-1/+41