]> git.lizzy.rs Git - rust.git/blob - src/librustc_error_codes/error_codes/E0178.md
Rollup merge of #62514 - stephaneyfx:box-ffi, r=nikomatsakis
[rust.git] / src / librustc_error_codes / error_codes / E0178.md
1 In types, the `+` type operator has low precedence, so it is often necessary
2 to use parentheses.
3
4 For example:
5
6 ```compile_fail,E0178
7 trait Foo {}
8
9 struct Bar<'a> {
10     w: &'a Foo + Copy,   // error, use &'a (Foo + Copy)
11     x: &'a Foo + 'a,     // error, use &'a (Foo + 'a)
12     y: &'a mut Foo + 'a, // error, use &'a mut (Foo + 'a)
13     z: fn() -> Foo + 'a, // error, use fn() -> (Foo + 'a)
14 }
15 ```
16
17 More details can be found in [RFC 438].
18
19 [RFC 438]: https://github.com/rust-lang/rfcs/pull/438