about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2018-07-30Auto merge of #52722 - alexcrichton:more-identifier-lints, r=oli-obkbors-0/+38
Tweak the raw_identifiers lints in 2018 * Enable the `raw_identifiers` feature automatically in the 2018 preview * Only emit lint warnings if the `raw_identifiers` feature is activated cc rust-lang/cargo#5783
2018-07-30Auto merge of #52823 - RalfJung:test, r=eddybbors-2/+21
invalid_const_promotion: check if we get the right signal r? @eddyb
2018-07-29dont hardcode vtable size in codegen testRalf Jung-2/+2
2018-07-29update codegen testsRalf Jung-2/+2
2018-07-29Move a test that depends on the arch bitwidth to compile-failOliver Schneider-43/+0
2018-07-29Sanity-check all constantsOliver Schneider-15/+550
2018-07-29Auto merge of #52620 - mikhail-m1:51351, r=nikomatsakisbors-46/+139
fix simple case of issue #51351 and #52133 r? @nikomatsakis
2018-07-29invalid_const_promotion: check if we get the right signalRalf Jung-2/+21
2018-07-29fix issues #51351 and #52133Mikhail Modin-46/+139
2018-07-28Auto merge of #52355 - pietroalbini:zfeature, r=eddybbors-0/+21
Add the -Zcrate-attr=foo unstable rustc option This PR adds a new unstable option to `rustc`: `-Zcrate-attr=foo`. The option can be used to inject crate-level attributes from the CLI, and it's meant to be used by tools like Crater that needs to add their own attributes to a crate without changing the source code. The exact reason I need this is to implement "edition runs" in Crater: we need to add the preview feature flag to every crate, and editing the crates' source code on the fly might produce unexpected results, while a compiler flag is more reliable. cc https://github.com/rust-lang-nursery/crater/issues/282 @Mark-Simulacrum
2018-07-28Auto merge of #52585 - GuillaumeGomez:generic-impls, r=QuietMisdreavusbors-5/+29
[rustdoc] Generic impls Fixes #33772. r? @QuietMisdreavus
2018-07-28Auto merge of #52546 - nikomatsakis:issue-52050, r=pnkfelixbors-0/+42
do not overwrite child def-id in place but rather remove/insert When inserting a node N into the tree of impls, we sometimes find than an existing node C should be replaced with N. We used to overwrite C in place with the new def-id N -- but since the lists of def-ids are separated by simplified type, that could lead to N being inserted in the wrong place. This meant we might miss conflicts. We are now not trying to be so smart -- we remove C and then add N later. Fixes #52050 r? @aturon -- do you still remember this code at all? :)
2018-07-28Don't display full blanket implementation and put it into its own sectionGuillaume Gomez-4/+4
2018-07-28Auto merge of #52761 - toidiu:ak-static-infer-fg, r=nikomatsakisbors-0/+121
static infer feature gate https://github.com/rust-lang/rust/issues/44493 r? @nikomatsakis
2018-07-28Auto merge of #52802 - kennytm:rollup, r=kennytmbors-0/+46
Rollup of 11 pull requests Successful merges: - #52702 (Suggest fix when encountering different mutability from impl to trait) - #52703 (Improve a few vectors - calculate capacity or build from iterators) - #52740 (Suggest underscore when using dashes in crate namet push fork) - #52759 (Impl Send & Sync for JoinHandle) - #52760 (rustc_metadata: test loading atoi instead of cos) - #52763 (Omit the vendor component in Fuchsia triple) - #52765 (Remove unused "-Zenable_nonzeroing_move_hints" flag) - #52769 (Incorporate a stray test) - #52777 (Fix doc comment for 'ptr::copy_to' method) - #52779 (revert accidental atty downgrade) - #52781 (Use a slice where a vector is not necessary) Failed merges: r? @ghost
2018-07-28Rollup merge of #52740 - estebank:crate-name, r=petrochenkovkennytm-0/+34
Suggest underscore when using dashes in crate namet push fork Fix #48437.
2018-07-28Rollup merge of #52702 - csmoe:mut_diff, r=estebankkennytm-0/+12
Suggest fix when encountering different mutability from impl to trait Closes https://github.com/rust-lang/rust/issues/52412 r? @estebank
2018-07-28Auto merge of #52678 - matthewjasper:better-spans, r=nikomatsakisbors-134/+272
[NLL] Use better spans in some errors * Use the span of the discriminant and patterns for "fake" statements created to properly check matches. I plan to special case these soon, but this felt like a good first step * Use the span of the statement, rather than the initialization, when reporting move errors for `let x = ...`, which avoids giving an unhelpful suggestion to use `&{ }`. r? @nikomatsakis cc @pnkfelix
2018-07-27Add the -Zcrate-attr=foo nightly rustc flag to inject crate attributesPietro Albini-0/+21
2018-07-27Auto merge of #52648 - davidtwco:issue-52533, r=nikomatsakisbors-50/+162
[nll] improve the "fully elaborated type" case in region errors Fixes #52533. r? @nikomatsakis
2018-07-27Region inference error messages no longer start with 'free region'David Wood-8/+8
2018-07-27Auto merge of #52733 - ↵bors-0/+33
pnkfelix:issue-51348-make-temp-for-each-candidate-in-arm, r=nikomatsakis [NLL] make temp for each candidate in `match` arm In NLL, `ref mut` patterns leverage the two-phase borrow infrastructure to allow the shared borrows within a guard before the "activation" of the mutable borrow when we begin execution of the match arm's body. (There is further discussion of this on PR #50783.) To accommodate the restrictions we impose on two-phase borrows (namely that there is a one-to-one mapping between each activation and the original initialization), this PR is making separate temps for each candidate pattern. So in an arm like this: ```rust PatA(_, ref mut ident) | PatB(ref mut ident) | PatC(_, _, ref mut ident) | PatD(ref mut ident) if guard_stuff(ident) => ... ``` instead of 3 temps (two for the guard and one for the arm body), we now have 4 + 2 temps associated with `ident`: one for each candidate plus the actual temp that the guard uses directly, and then the sixth is the temp used in the arm body. Fix #51348
2018-07-27Improved mechanism for naming regions in non-annotated types.David Wood-10/+70
2018-07-27Change label from closure to function where appropriate.David Wood-34/+32
2018-07-27Fixed missing whitespace on some elaborated types.David Wood-3/+3
2018-07-27Update affected tests.David Wood-22/+22
2018-07-27Added fully elaborated type label for inferred arguments.David Wood-0/+54
2018-07-27Auto merge of #52681 - pnkfelix:z-borrowck-migrate, r=nikomatsakisbors-28/+155
Add `-Z borrowck=migrate` This adds `-Z borrowck=migrate`, which represents the way we want to migrate to NLL under Rust versions to come. It also hooks this new mode into `--edition 2018`, which means we're officially turning NLL on in the 2018 edition. The basic idea of `-Z borrowck=migrate` that there are cases where NLL is fixing old soundness bugs in the borrow-checker, but in order to avoid just breaking code by immediately rejecting the programs that hit those soundness bugs, we instead use the following strategy: If your code is accepted by NLL, then we accept it. If your code is rejected by both NLL and the old AST-borrowck, then we reject it. If your code is rejected by NLL but accepted by the old AST-borrowck, then we emit the new NLL errors as **warnings**. These warnings will be turned into hard errors in the future, and they say so in these diagnostics. Fix #46908
2018-07-27Auto merge of #52650 - oli-obk:associated_existential_types, r=nikomatsakisbors-0/+104
Implement associated existential types r? @nikomatsakis no idea if these work with generic traits. I'm going home for the day :rofl:
2018-07-27fix tidytoidiu-1/+0
2018-07-26fix test and add feature gate testtoidiu-4/+43
2018-07-26some comment about not infering static lifetimes testtoidiu-1/+7
2018-07-26feature gate for inferring 'static lifetimestoidiu-0/+77
2018-07-26Auto merge of #52673 - oli-obk:mutable_promoted, r=nagisa,cramertj,estebankbors-0/+17
Try to fix an ICE might fix #52671
2018-07-26Tweak the raw_identifiers lints in 2018Alex Crichton-0/+38
* Enable the `raw_identifiers` feature automatically in the 2018 preview * Only emit lint warnings if the `raw_identifiers` feature is activated cc rust-lang/cargo#5783
2018-07-26Use better spans for cannot-move errorsMatthew Jasper-4/+191
2018-07-26Use better spans for dummy accesses used in matchesMatthew Jasper-130/+81
2018-07-26Suggest underscore when using dashes in crate namet push forkEsteban Küber-0/+34
2018-07-26Auto merge of #52735 - Mark-Simulacrum:rollup, r=Mark-Simulacrumbors-116/+785
Rollup of 16 pull requests Successful merges: - #52558 (Add tests for ICEs which no longer repro) - #52610 (Clarify what a task is) - #52617 (Don't match on region kinds when reporting NLL errors) - #52635 (Fix #[linkage] propagation though generic functions) - #52647 (Suggest to take and ignore args while closure args count mismatching) - #52649 (Point spans to inner elements of format strings) - #52654 (Format linker args in a way that works for gcc and ld) - #52667 (update the stdsimd submodule) - #52674 (Impl Executor for Box<E: Executor>) - #52690 (ARM: expose `rclass` and `dsp` target features) - #52692 (Improve readability in a few sorts) - #52695 (Hide some lints which are not quite right the way they are reported to the user) - #52718 (State default capacity for BufReader/BufWriter) - #52721 (std::ops::Try impl for std::task::Poll) - #52723 (rustc: Register crates under their real names) - #52734 (sparc ABI issue - structure returning from function is returned in 64bit registers (with tests)) Failed merges: - #52678 ([NLL] Use better spans in some errors) r? @ghost
2018-07-26Auto merge of #52488 - nikomatsakis:nll-issue-48071-universe-and-sub, r=pnkfelixbors-110/+353
introduce universes to NLL type check This branch aims to fix #48071 and also advance chalk integration a bit at the same time. It re-implements the subtyping/type-equating check so that NLL doesn't "piggy back" on the subtyping code of the old type checker. This new code uses the "universe-based" approach to handling higher-ranked lifetimes, which sidesteps some of the limitations of the current "leak-based" scheme. This avoids the ICE in #48071. At the same time, I aim for this to potentially be a kind of optimization. This NLL code is (currently) not cached, but it also generates constraints without doing as much instantiation, substitution, and folding. Right now, though, it still piggy backs on the `relate_tys` trait, which is a bit unfortunate -- it means we are doing more hashing and things than we have to. I want to measure the see the perf. Refactoring that trait is something I'd prefer to leave for follow-up work. r? @pnkfelix -- but I want to measure perf etc first
2018-07-26Rollup merge of #52734 - nagisa:sparcfix, r=oli-obkMark Rousskov-0/+36
sparc ABI issue - structure returning from function is returned in 64bit registers (with tests) Fixes #52638 Supersedes #52730 cc @psumbera
2018-07-26Rollup merge of #52723 - alexcrichton:fix-extern-rename-ice, r=estebankMark Rousskov-0/+45
rustc: Register crates under their real names Whenever we register a crate into the crate store, make sure to use the real name mentioned in the metadata instead of the name mentioned in the `extern crate` statement, as the statement can be wrong! Closes #51796
2018-07-26Rollup merge of #52721 - cramertj:try-poll, r=aturonMark Rousskov-0/+61
std::ops::Try impl for std::task::Poll I originally left out the `Try` impl for `Poll` because I was curious if we needed it, and @MajorBreakfast and I had discussed the potential for it to introduce confusion about exactly what control-flow was happening at different points. However, after porting a pretty significant chunk of Fuchsia over to futures 0.3, I discovered that I was *constantly* having to do repetitive matching on `Poll<Result<...>>` or `Poll<Option<Result<...>>>` in order to propagate errors correctly. `try_poll` (propagate `Poll::Ready(Err(..))`s) helped in some places, but it was far more common to need some form of conversion between `Result`, `Poll<Result<...>>`, and `Poll<Option<Result<...>>>`. The `Try` trait conveniently provides all of these conversions in addition to a more concise syntax (`?`), so I'd like to experiment with using these instead. cc @seanmonstar r? @aturon Note: this change means that far more futures 0.1 code can work without significant changes since it papers over the fact that `Result` is no longer at the top-level when using `Stream` and `Future` (since it's now `Poll<Result<...>>` or `Poll<Option<Result<...>>>` instead of `Result<Poll<..>>` and `Result<Poll<Option<...>>>`).
2018-07-26Rollup merge of #52695 - oli-obk:const_err_panic, r=petrochenkovMark Rousskov-0/+24
Hide some lints which are not quite right the way they are reported to the user fixes #52603
2018-07-26Rollup merge of #52649 - estebank:fmt-span, r=oli-obkMark Rousskov-13/+258
Point spans to inner elements of format strings - Point at missing positional specifiers in string literal ``` error: invalid reference to positional arguments 3, 4 and 5 (there are 3 arguments) --> $DIR/ifmt-bad-arg.rs:34:38 | LL | format!("{name} {value} {} {} {} {} {} {}", 0, name=1, value=2); | ^^ ^^ ^^ | = note: positional arguments are zero-based ``` - Point at named formatting specifier in string literal ``` error: there is no argument named `foo` --> $DIR/ifmt-bad-arg.rs:37:17 | LL | format!("{} {foo} {} {bar} {}", 1, 2, 3); | ^^^^^ ``` - Update label for formatting string in "multiple unused formatting arguments" to be more correct ``` error: multiple unused formatting arguments --> $DIR/ifmt-bad-arg.rs:42:17 | LL | format!("", 1, 2); //~ ERROR: multiple unused formatting arguments | -- ^ ^ | | | multiple missing formatting specifiers ``` - When using `printf` string formatting, provide a structured suggestion instead of a note ``` error: multiple unused formatting arguments --> $DIR/format-foreign.rs:12:30 | LL | println!("%.*3$s %s!/n", "Hello,", "World", 4); //~ ERROR multiple unused formatting arguments | -------------- ^^^^^^^^ ^^^^^^^ ^ | | | multiple missing formatting specifiers | = note: printf formatting not supported; see the documentation for `std::fmt` help: format specifiers in Rust are written using `{}` | LL | println!("{:.2$} {}!/n", "Hello,", "World", 4); //~ ERROR multiple unused formatting arguments | ^^^^^^ ^^ ```
2018-07-26Rollup merge of #52647 - csmoe:closure_arg_ignore, r=estebankMark Rousskov-0/+8
Suggest to take and ignore args while closure args count mismatching Closes #52473
2018-07-26Rollup merge of #52635 - yodaldevoid:issue_18804, r=oli-obkMark Rousskov-0/+43
Fix #[linkage] propagation though generic functions Fixes #18804 In the non-local branch of `get_static` (where the fix was implemented) `span_fatal` had to be replaced with `bug!` as we have no span in that case.
2018-07-26Rollup merge of #52617 - matthewjasper:remove-unused-code, r=nikomatsakisMark Rousskov-103/+121
Don't match on region kinds when reporting NLL errors First half (by number of tests affected) of the changes to "does not live long enough". Now that lexical MIR borrowck is gone, region kinds are always ReVar, so matching on them to change errors does nothing. Changes "borrowed value only lives until here" to "`x` is dropped here while still borrowed". r? @pnkfelix cc @nikomatsakis
2018-07-26Rollup merge of #52558 - wesleywiser:ice_melting, r=estebankMark Rousskov-0/+189
Add tests for ICEs which no longer repro Adds tests for some ICEs which no longer repro and closes the associated issues.
2018-07-26Add a test for sparc64 ABI issueSimonas Kazlauskas-0/+36