Rollup merge of #72818 - GuillaumeGomez:cleanup-e0622, r=Dylan-DPC

Clean up E0622 explanation

r? @Dylan-DPC
This commit is contained in:
Dylan DPC 2020-06-01 03:14:10 +02:00 committed by GitHub
commit 2e3417a82d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,8 +5,7 @@ Erroneous code example:
```compile_fail,E0622
#![feature(intrinsics)]
extern "rust-intrinsic" {
pub static breakpoint : unsafe extern "rust-intrinsic" fn();
// error: intrinsic must be a function
pub static breakpoint : fn(); // error: intrinsic must be a function
}
fn main() { unsafe { breakpoint(); } }
@ -14,4 +13,13 @@ fn main() { unsafe { breakpoint(); } }
An intrinsic is a function available for use in a given programming language
whose implementation is handled specially by the compiler. In order to fix this
error, just declare a function.
error, just declare a function. Example:
```no_run
#![feature(intrinsics)]
extern "rust-intrinsic" {
pub fn breakpoint(); // ok!
}
fn main() { unsafe { breakpoint(); } }
```