about summary refs log tree commit diff
path: root/src/test/compile-fail
AgeCommit message (Collapse)AuthorLines
2017-04-28Rollup merge of #41583 - arielb1:cross-constant, r=eddybCorey Farwell-0/+38
don't ICE on cross-crate associated const type mismatch Fixes #41549. r? @eddyb
2017-04-27Rollup merge of #41523 - estebank:moved, r=arielb1Corey Farwell-46/+0
Point at variable moved by closure Fix #41482, #31752.
2017-04-27don't ICE on cross-crate associated const type mismatchAriel Ben-Yehuda-0/+38
Fixes #41549.
2017-04-27Auto merge of #41433 - estebank:constructor, r=michaelwoeristerbors-1/+1
Do not show `::{{constructor}}` on tuple struct diagnostics Fix #41313.
2017-04-27Auto merge of #37860 - giannicic:defaultimpl, r=nagisabors-0/+226
#37653 support `default impl` for specialization this commit implements the first step of the `default impl` feature: > all items in a `default impl` are (implicitly) `default` and hence > specializable. In order to test this feature I've copied all the tests provided for the `default` method implementation (in run-pass/specialization and compile-fail/specialization directories) and moved the `default` keyword from the item to the impl. See [referenced](https://github.com/rust-lang/rust/issues/37653) issue for further info r? @aturon
2017-04-25Point at variable moved by closureEsteban Küber-46/+0
2017-04-25Move `cfail` tests to `ui`Esteban Küber-119/+0
2017-04-25Parse trait object types starting with a lifetime boundVadim Petrochenkov-0/+54
2017-04-25Fix object safety violations in the testVadim Petrochenkov-23/+48
2017-04-25privacy: Rename and cleanup PrivacyVisitorVadim Petrochenkov-2/+2
2017-04-25Check privacy of trait items in all contextsVadim Petrochenkov-76/+111
2017-04-25Improve E0178 suggestion placementOliver Schneider-50/+0
2017-04-25Update affected testsOliver Schneider-1/+1
2017-04-25 support `default impl` for specializationGianni Ciccarelli-0/+19
pr review
2017-04-24Reorder code, fix unittestsEsteban Küber-5/+33
2017-04-24support `default impl` for specializationGianni Ciccarelli-0/+207
this commit implements the first step of the `default impl` feature: all items in a `default impl` are (implicitly) `default` and hence specializable. In order to test this feature I've copied all the tests provided for the `default` method implementation (in run-pass/specialization and compile-fail/specialization directories) and moved the `default` keyword from the item to the impl. See referenced issue for further info
2017-04-24Feature gate in test.Without Boats-0/+2
2017-04-24Fix more merge conflictsMatthew-20/+15
2017-04-24Style.Without Boats-3/+3
2017-04-24Add compile-fail test.Without Boats-0/+26
2017-04-23rustc_const_eval: support all unit enum variants.Eduard-Mihai Burtescu-14/+15
2017-04-23rustc: make the const-eval cache polymorphic.Eduard-Mihai Burtescu-6/+0
2017-04-22Resolve merge conflictmatthewjasper-6/+76
2017-04-22Auto merge of #39999 - bitshifter:struct_align, r=eddybbors-3/+73
Implementation of repr struct alignment RFC 1358. The main changes around rustc::ty::Layout::struct: * Added abi_align field which stores abi alignment before repr align is applied * align field contains transitive repr alignment * Added padding vec which stores padding required after fields The main user of this information is rustc_trans::adt::struct_llfields which determines the LLVM fields to be used by LLVM, including padding fields. A possible future optimisation would be to put the padding Vec in an Option, since it will be unused unless you are using repr align.
2017-04-21Create a new method to run coercion inside probeGuillaume Gomez-6/+2
2017-04-21Update testsGuillaume Gomez-1/+5
2017-04-20Do not show `::constructor` on tuple struct diagnosticsEsteban Küber-1/+1
2017-04-21Added feature gate, updated error messages and tests.Cameron Hart-3/+21
2017-04-21Implementation of repr struct alignment RFC 1358.Cameron Hart-3/+55
The main changes around rustc::ty::Layout::struct and rustc_trans:adt: * Added primitive_align field which stores alignment before repr align * Always emit field padding when generating the LLVM struct fields * Added methods for adjusting field indexes from the layout index to the LLVM struct field index The main user of this information is rustc_trans::adt::struct_llfields which determines the LLVM fields to be used by LLVM, including padding fields.
2017-04-20Stabilize RFC 1506 - clarified ADT kindsMatthew-22/+0
2017-04-20Rollup merge of #41214 - estebank:less-multiline, r=petrochenkovCorey Farwell-18/+0
Add a way to get shorter spans until `char` for pointing at defs ```rust error[E0072]: recursive type `X` has infinite size --> file.rs:10:1 | 10 | struct X { | ^^^^^^^^ recursive type has infinite size | = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `X` representable ``` vs ```rust error[E0072]: recursive type `X` has infinite size --> file.rs:10:1 | 10 | struct X { | _^ starting here... 11 | | x: X, 12 | | } | |_^ ...ending here: recursive type has infinite size | = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `X` representable ``` Re: #35965, #38246. Follow up to #38328. r? @jonathandturner
2017-04-19Auto merge of #41236 - cengizIO:master, r=nikomatsakisbors-52/+2
Move E0101 and E0102 logic into new E0282 mechanism #40013 Hello there! ## What's this? Previously, me and @nikomatsakis worked on error messages of uninferred locals. (#38812) This aims to build up on that by moving certain type checks from `writeback`. With this, `E0101` and `E0102` errors are getting obsoleted and no longer thrown. They're replaced with customized versions of `E0282`s instead. ## Sample Error Messages #### `E0101` is getting converted into: ```rust error[E0282]: type annotations needed --> test.rs:2:14 | 2 | let x = |_| {}; | ^ consider giving this closure parameter a type error: aborting due to previous error ``` #### `E0102` is getting converted into: ```rust error[E0282]: type annotations needed --> test.rs:2:9 | 2 | let x = []; | ^ | | | consider giving `x` a type | cannot infer type for `[_; 0]` error: aborting due to previous error ``` ## Annoyances - I think we need to change our way of type name resolving in relevant places, because that `[_; 0]` looks horrible IMHO. - I'm not terribly happy with the note ordering of errors. So please do point to code that might help me accomplish this. ## Tests Tests of `E0101` and `E0102` are getting converted from `compile-fail` to `ui` tests. ## Documentation Please help me with documentation update. There are some confusing places that needed an update but I'm not sure if I did the right ones. Please do comment on messages, layouts and other details. ## Appreciation Huge thanks goes to @nikomatsakis for being a patient and humble mentor along this long journey. 🍻
2017-04-18change note for patternsCengiz Can-2/+2
2017-04-18fixes #40013Cengiz Can-50/+0
2017-04-18update `dep-graph-struct-signature` test caseNiko Matsakis-11/+0
the `CollectItem` task no longer exists
2017-04-15feature gate :vis matcherAlex Burka-0/+19
2017-04-14update tests slightlyNiko Matsakis-2/+45
2017-04-14Name files what tidy wants them to be namdSean Griffin-0/+0
2017-04-14Put overlapping impls behind feature gate, add testsSean Griffin-0/+19
I've added some explicit tests that negative impls are allowed to overlap, and also to make sure that the feature doesn't interfere with specialization. I've not added an explicit test for positive overlapping with negative, as that's already tested elsewhere.
2017-04-14Further update with response to feedbackSean Griffin-0/+1
2017-04-14Implement RFC 1268Sean Griffin-21/+21
This patch allows overlap to occur between any two impls of a trait for traits which have no associated items. Several compile-fail tests around coherence had to be changed to add at least one item to the trait they test against. Ref #29864
2017-04-14Rollup merge of #40702 - mrhota:global_asm, r=nagisaCorey Farwell-0/+15
Implement global_asm!() (RFC 1548) This is a first attempt. ~~One (potential) problem I haven't solved is how to handle multiple usages of `global_asm!` in a module/crate. It looks like `LLVMSetModuleInlineAsm` overwrites module asm, and `LLVMAppendModuleInlineAsm` is not provided in LLVM C headers 😦~~ I can provide more detail as needed, but honestly, there's not a lot going on here. r? @eddyb CC @Amanieu @jackpot51 Tracking issue: #35119
2017-04-14Auto merge of #41153 - petrochenkov:umove, r=pnkfelixbors-0/+57
Fix move checking for nested union fields Fixes https://github.com/rust-lang/rust/issues/41126 r? @arielb1
2017-04-13Auto merge of #40570 - nikomatsakis:inference-subtype-through-obligation, ↵bors-79/+58
r=arielb1 Handle subtyping in inference through obligations We currently store subtyping relations in the `TypeVariables` structure as a kind of special case. This branch uses normal obligations to propagate subtyping, thus converting our inference variables into normal fallback. It also does a few other things: - Removes the (unstable, outdated) support for custom type inference fallback. - It's not clear how we want this to work, but we know that we don't want it to work the way it currently does. - The existing support was also just getting in my way. - Fixes #30225, which was caused by the trait caching code pretending type variables were normal unification variables, when indeed they were not (but now are). There is one fishy part of these changes: when computing the LUB/GLB of a "bivariant" type parameter, I currently return the `a` value. Bivariant type parameters are only allowed in a very particular situation, where the type parameter is only used as an associated type output, like this: ```rust pub struct Foo<A, B> where A: Fn() -> B { data: A } ``` In principle, if one had `T=Foo<A, &'a u32>` and `U=Foo<A, &'b u32>` and (e.g.) `A: for<'a> Fn() -> &'a u32`, then I think that computing the LUB of `T` and `U` might do the wrong thing. Probably the right behavior is just to create a fresh type variable. However, that particular example would not compile (because the where-clause is illegal; `'a` does not appear in any input type). I was not able to make an example that *would* compile and demonstrate this shortcoming, and handling the LUB/GLB was mildly inconvenient, so I left it as is. I am considering whether to revisit this or what. I have started a crater run to test the impact of these changes.
2017-04-12Add global_asm testsA.J. Gardner-0/+15
2017-04-12Rollup merge of #41232 - arielb1:mir-rvalues, r=eddybTim Neumann-0/+18
move rvalue checking to MIR
2017-04-12Add a way to get shorter spans until `char` for pointing at defsEsteban Küber-18/+0
```rust error[E0072]: recursive type `X` has infinite size --> file.rs:10:1 | 10 | struct X { | ^^^^^^^^ recursive type has infinite size | = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `X` representable ``` vs ```rust error[E0072]: recursive type `X` has infinite size --> file.rs:10:1 | 10 | struct X { | _^ starting here... 11 | | x: X, 12 | | } | |_^ ...ending here: recursive type has infinite size | = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `X` representable ```
2017-04-11update various test cases that generate slightly different outputNiko Matsakis-6/+10
For the most part, it seems to be better, but one side-effect is that I cannot seem to reproduce E0102 anymore.
2017-04-11fix a bug in compiletest JSON parsing for duplicate errorsNiko Matsakis-7/+0
In some cases, we give multiple primary spans, in which case we would report one `//~` annotation per primary span. That was very confusing because these things are reported to the user as a single error. UI tests would be better here.
2017-04-11add regression test for #30225Niko Matsakis-0/+48
Fixes #30225