Commit Graph

47 Commits

Author SHA1 Message Date
Esteban Küber
1b0ab0b8a9 Tweak spans for E0599 2019-03-23 13:05:29 -07:00
Vadim Petrochenkov
c1cfacfb13 Update NLL tests 2019-03-11 23:18:35 +03:00
Vadim Petrochenkov
fa72a81bea Update tests 2019-03-11 23:10:26 +03:00
Alexander Regueiro
370f1f26ce Added tests. 2019-02-12 14:33:58 +00:00
varkor
455d659e91 Update tests
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-02-07 15:02:17 +01:00
Simon Sapin
fb5d3c1f37 Stabilize Any::get_type_id and rename to type_id
FCP: https://github.com/rust-lang/rust/issues/27745#issuecomment-373906749
2019-01-22 14:25:27 +01:00
Mazdak Farrokhzad
5272be5b5e
Rollup merge of #57502 - nikomatsakis:fix-trait-alias-1b, r=nikomatsakis
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-19 14:21:18 +01:00
Mazdak Farrokhzad
2f7a226c4d
Rollup merge of #57540 - estebank:eval-more, r=petrochenkov
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-14 20:31:55 +01:00
Esteban Küber
28ea03e114 Suggest correct location for lifetime parameters in use 2019-01-12 19:25:03 -08:00
Esteban Küber
fc4b54157f Continue parsing after lifetime in incorrect location 2019-01-11 19:41:43 -08:00
Niko Matsakis
b411994b3b new trait alias tests
Co-authored-by: Alexander Regueiro <alexreg@me.com>
2019-01-10 17:04:26 -05:00
Andy Russell
404ad50d14
clarify resolve typo suggestion
Include the kind of the binding that we're suggesting, and use a
structured suggestion.
2019-01-09 14:11:00 -05:00
Corey Farwell
d2c91a1a6d Fix broken links to second edition TRPL.
Fixes https://github.com/rust-lang/rust/issues/57104.
2019-01-01 12:53:07 -05:00
Alexander Regueiro
58a5756f4d Fixed more tests. 2018-12-26 21:40:21 +00:00
Mark Rousskov
2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
Andy Russell
6474de904c
make non_camel_case_types an early lint 2018-12-24 12:58:52 -05:00
Ariel Ben-Yehuda
1fd23f56f3 improve tests as suggested by review comments 2018-12-18 00:33:21 +02:00
Ariel Ben-Yehuda
baf9f0173c fix trait objects with a Self-having projection va
This follows ALT2 in the issue.

Fixes #56288.
2018-12-16 00:00:46 +02:00
Guillaume Gomez
05cea31c8d fix span for invalid number of parameters in trait method 2018-12-08 20:04:14 +01:00
Oliver Scherer
61efc3b71b Update tests 2018-12-04 10:06:05 +01:00
Esteban Küber
510f836d23 Do not point at associated types from other crates
This is a somewhat arbitrary restriction in order to be consistent in the
output of the tests regardless of target platform.
2018-11-22 14:30:33 -08:00
Esteban Küber
a5d35631fe Reword and fix test 2018-11-22 14:14:27 -08:00
Esteban Küber
b6f4b29c6d Point at the associated type's def span 2018-11-22 14:14:27 -08:00
Pietro Albini
0e912b2c17
Rollup merge of #55687 - alexreg:fix-24010, r=scalexm
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-11 00:21:11 +01:00
Alexander Regueiro
7d9ee0314a Only do check for trait objects, not trait or trait alias definitions. 2018-11-07 21:57:45 +00:00
Alexander Regueiro
6d3ee4170d Added error for duplicate bindings of associated type. 2018-11-07 21:57:45 +00:00
Alexander Regueiro
0e89f570d2 Added tests. 2018-11-07 21:57:40 +00:00
Felix S. Klock II
a2e090624e Removed #[rustc_error] from tests that are all // compile-pass.
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-07 13:09:52 +01:00
bors
a3f0f5107e Auto merge of #55101 - alexreg:trait-aliases, r=nikomatsakis
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
2018-11-03 17:30:37 +00:00
Alexander Regueiro
c04559fe9e Added WF checking for trait alias definitions. 2018-11-03 04:09:35 +00:00
Alexander Regueiro
4bdc3d833a Extended elaboration for trait aliases to include arbitrary bounds. 2018-11-03 04:09:34 +00:00
Alexander Regueiro
a8fcfcef30 Add more tests. 2018-11-03 04:09:34 +00:00
Alexander Regueiro
4751953d5f Added tests. 2018-11-03 04:09:34 +00:00
Michael Hewson
a0f23f8405 update tests that have changed output
I’m not sure why these tests have different output now, but they do.
In all cases, the error message that is missing looks like this: “the
trait bound `dyn Trait: Trait` is not satisfied”

My guess is that the error message is going away because object-safety
now involves trait solving, and these extra error messages are no
longer leaking out.
2018-11-01 18:16:22 -04:00
Matthew Jasper
2a3969a3f7 Use new region infer errors for explaining borrows
This gives at least some explanation for why a borrow is expected to
last for a certain free region. Also:

* Reports E0373: "closure may outlive the current function" with NLL.
* Special cases the case of returning a reference to (or value
  referencing) a local variable or temporary (E0515).
* Special case assigning a reference to a local variable in a closure
  to a captured variable.
2018-10-21 12:35:00 +01:00
Oliver Scherer
8180e1b54c Check the type of statics and constants for Sizedness 2018-10-16 17:01:24 +02:00
Zack M. Davis
a5de379b55 structured suggestion for E0223 ambiguous associated type
It looks like we tend to use angle-brackets around the placeholder in
the few other places we use `Applicability::HasPlaceholders`, but that
would be confusing here, so ...
2018-10-11 21:10:35 -07:00
Jonas Schievink
e24f4d57b0 Convert conservative_impl_trait.rs to compile-pass 2018-10-04 14:57:31 +02:00
Matthew Russo
79afc6e9e8 updates tests to use new error code 2018-08-24 08:51:25 -04:00
varkor
aa3b5c58e4 Fix diagnostic regression 2018-08-20 16:16:39 +01:00
varkor
b5c2470ba3 Update new ui tests 2018-08-20 00:08:01 +01:00
varkor
4722744e4d Fix some remaining tests 2018-08-19 20:03:02 +01:00
varkor
49c45734c0 Refactor generic argument count check in astconv 2018-08-19 20:02:34 +01:00
varkor
ccef306b96 Revert broken test 2018-08-19 20:02:34 +01:00
varkor
9cfe92c8ae "Fix" annoying test 2018-08-19 20:02:33 +01:00
Masaki Hara
e2b95cb70e Lift some Sized checks. 2018-08-19 08:07:33 +09:00
David Wood
3fc7ab2373
Merged migrated compile-fail tests and ui tests. Fixes #46841. 2018-08-14 11:12:09 +02:00