rust/src/test/ui/self/elision
John Kåre Alsaker 47a84f2170 Update tests
2020-03-23 19:31:41 +01:00
..
alias-async.rs Stabilize nested self receivers 2019-11-26 13:35:33 -08:00
alias.rs Stabilize nested self receivers 2019-11-26 13:35:33 -08:00
assoc-async.rs Stabilize nested self receivers 2019-11-26 13:35:33 -08:00
assoc.rs Stabilize nested self receivers 2019-11-26 13:35:33 -08:00
lt-alias-async.rs Stabilize nested self receivers 2019-11-26 13:35:33 -08:00
lt-alias.rs Stabilize nested self receivers 2019-11-26 13:35:33 -08:00
lt-assoc-async.rs Stabilize nested self receivers 2019-11-26 13:35:33 -08:00
lt-assoc.rs Stabilize nested self receivers 2019-11-26 13:35:33 -08:00
lt-ref-self-async.nll.stderr update tests 2020-03-12 15:47:36 -05:00
lt-ref-self-async.rs Stabilize nested self receivers 2019-11-26 13:35:33 -08:00
lt-ref-self-async.stderr Stabilize nested self receivers 2019-11-26 13:35:33 -08:00
lt-ref-self.nll.stderr update tests 2020-03-12 15:47:36 -05:00
lt-ref-self.rs Stabilize nested self receivers 2019-11-26 13:35:33 -08:00
lt-ref-self.stderr Stabilize nested self receivers 2019-11-26 13:35:33 -08:00
lt-self-async.rs Stabilize nested self receivers 2019-11-26 13:35:33 -08:00
lt-self.rs Stabilize nested self receivers 2019-11-26 13:35:33 -08:00
lt-struct-async.rs Stabilize nested self receivers 2019-11-26 13:35:33 -08:00
lt-struct.rs Stabilize nested self receivers 2019-11-26 13:35:33 -08:00
multiple-ref-self-async.rs Remove async_await gates from tests. 2019-08-20 03:08:42 +02:00
multiple-ref-self.rs Add test for multiple ref-self 2019-07-27 12:28:06 +09:00
README.md fix README.md 2019-08-12 19:23:21 -04:00
ref-alias-async.rs Stabilize nested self receivers 2019-11-26 13:35:33 -08:00
ref-alias.rs Stabilize nested self receivers 2019-11-26 13:35:33 -08:00
ref-assoc-async.rs Stabilize nested self receivers 2019-11-26 13:35:33 -08:00
ref-assoc.rs Stabilize nested self receivers 2019-11-26 13:35:33 -08:00
ref-mut-alias-async.rs Stabilize nested self receivers 2019-11-26 13:35:33 -08:00
ref-mut-alias.rs Stabilize nested self receivers 2019-11-26 13:35:33 -08:00
ref-mut-self-async.nll.stderr update tests 2020-03-12 15:47:36 -05:00
ref-mut-self-async.rs Stabilize nested self receivers 2019-11-26 13:35:33 -08:00
ref-mut-self-async.stderr Stabilize nested self receivers 2019-11-26 13:35:33 -08:00
ref-mut-self.nll.stderr update tests 2020-03-12 15:47:36 -05:00
ref-mut-self.rs Stabilize nested self receivers 2019-11-26 13:35:33 -08:00
ref-mut-self.stderr Stabilize nested self receivers 2019-11-26 13:35:33 -08:00
ref-mut-struct-async.nll.stderr update tests 2020-03-12 15:47:36 -05:00
ref-mut-struct-async.rs Stabilize nested self receivers 2019-11-26 13:35:33 -08:00
ref-mut-struct-async.stderr Stabilize nested self receivers 2019-11-26 13:35:33 -08:00
ref-mut-struct.nll.stderr update tests 2020-03-12 15:47:36 -05:00
ref-mut-struct.rs Stabilize nested self receivers 2019-11-26 13:35:33 -08:00
ref-mut-struct.stderr Stabilize nested self receivers 2019-11-26 13:35:33 -08:00
ref-self-async.nll.stderr Update tests 2020-03-23 19:31:41 +01:00
ref-self-async.rs Update tests 2020-03-23 19:31:41 +01:00
ref-self-async.stderr Update tests 2020-03-23 19:31:41 +01:00
ref-self.nll.stderr update tests 2020-03-12 15:47:36 -05:00
ref-self.rs Add test for multiple ref-self 2019-07-27 12:28:06 +09:00
ref-self.stderr Update ui tests 2019-11-07 13:02:34 +01:00
ref-struct-async.nll.stderr update tests 2020-03-12 15:47:36 -05:00
ref-struct-async.rs Stabilize nested self receivers 2019-11-26 13:35:33 -08:00
ref-struct-async.stderr Stabilize nested self receivers 2019-11-26 13:35:33 -08:00
ref-struct.nll.stderr update tests 2020-03-12 15:47:36 -05:00
ref-struct.rs Stabilize nested self receivers 2019-11-26 13:35:33 -08:00
ref-struct.stderr Stabilize nested self receivers 2019-11-26 13:35:33 -08:00
self-async.rs Stabilize nested self receivers 2019-11-26 13:35:33 -08:00
self.rs Stabilize nested self receivers 2019-11-26 13:35:33 -08:00
struct-async.rs Stabilize nested self receivers 2019-11-26 13:35:33 -08:00
struct.rs Stabilize nested self receivers 2019-11-26 13:35:33 -08:00

