Commit graph

64 commits

Author SHA1 Message Date
Ohad Ravid
2db744ca9d Improve coherence errors for wrong type order 2019-11-10 16:26:38 +01:00
Ohad Ravid
026aee62ac Stabilize the re_rebalance_coherence feature 2019-10-31 17:11:21 +01:00
Esteban Küber
95364df6bc Do not display ADT type arguments and fix rebase 2019-10-28 09:57:36 -07:00
Esteban Küber
db1bfbdbc0 Account for tuples in explanation 2019-10-28 09:57:36 -07:00
Esteban Küber
daeafd895d Talk about specific types and remove lifetimes from output 2019-10-28 09:57:36 -07:00
Esteban Küber
56aa89cdbe Further tweak spans for better readability 2019-10-28 09:57:36 -07:00
Esteban Küber
9b4f811b7f Use more targeted spans for orphan rule errors 2019-10-28 09:57:36 -07:00
Esteban Küber
adfe9a45d6 Call out the types that are non local on E0117 2019-10-28 09:56:53 -07:00
Mazdak Farrokhzad
53568f3fb3
Rollup merge of #65738 - ohadravid:re-rebalance-coherence-allow-fundamental-local, r=nikomatsakis
Coherence should allow fundamental types to impl traits when they are local

After #64414, `impl<T> Remote for Box<T> { }` is disallowed, but it is also disallowed in liballoc, where `Box` is a local type!

Enabling `#![feature(re_rebalance_coherence)]` in `liballoc` results in:
```
error[E0210]: type parameter `F` must be used as the type parameter for some local type (e.g., `MyStruct<F>`)
    --> src\liballoc\boxed.rs:1098:1
     |
1098 | impl<F: ?Sized + Future + Unpin> Future for Box<F> {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `F` must be used as the type parameter for some local type
```

This PR relaxes `uncover_fundamental_ty` to skip local fundamental types.
I didn't add a test since `liballoc` already fails to compile, but I can add one if needed.

r? @nikomatsakis

cc #63599
2019-10-27 16:46:52 +01:00
Ohad Ravid
8f988bd92c Coherence should allow fundamental types to impl traits 2019-10-26 13:08:50 +02:00
bors
4a8c5b20c7 Auto merge of #57545 - bovinebuddha:object_safe_for_dispatch, r=nikomatsakis
Object safe for dispatch

cc #43561
2019-10-23 13:34:27 +00:00
Yuki Okushi
557d27637d
Rollup merge of #65417 - weiznich:more_coherence_tests, r=nikomatsakis
Add more coherence tests

I've wrote the missing test cases listed in [this google doc](https://docs.google.com/spreadsheets/d/1WlroTEXE6qxxGvEOhICkUpqguYZP9YOZEvnmEtSNtM0/edit#gid=0)

> The other thing that might be useful is to rename the existing tests so they all fit the new naming scheme we were using.

I'm not entirely sure how to do this. If everything from the google sheet is covered could I just remove the remaining tests in `src/test/ui/coherence` or is there something in there that should remain?

cc #63599

r? @nikomatsakis
2019-10-23 17:14:31 +09:00
Mathias Blikstad
ef5acdeceb RFC 2027: "first draft" of implementation
These are a squashed series of commits.
2019-10-22 15:24:33 -04:00
Georg Semmler
7e17ea37b7
Fix test paths 2019-10-19 16:02:21 +02:00
Georg Semmler
77f0aaf0d0
Add more coherence tests 2019-10-14 23:14:09 +02:00
Alexander Regueiro
13b61b50d9 Fixed grammar in one diagnostic and blessed tests. 2019-09-30 01:15:25 +01:00
bors
d046ffddc4 Auto merge of #64546 - weiznich:bugfix/rfc-2451-rerebalance-tests, r=nikomatsakis
Bugfix/rfc 2451 rerebalance tests

r? @nikomatsakis

Fixes #64412
Depends/Contains on #64414

