diff options
Diffstat (limited to 'src/tools/clippy/src/docs/boxed_local.txt')
-rw-r--r-- | src/tools/clippy/src/docs/boxed_local.txt | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/tools/clippy/src/docs/boxed_local.txt b/src/tools/clippy/src/docs/boxed_local.txt new file mode 100644 index 000000000..8b1febf14 --- /dev/null +++ b/src/tools/clippy/src/docs/boxed_local.txt @@ -0,0 +1,18 @@ +### What it does +Checks for usage of `Box<T>` where an unboxed `T` would +work fine. + +### Why is this bad? +This is an unnecessary allocation, and bad for +performance. It is only necessary to allocate if you wish to move the box +into something. + +### Example +``` +fn foo(x: Box<u32>) {} +``` + +Use instead: +``` +fn foo(x: u32) {} +```
\ No newline at end of file |