]> git.lizzy.rs Git - rust.git/commit
Address code review comments.
authorjumbatm <30644300+jumbatm@users.noreply.github.com>
Mon, 13 Jul 2020 13:06:35 +0000 (23:06 +1000)
committerjumbatm <30644300+jumbatm@users.noreply.github.com>
Thu, 30 Jul 2020 11:59:02 +0000 (21:59 +1000)
commit060666d0a4cb814328990d271ae9741f2d20cb0d
treef757bc62d1b9939bb2f05d06ea667b36d866fa55
parent5e52edca529ba5051d0bb752c751159d3057ab15
Address code review comments.

- Make `is_repr_nullable_ptr` freestanding again to avoid usage of
ImproperCTypesVisitor in ClashingExternDeclarations (and don't
accidentally revert the ParamEnv::reveal_all() fix from a week earlier)
- Revise match condition for 1 Adt, 1 primitive
- Generalise check for non-null type so that it would also work for
ranges which exclude any single value (all bits set, for example)
- Make is_repr_nullable_ptr return the representable type instead of
just a boolean, to avoid adding an additional, independent "source of
truth" about the FFI-compatibility of Option-like enums. Also, rename to
`repr_nullable_ptr`.
src/librustc_lint/builtin.rs
src/librustc_lint/types.rs
src/librustc_middle/ty/sty.rs
src/test/ui/lint/clashing-extern-fn.rs
src/test/ui/lint/clashing-extern-fn.stderr