cc #55437 and #63599
2019-09-29 09:52:58 +00:00
Georg Semmler
9249a7393c
More path name fixes 2019-09-24 23:56:25 +02:00
Georg Semmler
2666ae5caa
Remove whitespace from testname 2019-09-23 21:29:12 +02:00
Georg Semmler
3ee292021d
Fix some unused variable warnings 2019-09-22 12:59:10 +02:00
James Munns
333230fd14 Restore whitespace 2019-09-19 00:50:03 +02:00
James Munns
f233a4c18b Fix a minor grammar nit, update UI tests 2019-09-19 00:16:16 +02:00
Georg Semmler
31b301219f
Split line to fix tidy 2019-09-18 22:36:04 +02:00
Georg Semmler
a9c38d9d01
Add more tests 2019-09-18 22:14:33 +02:00
Georg Semmler
3f004a1bc4
Fix re-rebalance coherence implementation for fundamental types
Fixes #64412
2019-09-17 14:40:36 +02:00
Mark Rousskov
959c710e85 Permit impls referencing errors to overlap 2019-09-15 08:33:00 -04:00
Niko Matsakis
e69d1b67b6 change to check-pass 2019-09-13 15:15:50 -04:00
Niko Matsakis
612ef5f518 add new tests for re_rebalance_coherence 2019-09-13 15:15:50 -04:00
Esteban Küber
5799fb419c Give method not found a primary span label 2019-09-08 18:27:02 -07:00
Esteban Küber
efe85943b3 account for DUMMY_SP and correct wording 2019-09-02 22:11:29 -07:00
Esteban Küber
c1e5e5c567 On object safety violation, point at source when possible 2019-09-02 20:22:22 -07:00
Ariel Ben-Yehuda
95f29aa81b Revert "Rollup merge of #62696 - chocol4te:fix_#62194, r=estebank"
This reverts commit df21a6f040, reversing
changes made to cc16d04869.
2019-08-04 19:52:43 +03:00
Vadim Petrochenkov
5486cc69bd tests: Move run-pass tests with naming conflicts to ui 2019-07-27 18:56:17 +03:00
Vadim Petrochenkov
9be35f82c1 tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
Ferdia McKeogh
2ced474e80
Check that trait is exported or public before adding intercrate ambiguity hint 2019-07-16 07:53:30 +02:00
Yuki Okushi
c004451a20 Migrate compile-pass annotations to build-pass 2019-07-03 06:30:28 +09:00
bors
2cd5ed495c Auto merge of #61778 - petrochenkov:pass, r=Mark-Simulacrum
compiletest: Introduce `// {check,build,run}-pass` pass modes

Pass UI tests now have three modes
```
// check-pass
// build-pass
// run-pass
```
mirroring equivalent well-known `cargo` commands.

`// check-pass` will compile the test skipping codegen (which is expensive and isn't supposed to fail in most cases).
`// build-pass` will compile and link the test without running it.
`// run-pass` will compile, link and run the test.
Tests without a "pass" annotation are still considered "fail" tests.

Most UI tests would probably want to switch to `check-pass`.
Tests validating codegen would probably want to run the generated code as well and use `run-pass`.
`build-pass` should probably be rare (linking tests?).

https://github.com/rust-lang/rust/pull/61755 will provide a way to run the tests with any mode, e.g. bump `check-pass` tests to `run-pass` to satisfy especially suspicious people, and be able to make sure that codegen doesn't breaks in some entirely unexpected way.
Tests marked with any mode are expected to pass with any other mode, if that's not the case for some legitimate reason, then the test should be made a "fail" test rather than a "pass" test.
Perhaps some secondary CI can verify this invariant, but that's not super urgent.

`// compile-pass` still works and is equivalent to `build-pass`.
Why is `// compile-pass` bad - 1) it gives an impression that the test is only compiled, but not linked, 2) it doesn't mirror a cargo command.
It can be removed some time in the future in a separate PR.

cc https://github.com/rust-lang/rust/issues/61712
2019-06-23 17:16:22 +00:00
Vadim Petrochenkov
932ea64175 compiletest: Remove skip-codegen 2019-06-16 12:23:22 +03:00
Yuki Okushi
047f9bc94d Add explanation for E0592 2019-06-14 11:19:21 +09:00
memoryruins
eb4580a570 Update ui test suite to use dyn 2019-05-29 00:57:31 -04:00
varkor
9736d32f84 Remove leading newlines 2019-04-22 17:01:33 +01:00
Andy Russell
b6f148c8bd
hide --explain hint if error has no extended info 2019-04-18 13:29:28 -04:00
Vadim Petrochenkov
fa72a81bea Update tests 2019-03-11 23:10:26 +03:00
Niko Matsakis
21e9478366 update test files to reflect new output
One surprise: old-lub-glb-object.rs, may indicate a bug
2019-02-21 11:32:17 -05:00
Ariel Ben-Yehuda
d38a59f8b5 fix test output changing in rebase 2019-01-15 00:27:00 +02:00
Ariel Ben-Yehuda
de6566ce39 forbid manually impl'ing one of an object type's marker traits
This shouldn't break compatibility for crates that do not use
`feature(optin_builtin_traits)`, because as the test shows, it is
only possible to impl a marker trait for a trait object in the crate the
marker trait is defined in, which must define
`feature(optin_builtin_traits)`.

Fixes #56934
2019-01-13 19:44:28 +02:00
Yuki Okushi
6a790d3786 Improve the wording 2019-01-08 02:32:14 +09:00
Georg Semmler
d758e4db78
Update tests changed by rebase 2019-01-04 10:19:22 +01:00
Georg Semmler
2bc436e713
Add missing files 2019-01-03 22:27:12 +01:00
Georg Semmler
464b4dcb2b
Unify tests
Implement compile tests as variants of existing tests
2019-01-03 22:27:06 +01:00