forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#137769 - compiler-errors:empty-unsafe-fmt, r=ytmimi Do not yeet `unsafe<>` from type when formatting unsafe binder Unsafe binders are types like `unsafe<'a, 'b> Ty<'a, 'b>`. However, users can also specify unsafe binder types with no bound vars, like `unsafe<> Ty`. When I added nightly formatting for unsafe binders, I didn't consider this, so on nightly we are stripping the `unsafe<>` part, which gives us back `Ty` which is a different type! This PR fixes that. r? ``@ytmimi``
- Loading branch information
Showing
3 changed files
with
10 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,6 @@ struct Foo { | |
struct Bar(unsafe<'a> &'a ()); | ||
|
||
impl Trait for unsafe<'a> &'a () {} | ||
|
||
fn empty() | ||
-> unsafe<> () {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,5 @@ struct Foo { | |
struct Bar(unsafe<'a> &'a ()); | ||
|
||
impl Trait for unsafe<'a> &'a () {} | ||
|
||
fn empty() -> unsafe<> () {} |