]> git.lizzy.rs Git - rust.git/commit
Merge #5684
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>
Sat, 8 Aug 2020 16:45:37 +0000 (16:45 +0000)
committerGitHub <noreply@github.com>
Sat, 8 Aug 2020 16:45:37 +0000 (16:45 +0000)
commit8a57afe5a4bfab40072a83f7dc4ca560bf860919
tree167d3717945c94c7523bbda5018239ed3a1c5fca
parenteed05a95b47c00bf6ce06e156716cd0648a88fb2
parentbe935b2b56dcbda5a5918d8c600552b0adbb3a96
Merge #5684

5684: Semantic highlighting for unsafe union field access r=jonas-schievink a=Nashenas88

This change adds support for unions in inference and lowering, then extends on that to add the unsafe semantic modifier on field access only. The `is_possibly_unsafe` function in `syntax_highlighting.rs` could be extended to support fns and static muts so that their definitions are not highlighted as unsafe, but only their usage.

Also, each commit of this PR updates the tests. By reviewing the files by commit, it's easy to see how the changes in the code affected the tests.

Co-authored-by: Paul Daniel Faria <Nashenas88@users.noreply.github.com>
crates/ra_ide/src/syntax_highlighting.rs
crates/ra_ide/src/syntax_highlighting/tests.rs
crates/ra_ide/test_data/highlight_unsafe.html