File tree 1 file changed +22
-0
lines changed
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Things that we want a clang-tidy for
2
+
3
+ ## Closure concept usage
4
+ * Templates restricted as Fn are received as const&-ref
5
+ * Templates restricted as Fn are invoked as lvalue ` f() `
6
+ * Templates restricted as FnMut are received by value or as &-ref
7
+ * Templates restricted as FnMut are invoked as lvalue ` f() `
8
+ * Templates restricted as FnOnce are received as &&-ref or by value
9
+ * Templates restricted as FnOnce are invoked as rvalue ` sus::move(f)() `
10
+
11
+ ## References to closures
12
+ * FnOnceRef, FnMutRef and FnRef types only appear as lvalues as ParamVarDecl,
13
+ and are not returned.
14
+
15
+ ## Long-lived closures
16
+ * Think about how to rewrite FnBox to allow lambdas with capture if we use a
17
+ clang-tidy to ensure arguments are not stored as references carelessly.
18
+
19
+ ## Mutable references
20
+ * Passing an lvalue to a function receiving an lvalue-reference should require
21
+ the argument to be wrapped in ` sus::mref() ` . Probably exceptions for generic
22
+ code.
You can’t perform that action at this time.
0 commit comments