summary refs log tree commit diff
path: root/src/test/ui/traits
AgeCommit message (Collapse)AuthorLines
2019-06-22Rollup merge of #61681 - asfreitas:addSendTrait, r=estebankMazdak Farrokhzad-14/+14
Changed the error message to more clearly explain what is allowed This is in regard to #61634. I changed the language to make it more clear what is allowed.
2019-06-22adding in these files that didn't get added in previous commitAndrew-7/+7
2019-06-21changed expected output in tests so it now passes with changed outputAndrew-7/+7
2019-06-14Add explanation for E0592Yuki Okushi-0/+1
2019-06-09Add test for ICEYuki Okushi-0/+22
2019-05-31fix tidyEsteban Küber-3/+1
2019-05-30Remove unecessary `-Z continue-parse-after-error` from testsEsteban Küber-1/+1
2019-05-29Update ui test suite to use dynmemoryruins-62/+72
2019-05-20Reinstated shallow disallowing of maybe bounds in trait objects.Alexander Regueiro-2/+46
2019-05-20Addressed more points raised in review.Alexander Regueiro-104/+361
2019-05-20Addressed points raised in review.Alexander Regueiro-41/+87
2019-05-20Update tests.Alexander Regueiro-15/+1347
2019-05-14Rollup merge of #60444 - nikomatsakis:issue-60010-cycle-error-investigation, ↵Mazdak Farrokhzad-0/+91
r=pnkfelix forego caching for all participants in cycles, apart from root node This is a targeted fix for #60010, which uncovered a pretty bad failure of our caching strategy in the face of coinductive cycles. The problem is explained in the comment in the PR on the new field, `in_cycle`, but I'll reproduce it here: > Starts out as false -- if, during evaluation, we encounter a > cycle, then we will set this flag to true for all participants > in the cycle (apart from the "head" node). These participants > will then forego caching their results. This is not the most > efficient solution, but it addresses #60010. The problem we > are trying to prevent: > > - If you have `A: AutoTrait` requires `B: AutoTrait` and `C: NonAutoTrait` > - `B: AutoTrait` requires `A: AutoTrait` (coinductive cycle, ok) > - `C: NonAutoTrait` requires `A: AutoTrait` (non-coinductive cycle, not ok) > > you don't want to cache that `B: AutoTrait` or `A: AutoTrait` > is `EvaluatedToOk`; this is because they were only considered > ok on the premise that if `A: AutoTrait` held, but we indeed > encountered a problem (later on) with `A: AutoTrait. So we > currently set a flag on the stack node for `B: AutoTrait` (as > well as the second instance of `A: AutoTrait`) to supress > caching. > > This is a simple, targeted fix. The correct fix requires > deeper changes, but would permit more caching: we could > basically defer caching until we have fully evaluated the > tree, and then cache the entire tree at once. I'm not sure what the impact of this fix will be in terms of existing crates or performance: we were accepting incorrect code before, so there will perhaps be some regressions, and we are now caching less. As the comment above notes, we could do a lot better than this fix, but that would involve more invasive rewrites. I thought it best to start with something simple. r? @pnkfelix -- but let's do crater/perf run cc @arielb1
2019-05-07compiletest: only use `make_exe_name` for tests that end up being executed.Eduard-Mihai Burtescu-0/+3
2019-05-01forego caching for all participants in cycles, apart from root nodeNiko Matsakis-0/+91
2019-04-29Suggest try_into when possibleEsteban Küber-0/+4
2019-04-22update tests for migrate mode by defaultMatthew Jasper-20/+6
2019-04-18hide `--explain` hint if error has no extended infoAndy Russell-16/+8
2019-04-02Rollup merge of #59166 - seanmonstar:trait-alias-import, r=alexregMazdak Farrokhzad-0/+44
resolve: collect trait aliases along with traits It seems trait aliases weren't being collected as `TraitCandidates` in resolve, this should change that. (I can't compile the full compiler locally, so relying on CI...) Fixes https://github.com/rust-lang/rust/issues/56485 r? @alexreg
2019-04-01resolve all in scope trait aliases, then elaborate their boundsSean McArthur-0/+44
2019-03-27Better diagnostic for binary operation on BoxedValueshgallagher1993-2/+4
2019-03-23Tweak spans for E0599Esteban Küber-12/+4
2019-03-11Update NLL testsVadim Petrochenkov-1/+1
2019-03-11Update testsVadim Petrochenkov-64/+64
2019-02-12Added tests.Alexander Regueiro-0/+21
2019-02-07Update testsvarkor-7/+3
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-01-22Stabilize Any::get_type_id and rename to type_idSimon Sapin-2/+1
FCP: https://github.com/rust-lang/rust/issues/27745#issuecomment-373906749
2019-01-19Rollup merge of #57502 - nikomatsakis:fix-trait-alias-1b, r=nikomatsakisMazdak Farrokhzad-0/+49
make trait-aliases work across crates This is rebase of a small part of @alexreg's PR #55994. It focuses just on the changes that integrate trait aliases properly into crate metadata, excluding the stylistic edits and the trait objects. The stylistic edits I also rebased and can open a separate PR. The trait object stuff I found challenging and decided it basically needed to be reimplemented. For now I've excluded it. Since this is really @alexreg's work (I really just rebased) I am going to make it r=me once it is working. Fixes #56488. Fixes #57023.
2019-01-14Rollup merge of #57540 - estebank:eval-more, r=petrochenkovMazdak Farrokhzad-8/+10
Modify some parser diagnostics to continue evaluating beyond the parser Continue evaluating further errors after parser errors on: - trailing type argument attribute - lifetime in incorrect location - incorrect binary literal - missing `for` in `impl Trait for Foo` - type argument in `where` clause - incorrect float literal - incorrect `..` in pattern - associated types - incorrect discriminator value variant error and others. All of these were found by making `continue-parse-after-error` `true` by default to identify errors that would need few changes. There are now only a handful of errors that have any change with `continue-parse-after-error` enabled. These changes make it so `rust` _won't_ stop evaluation after finishing parsing, enabling type checking errors to be displayed on the existing code without having to fix the parse errors. Each commit has an individual diagnostic change with their corresponding tests. CC #48724.
2019-01-12Suggest correct location for lifetime parameters in useEsteban Küber-7/+9
2019-01-11Continue parsing after lifetime in incorrect locationEsteban Küber-1/+1
2019-01-10new trait alias testsNiko Matsakis-0/+49
Co-authored-by: Alexander Regueiro <alexreg@me.com>
2019-01-09clarify resolve typo suggestionAndy Russell-1/+1
Include the kind of the binding that we're suggesting, and use a structured suggestion.
2019-01-01Fix broken links to second edition TRPL.Corey Farwell-5/+5
Fixes https://github.com/rust-lang/rust/issues/57104.
2018-12-26Fixed more tests.Alexander Regueiro-8/+16
2018-12-25Remove licensesMark Rousskov-709/+147
2018-12-24make non_camel_case_types an early lintAndy Russell-9/+11
2018-12-18improve tests as suggested by review commentsAriel Ben-Yehuda-2/+92
2018-12-16fix trait objects with a Self-having projection vaAriel Ben-Yehuda-0/+57
This follows ALT2 in the issue. Fixes #56288.
2018-12-08fix span for invalid number of parameters in trait methodGuillaume Gomez-1/+1
2018-12-04Update testsOliver Scherer-8/+8
2018-11-22Do not point at associated types from other cratesEsteban Küber-5/+0
This is a somewhat arbitrary restriction in order to be consistent in the output of the tests regardless of target platform.
2018-11-22Reword and fix testEsteban Küber-1/+1
2018-11-22Point at the associated type's def spanEsteban Küber-0/+5
2018-11-11Rollup merge of #55687 - alexreg:fix-24010, r=scalexmPietro Albini-2/+2
Take supertraits into account when calculating associated types Fixes #24010 and #23856. Applies to trait aliases too. As a by-product, this PR also makes repeated bindings of the same associated item in the same definition a hard error. This was previously a warning with a note about it becoming a hard error in the future. See #50589 for more info. I talked about this with @nikomatsakis recently, but only very superficially, so this shouldn't stop anyone from assigning it to themself to review and r+. N.B. The "WIP" commits represent imperfect attempts to solve the problem just for trait objects, but I've left them in for reference for the sake of whomever is reviewing this. CC @carllerche @theemathas @durka @mbrubeck
2018-11-07Only do check for trait objects, not trait or trait alias definitions.Alexander Regueiro-2/+2
2018-11-07Added error for duplicate bindings of associated type.Alexander Regueiro-17/+0
2018-11-07Added tests.Alexander Regueiro-0/+17
2018-11-07Removed `#[rustc_error]` from tests that are all `// compile-pass`.Felix S. Klock II-23/+7
I also added `// skip-codegen` to each one, to address potential concerns that this change would otherwise slow down our test suite spending time generating code for files that are really just meant to be checks of compiler diagnostics. (However, I will say: My preference is to not use `// skip-codegen` if one can avoid it. We can use all the testing of how we drive LLVM that we can get...) (Updated post rebase.)
2018-11-03Auto merge of #55101 - alexreg:trait-aliases, r=nikomatsakisbors-82/+96
Implement trait aliases (RFC 1733) Extends groundwork done in https://github.com/rust-lang/rust/pull/45047, and fully implements https://github.com/rust-lang/rfcs/pull/1733. CC @durka @nikomatsakis