]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #39202 - estebank:nested-unsafe, r=jonathandturner
authorAlex Crichton <alex@alexcrichton.com>
Fri, 10 Mar 2017 22:51:12 +0000 (16:51 -0600)
committerGitHub <noreply@github.com>
Fri, 10 Mar 2017 22:51:12 +0000 (16:51 -0600)
Point to enclosing block/fn on nested unsafe

When declaring nested unsafe blocks (`unsafe {unsafe {}}`) that trigger
the "unnecessary `unsafe` block" error, point out the enclosing `unsafe
block` or `unsafe fn` that makes it unnecessary.

<img width="621" alt="" src="https://cloud.githubusercontent.com/assets/1606434/22139922/26ad468a-de9e-11e6-8884-2945be882ea8.png">

Fixes #39144.


Trivial merge