summary refs log tree commit diff
path: root/src/test/compile-fail
AgeCommit message (Collapse)AuthorLines
2017-11-14Backported merge of #45890 - arielb1:self-first, r=eddybbors-0/+35
check::method - unify receivers before normalizing method signatures Normalizing method signatures can unify inference variables, which can cause receiver unification to fail. Unify the receivers first to avoid that. Fixes #36701. Fixes #45801. Fixes #45855. r? @eddyb beta-nominating because #43880 made this ICE happen in more cases (the code in that issue ICEs post-#43880 only, but the unit test here ICEs on all versions).
2017-11-14Backported merge of #45785 - arielb1:unsafe-fixes, r=eddybbors-0/+34
fixes to MIR effectck r? @eddyb beta-nominating because regression (MIR effectck is new)
2017-10-08Auto merge of #45016 - pnkfelix:mir-borrowck-gather-and-signal-move-errors, ↵bors-13/+60
r=nikomatsakis MIR-borrowck: gather and signal any move errors When building up the `MoveData` structure for a given MIR, also accumulate any erroneous actions, and then report all of those errors when the construction is complete. This PR adds a host of move-related error constructor methods to `trait BorrowckErrors`. I think I got the notes right; but we should plan to audit all of the notes before turning MIR-borrowck on by default. Fix #44830
2017-10-08Auto merge of #45020 - MaloJaffre:needs-test, r=alexcrichtonbors-0/+92
Fix some E-needstest issues. Also ignore `attr-on-trait` test on stage-1 to keep `./x.py test --stage 1` successful. Fixes #30355. Fixes #33241. Fixes #36400. Fixes #37887. Fixes #44578.
2017-10-06implement pattern-binding-modes RFCTobias Schottdorf-17/+28
See the [RFC] and [tracking issue]. [tracking issue]: https://github.com/rust-lang/rust/issues/42640 [RFC]: https://github.com/rust-lang/rfcs/blob/491e0af/text/2005-match-ergonomics.md
2017-10-06Improve resolution of associated types in macros 2.0Vadim Petrochenkov-0/+101
2017-10-04Fix some E-needstest issues.Malo Jaffré-0/+92
Also ignore `attr-on-trait` test on stage-1 to keep `./x.py test --stage 1` successful. Fixes #30355. Fixes #33241. Fixes #36400. Fixes #37887. Fixes #44578.
2017-10-04Unit tests for gathering and reporting move-errors from mir-borrowck.Felix S. Klock II-13/+60
This commit tests *just* the subset of the tests that were previously ICE'ing and where now AST- and MIR-borrowck both match in terms of the errors they report. In other words: there remain *other* tests that previously ICE'd, and now no longer ICE, but their remains a divergence between the errors reported by AST-borrowck and by MIR-borrowck.
2017-10-03Auto merge of #44922 - zilbuz:issue-44596/E0594, r=pnkfelixbors-5/+44
MIR borrowck: move span_label to `borrowck_errors.rs` The calls to `span_label` are moved and factorized for: * E0503 (`cannot_use_when_mutably_borrowed()`) * E0506 (`cannot_assign_to_borrowed()`) Additionnally, the error E0594 (`cannot_assign_static()`) has been factorized between `check_loan.rs` and `borrowc_check.rs`. Part of #44596
2017-10-03Auto merge of #44966 - zackmdavis:no_mangle_no_snake, r=aturonbors-0/+18
make non_snake_case lint allow extern no-mangle functions Resolves #31924. r? @sfackler
2017-10-02Auto merge of #44942 - zackmdavis:lint_suggestions, r=estebankbors-2/+2
code suggestions for unused-mut, while-true, deprecated-attribute, and unused-parens lints ![lint_suggestions](https://user-images.githubusercontent.com/1076988/31044068-b2074de8-a57c-11e7-9319-6668508b6d1f.png) r? @estebank
2017-10-01make non_snake_case lint allow extern no-mangle functionsZack M. Davis-0/+18
Resolves #31924.
2017-10-01Auto merge of #44945 - petrochenkov:fixtyrec, r=arielb1bors-3/+22
Do not require semantic types for all syntactic types when there are errors Fixes https://github.com/rust-lang/rust/issues/44814 Fixes https://github.com/rust-lang/rust/issues/44858 Fixes https://github.com/rust-lang/rust/issues/44946 r? @nikomatsakis
2017-09-30code suggestions for unused-mut, while-true lints; UI testZack M. Davis-1/+1
2017-09-30code suggestion for deprecated-attribute lintZack M. Davis-1/+1
Also, fix the deprecation message for the late no-debug feature.
2017-09-30Do not require semantic types for all syntactic types when there are type errorspetrochenkov-3/+22
2017-09-29Rollup merge of #44124 - gaurikholkar:return_self, r=arielb1Mark Simulacrum-1/+1
adding E0623 for return types - both parameters are anonymous This is a fix for #44018 ``` error[E0621]: explicit lifetime required in the type of `self` --> $DIR/ex3-both-anon-regions-return-type-is-anon.rs:17:5 | 16 | fn foo<'a>(&self, x: &i32) -> &i32 { | ---- ---- | | | this parameter and the return type are declared with different lifetimes... 17 | x | ^ ...but data from `x` is returned here error: aborting due to previous error ``` It also works for the below case where we have self as anonymous ``` error[E0623]: lifetime mismatch --> src/test/ui/lifetime-errors/ex3-both-anon-regions-self-is-anon.rs:17:19 | 16 | fn foo<'a>(&self, x: &Foo) -> &Foo { | ---- ---- | | | this parameter and the return type are declared with different lifetimes... 17 | if true { x } else { self } | ^ ...but data from `x` is returned here error: aborting due to previous error ``` r? @nikomatsakis Currently, I have enabled E0621 where return type and self are anonymous, hence WIP.
2017-09-29Auto merge of #44866 - mdevlamynck:impl-trait, r=eddybbors-0/+38
First step toward implementing impl Trait in argument position First step implementing #44721. Add a flag to hir and ty TypeParameterDef and raise an error when using explicit type parameters when calling a function using impl Trait in argument position. I don't know if there is a procedure to add an error code so I just took an available code. Is that ok ? r? @nikomatsakis
2017-09-29mir-borrowck: Factorize error message for `cannot_assign_static()` between ↵Basile Desloges-5/+44
AST and MIR borrowck
2017-09-29Auto merge of #44811 - zilbuz:issue-44596/E0506, r=arielb1bors-37/+150
MIR-borrowck: Adding notes to E0506 This PR adds notes to the MIR borrowck error E0506. Part of #44596
2017-09-28Auto merge of #44806 - KiChjang:mir-err-notes-2, r=pnkfelixbors-5/+18
Add span label to E0384 for MIR borrowck Corresponds to `report_illegal_reassignment`. Part of #44596.
2017-09-27Auto merge of #44782 - estebank:issue-36700, r=GuillaumeGomezbors-29/+0
Point at parameter type on E0301 On "the parameter type `T` may not live long enough" error, point to the parameter type suggesting lifetime bindings: ``` error[E0310]: the parameter type `T` may not live long enough --> $DIR/lifetime-doesnt-live-long-enough.rs:28:5 | 27 | struct Foo<T> { | - help: consider adding an explicit lifetime bound `T: 'static`... 28 | foo: &'static T | ^^^^^^^^^^^^^^^ | note: ...so that the reference type `&'static T` does not outlive the data it points at --> $DIR/lifetime-doesnt-live-long-enough.rs:28:5 | 28 | foo: &'static T | ^^^^^^^^^^^^^^^ ``` Fix #36700.
2017-09-27Auto merge of #44709 - Badel2:inclusive-range-dotdoteq, r=petrochenkovbors-6/+22
Initial support for `..=` syntax #28237 This PR adds `..=` as a synonym for `...` in patterns and expressions. Since `...` in expressions was never stable, we now issue a warning. cc @durka r? @aturon
2017-09-26Add span label to E0384 for MIR borrowckKeith Yeung-5/+18
2017-09-26mir-borrowck: Edit compile-fail tests with E0506 error to also test on MIR ↵Basile Desloges-37/+150
borrowck
2017-09-26remove random newlines from error messages, fix compile-fail testNiko Matsakis-1/+1
That kind of formatting seems like the job of other code.
2017-09-26impl Trait in argument position desugaring:Matthias Devlamynck-0/+38
Add a flag to hir and ty TypeParameterDef and raise an error when using explicit type parameters when calling a function using impl Trait in argument position.
2017-09-25Fix bug in collecting trait and impl items with derives.Jeffrey Seyfried-0/+28
2017-09-25Auto merge of #44279 - smaeul:crt_static-deps, r=alexcrichtonbors-2/+2
Require rlibs for dependent crates when linking static executables This handles the case for `CrateTypeExecutable` and `+crt_static`. I reworked the match block to avoid duplicating the `attempt_static` and error checking code again (this case would have been a copy of the `CrateTypeCdylib`/`CrateTypeStaticlib` case). On `linux-musl` targets where `std` was built with `crt_static = false` in `config.toml`, this change brings the test suite from entirely failing to mostly passing. This change should not affect behavior for other crate types, or for targets which do not respect `+crt_static`.
2017-09-24Point at parameter type on E0301Esteban Küber-29/+0
On "the parameter type `T` may not live long enough" error, point to the parameter type suggesting lifetime bindings: ``` error[E0310]: the parameter type `T` may not live long enough --> $DIR/lifetime-doesnt-live-long-enough.rs:28:5 | 27 | struct Foo<T> { | - help: consider adding an explicit lifetime bound `T: 'static`... 28 | foo: &'static T | ^^^^^^^^^^^^^^^ | note: ...so that the reference type `&'static T` does not outlive the data it points at --> $DIR/lifetime-doesnt-live-long-enough.rs:28:5 | 28 | foo: &'static T | ^^^^^^^^^^^^^^^ ```
2017-09-24fix testAriel Ben-Yehuda-2/+2
2017-09-24move unsafety checking to MIRAriel Ben-Yehuda-6/+29
No functional changes intended.
2017-09-23Auto merge of #44633 - petrochenkov:priv2, r=nikomatsakisbors-3/+21
Record semantic types for all syntactic types in bodies ... and use recorded types in type privacy checking (types are recorded after inference, so there are no `_`s left). Also use `hir_ty_to_ty` for types in signatures in type privacy checking. This could also be potentially useful for save-analysis and diagnostics. Fixes https://github.com/rust-lang/rust/pull/42125#issuecomment-305987755 r? @eddyb
2017-09-23Auto merge of #44055 - zackmdavis:condensed_non-ADT_derive_error, r=jseyfriedbors-26/+3
only set non-ADT derive error once per attribute, not per trait I found the expansion code very hard to follow, leaving me unsure as to whether this might somehow be done better, but this patch does give us the behavior requested in #43927 (up to exact choice of span; here, it's the entire attribute, not just the `derive` token). (Note to GitHub robots: _resolves #43927_.) r? @jseyfried
2017-09-23Use recorded types in rustc_privacyVadim Petrochenkov-3/+4
2017-09-23Record semantic types for all syntactic types in bodiesVadim Petrochenkov-0/+17
2017-09-22dotdoteq_in_patterns feature gateBadel2-0/+16
2017-09-22Add support for `..=` syntaxAlex Burka-6/+6
Add ..= to the parser Add ..= to libproc_macro Add ..= to ICH Highlight ..= in rustdoc Update impl Debug for RangeInclusive to ..= Replace `...` to `..=` in range docs Make the dotdoteq warning point to the ... Add warning for ... in expressions Updated more tests to the ..= syntax Updated even more tests to the ..= syntax Updated the inclusive_range entry in unstable book
2017-09-22Auto merge of #44691 - cramertj:underscore-lifetimes, r=nikomatsakisbors-6/+94
Implement underscore lifetimes Part of https://github.com/rust-lang/rust/issues/44524
2017-09-21only set non-ADT derive error once per attribute, not per traitZack M. Davis-26/+3
A slight eccentricity of this change is that now non-ADT-derive errors prevent derive-macro-not-found errors from surfacing (see changes to the gating-of-derive compile-fail tests). Resolves #43927.
2017-09-21Add tests for underscore lifetimes in impl headers and struct definitionsTaylor Cramer-0/+5
2017-09-21Add tests for multiple underscore and non-underscore lifetimesTaylor Cramer-0/+17
2017-09-21Auto merge of #44627 - zackmdavis:the_capgate_perogative, r=nrcbors-0/+22
`--cap-lints allow` switches off `can_emit_warnings` This boolean field on the error `Handler` is toggled to silence warnings when `-A warnings` is passed. (This is actually a separate mechanism from the global lint level—whether there's some redundancy to be factored away here is an important question, but not one we concern ourselves with in this commit.) But the same rationale applies for `--cap-lints allow`. In particular, this makes the "soft" feature-gate warning introduced in 8492ad24 (which is not a lint, but just calls `struct_span_warn`) not pollute the builds of dependent crates. Thanks to @kennytm for pointing out the potential of `can_emit_warnings` for this purpose. Resolves #44213.
2017-09-20Implement underscore lifetimesTaylor Cramer-6/+72
2017-09-20Implement `Copy`/`Clone` for closuresscalexm-0/+88
2017-09-19Adjust dependency-resolution errors to be more consistentSamuel Holland-2/+2
2017-09-19Auto merge of #44026 - QuietMisdreavus:trimmed-std, r=steveklabnikbors-0/+14
hide internal types/traits from std docs via new #[doc(masked)] attribute Fixes #43701 (hopefully for good this time) This PR introduces a new parameter to the `#[doc]` attribute that rustdoc looks for on `extern crate` statements. When it sees `#[doc(masked)]` on such a statement, it hides traits and types from that crate from appearing in either the "Trait Implementations" section of many type pages, or the "Implementors" section of trait pages. This is then applied to the `libc`/`rand`/`compiler_builtins` imports in libstd to prevent those crates from creating broken links in the std docs. Like in #43348, this also introduces a feature gate, `doc_masked`, that controls the use of this parameter. To view the std docs generated with this change, head to https://tonberry.quietmisdreavus.net/std-43701/std/index.html.
2017-09-16Rollup merge of #44590 - oli-obk:allow_unused_mut_on_vars, r=eddybAlex Crichton-0/+8
Get `allow(unused_mut)` to work on `let` bindings fixes #40491
2017-09-16change #![feature(const_fn)] to specific gatesAlex Burka-44/+5
2017-09-16`--cap-lints allow` switches off `can_emit_warnings`Zack M. Davis-0/+22
This boolean field on the error `Handler` is toggled to silence warnings when `-A warnings` is passed. (This is actually a separate mechanism from the global lint level—whether there's some redundancy to be factored away here is an important question, but not one we concern ourselves with in this commit.) But the same rationale applies for `--cap-lints allow`. In particular, this makes the "soft" feature-gate warning introduced in 8492ad24 (which is not a lint, but just calls `struct_span_warn`) not pollute the builds of dependent crates. Thanks to @kennytm for pointing out the potential of `can_emit_warnings` for this purpose. Resolves #44213.