Test cases intended to document behavior and try to exhaustively explore the combinations.

Confidence

These tests are not yet considered 100% normative, in that some aspects of the current behavior are not desirable. This is expressed in the "confidence" field in the following table. Values:

Confidence Interpretation
100% this will remain recommended behavior
75% unclear whether we will continue to accept this
50% this will likely be deprecated but remain valid
25% this could change in the future
0% this is definitely bogus and will likely change in the future in some way

Tests

Test file Self type Pattern Current elision behavior Confidence
self.rs Struct Self ignore self parameter 100%
struct.rs Struct Struct ignore self parameter 100%
alias.rs Struct Alias ignore self parameter 100%
ref-self.rs Struct &Self take lifetime from &Self 100%
ref-mut-self.rs Struct &mut Self take lifetime from &mut Self 100%
ref-struct.rs Struct &Struct take lifetime from &Self 50%
ref-mut-struct.rs Struct &mut Struct take lifetime from &mut Self 50%
ref-alias.rs Struct &Alias ignore Alias 0%
ref-mut-alias.rs Struct &mut Alias ignore Alias 0%
lt-self.rs Struct<'a> Self ignore Self (and hence 'a) 25%
lt-struct.rs Struct<'a> Self ignore Self (and hence 'a) 0%
lt-alias.rs Alias<'a> Self ignore Self (and hence 'a) 0%
lt-ref-self.rs Struct<'a> &Self take lifetime from &Self 75%

In each case, we test the following patterns:

  • self: XXX
  • self: Box<XXX>
  • self: Pin<XXX>
  • self: Box<Box<XXX>>
  • self: Box<Pin<XXX>>

In the non-reference cases, Pin causes errors so we substitute Rc.

async fn

For each of the tests above we also check that async fn behaves as an fn would. These tests are in files named *-async.rs.

Legends:

  • ✓ ⟹ Yes / Pass
  • X ⟹ No
  • α ⟹ lifetime mismatch
  • β ⟹ cannot infer an appropriate lifetime
  • γ ⟹ missing lifetime specifier
async file Pass? Conforms to fn? How does it diverge?
fnasync fn
self-async.rs N/A
struct-async.rs N/A
alias-async.rs N/A
assoc-async.rs N/A
ref-self-async.rs X N/A
ref-mut-self-async.rs X N/A
ref-struct-async.rs X N/A
ref-mut-struct-async.rs X N/A
ref-alias-async.rs N/A
ref-assoc-async.rs N/A
ref-mut-alias-async.rs N/A
lt-self-async.rs N/A
lt-struct-async.rs N/A
lt-alias-async.rs N/A
lt-assoc-async.rs N/A
lt-ref-self-async.rs X N/A