tree: dbe52c0b4935aac0e220df1dbfaf17a2d5fd37cd [path history] [tgz]
  1. alias-async.rs
  2. alias.rs
  3. assoc-async.rs
  4. assoc.rs
  5. ignore-non-reference-lifetimes.rs
  6. ignore-non-reference-lifetimes.stderr
  7. lt-alias-async.rs
  8. lt-alias.rs
  9. lt-assoc-async.rs
  10. lt-assoc.rs
  11. lt-ref-self-async.fixed
  12. lt-ref-self-async.rs
  13. lt-ref-self-async.stderr
  14. lt-ref-self.fixed
  15. lt-ref-self.rs
  16. lt-ref-self.stderr
  17. lt-self-async.rs
  18. lt-self.rs
  19. lt-struct-async.rs
  20. lt-struct.rs
  21. multiple-ref-self-async.rs
  22. multiple-ref-self-async.stderr
  23. multiple-ref-self.rs
  24. multiple-ref-self.stderr
  25. nested-item.rs
  26. nested-item.stderr
  27. no-shadow-pin-self.rs
  28. no-shadow-pin-self.stderr
  29. README.md
  30. ref-alias-async.rs
  31. ref-alias.rs
  32. ref-assoc-async.rs
  33. ref-assoc-async.stderr
  34. ref-assoc.rs
  35. ref-assoc.stderr
  36. ref-mut-alias-async.rs
  37. ref-mut-alias.rs
  38. ref-mut-self-async.rs
  39. ref-mut-self-async.stderr
  40. ref-mut-self.fixed
  41. ref-mut-self.rs
  42. ref-mut-self.stderr
  43. ref-mut-struct-async.rs
  44. ref-mut-struct-async.stderr
  45. ref-mut-struct.fixed
  46. ref-mut-struct.rs
  47. ref-mut-struct.stderr
  48. ref-self-async.rs
  49. ref-self-async.stderr
  50. ref-self-multi.rs
  51. ref-self-multi.stderr
  52. ref-self.fixed
  53. ref-self.rs
  54. ref-self.stderr
  55. ref-struct-async.rs
  56. ref-struct-async.stderr
  57. ref-struct.fixed
  58. ref-struct.rs
  59. ref-struct.stderr
  60. self-async.rs
  61. self.rs
  62. struct-async.rs
  63. struct.rs
tests/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