Skip to content

Rollup of 7 pull requests #68319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 22 commits into from
Closed
Changes from 2 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
6421127
Update rustc-guide
JohnTitor Jan 6, 2020
12f029b
Fix deref impl on type alias
GuillaumeGomez Jan 10, 2020
fd4a88f
Add test for typedef deref
GuillaumeGomez Jan 10, 2020
81a5b94
formatting
GuillaumeGomez Jan 10, 2020
6e79146
remove unneeded code from cache.rs
GuillaumeGomez Jan 15, 2020
e6ad49a
Include type alias implementations
GuillaumeGomez Jan 15, 2020
d755238
Simplify deref impls for type aliases
GuillaumeGomez Jan 15, 2020
8a9b951
Fix rendering on sidebar and update tests
GuillaumeGomez Jan 15, 2020
25a8f94
Don't warn about snake case for field puns that don't introduce a new…
jumbatm Nov 23, 2019
3094c37
Improve code readability
GuillaumeGomez Jan 16, 2020
cdc828e
Stop treating `FalseEdges` and `FalseUnwind` as having semantic value…
oli-obk Jan 17, 2020
a91f77c
Add regression test for integer literals in generic arguments in wher…
varkor Jan 17, 2020
9c6c2f1
Clean up E0198 explanation
GuillaumeGomez Jan 16, 2020
482dc77
formatting
GuillaumeGomez Jan 17, 2020
e8a4b93
Clean up E0199 explanation
GuillaumeGomez Jan 17, 2020
2ec99ce
Rollup merge of #66660 - jumbatm:dont_warn_about_snake_case_in_patter…
tmandry Jan 17, 2020
ce3bfeb
Rollup merge of #67940 - JohnTitor:rustc-guide, r=JohnTitor
tmandry Jan 17, 2020
7f44666
Rollup merge of #68093 - GuillaumeGomez:fix-deref-impl-typedef, r=oli…
tmandry Jan 17, 2020
fe413c7
Rollup merge of #68279 - GuillaumeGomez:clean-up-e0198, r=Dylan-DPC
tmandry Jan 17, 2020
66ce826
Rollup merge of #68312 - varkor:issue-67753-regression, r=Centril
tmandry Jan 17, 2020
0f849b9
Rollup merge of #68314 - oli-obk:true_unwind, r=eddyb
tmandry Jan 17, 2020
b7af138
Rollup merge of #68317 - GuillaumeGomez:clean-up-e0199, r=Dylan-DPC
tmandry Jan 17, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions src/librustc_error_codes/error_codes/E0198.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
A negative implementation is one that excludes a type from implementing a
particular trait. Not being able to use a trait is always a safe operation,
so negative implementations are always safe and never need to be marked as
unsafe.
A negative implementation was marked as unsafe.

```compile_fail
#![feature(optin_builtin_traits)]
Erroneous code example:

```compile_fail
struct Foo;

// unsafe is unnecessary
unsafe impl !Clone for Foo { }
unsafe impl !Clone for Foo { } // error!
```

A negative implementation is one that excludes a type from implementing a
particular trait. Not being able to use a trait is always a safe operation,
so negative implementations are always safe and never need to be marked as
unsafe.

This will compile:

```ignore (ignore auto_trait future compatibility warning)
Expand Down