summary refs log tree commit diff
path: root/src/test/compile-fail
AgeCommit message (Collapse)AuthorLines
2016-07-03Revert "skip double negation in const eval"Alex Crichton-0/+1
This reverts commit 735c018974e5570ea13fd887aa70a011a5b8e7b8.
2016-07-02fix test falloutAriel Ben-Yehuda-8/+8
2016-05-20Rollup merge of #33739 - GuillaumeGomez:error-code-tests, r=ManishearthGuillaume Gomez-0/+284
Add new error code tests r? @steveklabnik
2016-05-20Rollup merge of #33683 - sanxiyn:paren-span, r=nikomatsakisGuillaume Gomez-3/+34
Preserve span when lowering ExprKind::Paren Fix #33681.
2016-05-20Rollup merge of #33676 - rkruppe:e0509-exact-words, r=sanxiynGuillaume Gomez-10/+12
Reword the short diagnostic for E0509 Saying that a type *implements* a trait is much more idiomatic than saying it *defines* the trait.
2016-05-20Auto merge of #33553 - alexcrichton:cdylibs, r=brsonbors-0/+28
rustc: Add a new crate type, cdylib This commit is an implementation of [RFC 1510] which adds a new crate type, `cdylib`, to the compiler. This new crate type differs from the existing `dylib` crate type in a few key ways: * No metadata is present in the final artifact * Symbol visibility rules are the same as executables, that is only reachable `extern` functions are visible symbols * LTO is allowed * All libraries are always linked statically This commit is relatively simple by just plubming the compiler with another crate type which takes different branches here and there. The only major change is an implementation of the `Linker::export_symbols` function on Unix which now actually does something. This helps restrict the public symbols from a cdylib on Unix. With this PR a "hello world" `cdylib` is 7.2K while the same `dylib` is 2.4MB, which is some nice size savings! [RFC 1510]: https://github.com/rust-lang/rfcs/pull/1510 Closes #33132
2016-05-19rustc: Add a new crate type, cdylibAlex Crichton-0/+28
This commit is an implementation of [RFC 1510] which adds a new crate type, `cdylib`, to the compiler. This new crate type differs from the existing `dylib` crate type in a few key ways: * No metadata is present in the final artifact * Symbol visibility rules are the same as executables, that is only reachable `extern` functions are visible symbols * LTO is allowed * All libraries are always linked statically This commit is relatively simple by just plubming the compiler with another crate type which takes different branches here and there. The only major change is an implementation of the `Linker::export_symbols` function on Unix which now actually does something. This helps restrict the public symbols from a cdylib on Unix. With this PR a "hello world" `cdylib` is 7.2K while the same `dylib` is 2.4MB, which is some nice size savings! [RFC 1510]: https://github.com/rust-lang/rfcs/pull/1510 Closes #33132
2016-05-19Rollup merge of #33712 - jseyfried:fix_expanded_expr_span_bug, r=nrcManish Goregaokar-21/+23
Fix bug in macro expression spans Fix a bug in macro expression spans. r? @nrc
2016-05-19Rollup merge of #33708 - nham:zero-elided-lifetimes, r=sanxiynManish Goregaokar-0/+35
Only print parameters with elided lifetimes in elision error messages. When displaying the function parameters for a lifetime elision error message, this changes it to first filter out the parameters that don't have elided lifetimes. Fixes #30255.
2016-05-19Rollup merge of #33696 - nham:add-test-21225, r=luqmanaManish Goregaokar-0/+30
Add regression tests for error message when using enum variant as a type I'm guessing these were actually fixed with PR #27085. Closes #21225 Closes #19197
2016-05-19Add new error code testsggomez-0/+284
2016-05-19Reword the short diagnostic for E0509Robin Kruppe-10/+12
Saying that a type *implements* a trait is much more idiomatic than saying it *defines* the trait.
2016-05-19Auto merge of #33694 - arielb1:fuzzy-on-unimplemented, r=nikomatsakisbors-1/+58
implement fuzzy matching in on_unimplemented Fixes #31062 r? @nikomatsakis
2016-05-18Auto merge of #33688 - jonathandturner:fix_old_school, r=nikomatsakisbors-24/+29
Fix for old school error issues, improvements to new school This PR: * Fixes some old school error issues, specifically #33559, #33543, #33366 * Improves wording borrowck errors with match patterns * De-emphasize multi-line spans, so we don't color the single source character when we're trying to say "span starts here" * Rollup of #33392 (which should help fix #33390) r? @nikomatsakis
2016-05-18Auto merge of #33686 - GuillaumeGomez:error-code-tests, r=steveklabnikbors-0/+121
Add new error code tests r? @steveklabnik
2016-05-18address review commentsAriel Ben-Yehuda-2/+2
2016-05-18implement fuzzy matching in on_unimplementedAriel Ben-Yehuda-1/+58
2016-05-19Be smart about span of parenthesized expression in macroSeo Sanghyeon-0/+31
2016-05-18Fix code suggestion in testSeo Sanghyeon-3/+3
2016-05-18Fix tidy errorJonathan Turner-1/+1
2016-05-18Fix bug in macro expression spansJeffrey Seyfried-21/+23
2016-05-18Add new error code testsggomez-0/+121
2016-05-18Only print parameters with elided lifetimes in elision error messages.Nick Hamann-0/+35
When displaying the function parameters for a lifetime elision error message, this changes it to first filter out the parameters that don't have elided lifetimes. Fixes #30255.
2016-05-17Auto merge of #33137 - ↵bors-5/+264
nikomatsakis:issue-32330-lbr-in-return-type-warning-2, r=aturon Warnings for issue #32330 This is an extension of the previous PR that issues warnings in more situations than before. It does not handle *all* cases of #32330 but I believe it issues warnings for all cases I've seen in practice. Before merging I'd like to address: - open a good issue explaining the problem and how to fix it (I have a [draft writeup][]) - work on the error message, which I think is not as clear as it could/should be (suggestions welcome) r? @aturon [draft writeup]: https://gist.github.com/nikomatsakis/631ec8b4af9a18b5d062d9d9b7d3d967
2016-05-17warn for where/return-types that reference regionsNiko Matsakis-5/+264
This is a step towards fixing #32330. The full fix would be a breaking change, so we begin by issuing warnings for scenarios that will break.
2016-05-17Add regression tests for error message when using enum variant as a typeNick Hamann-0/+30
I'm guessing these were actually fixed with PR #27085. Closes #21225 Closes #19197
2016-05-17Improve a few errors and fix #33366Jonathan Turner-24/+29
2016-05-16Auto merge of #33491 - arielb1:obligation-jungle, r=nikomatsakisbors-74/+49
Replace the obligation forest with a graph In the presence of caching, arbitrary nodes in the obligation forest can be merged, which makes it a general graph. Handle it as such, using cycle-detection algorithms in the processing. I should do performance measurements sometime. This was pretty much written as a proof-of-concept. Please help me write this in a less-ugly way. I should also add comments explaining what is going on. r? @nikomatsakis
2016-05-16change on_unimplented logicAriel Ben-Yehuda-0/+2
2016-05-15Auto merge of #33505 - petrochenkov:self, r=nrcbors-0/+18
Remove ExplicitSelf from HIR `self` argument is already kept in the argument list and can be retrieved from there if necessary, so there's no need for the duplication. The same changes can be applied to AST, I'll make them in the next breaking batch. The first commit also improves parsing of method declarations and fixes https://github.com/rust-lang/rust/issues/33413. r? @eddyb
2016-05-15Auto merge of #33619 - jonathandturner:improve_structured_errors, r=nikomatsakisbors-45/+87
Batch of improvements to errors for new error format This is a batch of improvements to existing errors to help get the most out of the new error format. * Added labels to primary spans (^^^) for a set of errors that didn't currently have them * Highlight the source blue under the secondary notes for better readability * Move some of the "Note:" into secondary spans+labels * Fix span_label to take &mut instead, which makes it work the same as other methods in that set
2016-05-15Rollup merge of #33585 - GuillaumeGomez:error_code_test, r=steveklabnikManish Goregaokar-0/+242
Add compile-fail tests for error codes r? @steveklabnik cc @jonathandturner
2016-05-15Rollup merge of #33342 - birkenfeld:issue-26472, r=jseyfriedManish Goregaokar-0/+24
typeck: if a private field exists, also check for a public method For example, `Vec::len` is both a field and a method, and usually encountering `vec.len` just means that the parens were forgotten. Fixes: #26472 NOTE: I added the parameter `allow_private` to `method::exists` since I don't want to suggest inaccessible methods. For the second case, where only the method exists, I think it would make sense to set it to `false` as well, but I wanted to preserve compatibility for this case.
2016-05-14Add checks for `self: _` and `self: &_`Vadim Petrochenkov-0/+18
2016-05-13rewrite fuzzy `on_unimplemented` matching to avoid ICEsAriel Ben-Yehuda-64/+0
2016-05-13add cycle-reporting logicAriel Ben-Yehuda-0/+30
Fixes #33344
2016-05-13rewrite obligation forest. cycles still handled incorrectly.Ariel Ben-Yehuda-10/+17
2016-05-13Add compile-fail tests for error codesggomez-0/+242
2016-05-12Update errors to use new error formatJonathan Turner-45/+87
2016-05-12typeck: if a private field exists, also check for a public methodGeorg Brandl-0/+24
For example, `Vec::len` is both a field and a method, and usually encountering `vec.len` just means that the parens were forgotten. Fixes: #26472
2016-05-11Auto merge of #33169 - swgillespie:issue32829, r=eddybbors-0/+88
const_fn: Check the terminating expression of a block for blocks in a const initializer In a const or static initializer, the `CheckBlock` check ensures that blocks in the initializer expression are only in tail positions or in items. In this case, it didn't check the terminating expression of a block, which resulted in an ICE later in the compiler pipeline if the trailing expression was itself a block. This change fixes the ICE and ensures that the proper error is emitted. This fixes the ICE in #32829 .
2016-05-11Rollup merge of #33401 - GuillaumeGomez:index_indication, r=pnkfelixGuillaume Gomez-0/+119
Add rustc_on_unimplemented for Index implementation on slice Reopening of #31071. It also extends the possibility of `#[rustc_on_unimplemented]` by providing a small type filter in order to find the ones which corresponds the most. r? @pnkfelix
2016-05-11Rollup merge of #33539 - nikomatsakis:static-error, r=pnkfelixSteve Klabnik-0/+36
fix DFS for region error reporting This was causing terrible error reports, because the algorithm was incorrectly identifying the constraints. r? @eddyb
2016-05-11Improve weight algorithm and testsggomez-8/+27
2016-05-11Improve error message for Index trait on slicesGuillaume Gomez-0/+46
2016-05-11Extend rustc_on_unimplemented flag: if a message is available at an impl, ↵ggomez-0/+54
this message will be displayed instead
2016-05-10Add regression test for ICE in constant blocksSean Gillespie-0/+88
2016-05-10Auto merge of #33319 - birkenfeld:issue31424, r=jseyfriedbors-0/+30
borrowck: do not suggest to change "&mut self" to "&mut mut self" Matching the snippet string might not be the cleanest, but matching the AST node instead seems to end in a lot of nested `if let`s, so I don't know what's better. Of course it's entirely possible that there is another API altogether that I just don't know of? Fixes #31424.
2016-05-10fix DFS for region error reportingNiko Matsakis-0/+36
This was causing terrible error reports, because the algorithm was incorrectly identifying the constraints.
2016-05-10borrowck: do not suggest to change "&mut self" to "&mut mut self"Georg Brandl-0/+30
Matching the snippet string might not be the cleanest, but matching the AST node instead seems to end in a lot of nested `if let`s... Fixes #31424.