tree: af1da8466e381055db189df2e99aa3f3f2900c7e [path history] [tgz]
  1. alias-async.rs
  2. alias.rs
  3. assoc-async.rs
  4. assoc.rs
  5. lt-alias-async.rs
  6. lt-alias.rs
  7. lt-assoc-async.rs
  8. lt-assoc.rs
  9. lt-ref-self-async.nll.stderr
  10. lt-ref-self-async.rs
  11. lt-ref-self-async.stderr
  12. lt-ref-self.nll.stderr
  13. lt-ref-self.rs
  14. lt-ref-self.stderr
  15. lt-self-async.rs
  16. lt-self.rs
  17. lt-struct-async.rs
  18. lt-struct.rs
  19. multiple-ref-self-async.rs
  20. multiple-ref-self.rs
  21. README.md
  22. ref-alias-async.rs
  23. ref-alias.rs
  24. ref-assoc-async.rs
  25. ref-assoc.rs
  26. ref-mut-alias-async.rs
  27. ref-mut-alias.rs
  28. ref-mut-self-async.nll.stderr
  29. ref-mut-self-async.rs
  30. ref-mut-self-async.stderr
  31. ref-mut-self.nll.stderr
  32. ref-mut-self.rs
  33. ref-mut-self.stderr
  34. ref-mut-struct-async.nll.stderr
  35. ref-mut-struct-async.rs
  36. ref-mut-struct-async.stderr
  37. ref-mut-struct.nll.stderr
  38. ref-mut-struct.rs
  39. ref-mut-struct.stderr
  40. ref-self-async.nll.stderr
  41. ref-self-async.rs
  42. ref-self-async.stderr
  43. ref-self.nll.stderr
  44. ref-self.rs
  45. ref-self.stderr
  46. ref-struct-async.nll.stderr
  47. ref-struct-async.rs
  48. ref-struct-async.stderr
  49. ref-struct.nll.stderr
  50. ref-struct.rs
  51. ref-struct.stderr
  52. self-async.rs
  53. self.rs
  54. struct-async.rs
  55. struct.rs
src/test/ui/self/elision/README.md

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:

ConfidenceInterpretation
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 fileSelf typePatternCurrent elision behaviorConfidence
self.rsStructSelfignore self parameter100%
struct.rsStructStructignore self parameter100%
alias.rsStructAliasignore self parameter100%
ref-self.rsStruct&Selftake lifetime from &Self100%
ref-mut-self.rsStruct&mut Selftake lifetime from &mut Self100%
ref-struct.rsStruct&Structtake lifetime from &Self50%
ref-mut-struct.rsStruct&mut Structtake lifetime from &mut Self50%
ref-alias.rsStruct&Aliasignore Alias0%
ref-mut-alias.rsStruct&mut Aliasignore Alias0%
lt-self.rsStruct<'a>Selfignore Self (and hence 'a)25%
lt-struct.rsStruct<'a>Selfignore Self (and hence 'a)0%
lt-alias.rsAlias<'a>Selfignore Self (and hence 'a)0%
lt-ref-self.rsStruct<'a>&Selftake lifetime from &Self75%

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 filePass?Conforms to fn?How does it diverge?
fnasync fn
self-async.rsN/A
struct-async.rsN/A
alias-async.rsN/A
assoc-async.rsN/A
ref-self-async.rsXN/A
ref-mut-self-async.rsXN/A
ref-struct-async.rsXN/A
ref-mut-struct-async.rsXN/A
ref-alias-async.rsN/A
ref-assoc-async.rsN/A
ref-mut-alias-async.rsN/A
lt-self-async.rsN/A
lt-struct-async.rsN/A
lt-alias-async.rsN/A
lt-assoc-async.rsN/A
lt-ref-self-async.rsXN/A