diff options
| author | bors <bors@rust-lang.org> | 2020-03-23 06:02:34 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-03-23 06:02:34 +0000 |
| commit | 8ff785011be6625e32afceee3a08e5cff7470feb (patch) | |
| tree | f9a842b8f8e390c261192943061f48d6754f65da /src/librustc_error_codes/error_codes | |
| parent | 37c945dd6178cb520eb1e450a795f8c3b3cc5a3b (diff) | |
| parent | 5f91f30b0ace8a687e1acd2e057e27d4b57ad364 (diff) | |
| download | rust-8ff785011be6625e32afceee3a08e5cff7470feb.tar.gz rust-8ff785011be6625e32afceee3a08e5cff7470feb.zip | |
Auto merge of #70296 - Centril:rollup-wvfmb3n, r=Centril
Rollup of 9 pull requests Successful merges: - #69251 (#[track_caller] in traits) - #69880 (miri engine: turn error sanity checks into assertions) - #70207 (Use getentropy(2) on macos) - #70227 (Only display definition when suggesting a typo) - #70236 (resolve: Avoid "self-confirming" import resolutions in one more case) - #70248 (parser: simplify & remove unused field) - #70249 (handle ConstKind::Unresolved after monomorphizing) - #70269 (remove redundant closures (clippy::redundant_closure)) - #70270 (Clean up E0449 explanation) Failed merges: r? @ghost
Diffstat (limited to 'src/librustc_error_codes/error_codes')
| -rw-r--r-- | src/librustc_error_codes/error_codes/E0449.md | 5 | ||||
| -rw-r--r-- | src/librustc_error_codes/error_codes/E0738.md | 45 |
2 files changed, 7 insertions, 43 deletions
diff --git a/src/librustc_error_codes/error_codes/E0449.md b/src/librustc_error_codes/error_codes/E0449.md index a3eb51961d3..9afc67689bf 100644 --- a/src/librustc_error_codes/error_codes/E0449.md +++ b/src/librustc_error_codes/error_codes/E0449.md @@ -1,5 +1,6 @@ -A visibility qualifier was used when it was unnecessary. Erroneous code -examples: +A visibility qualifier was used when it was unnecessary. + +Erroneous code examples: ```compile_fail,E0449 struct Bar; diff --git a/src/librustc_error_codes/error_codes/E0738.md b/src/librustc_error_codes/error_codes/E0738.md index 4c9588ef7b6..8f31b701e49 100644 --- a/src/librustc_error_codes/error_codes/E0738.md +++ b/src/librustc_error_codes/error_codes/E0738.md @@ -1,48 +1,11 @@ -`#[track_caller]` cannot be used in traits yet. This is due to limitations in -the compiler which are likely to be temporary. See [RFC 2091] for details on -this and other restrictions. +`#[track_caller]` cannot be used to annotate foreign functions. -Erroneous example with a trait method implementation: +Erroneous example: ```compile_fail,E0738 #![feature(track_caller)] - -trait Foo { - fn bar(&self); -} - -impl Foo for u64 { - #[track_caller] - fn bar(&self) {} -} -``` - -Erroneous example with a blanket trait method implementation: - -```compile_fail,E0738 -#![feature(track_caller)] - -trait Foo { +extern "Rust" { #[track_caller] - fn bar(&self) {} - fn baz(&self); + fn bar(); } ``` - -Erroneous example with a trait method declaration: - -```compile_fail,E0738 -#![feature(track_caller)] - -trait Foo { - fn bar(&self) {} - - #[track_caller] - fn baz(&self); -} -``` - -Note that while the compiler may be able to support the attribute in traits in -the future, [RFC 2091] prohibits their implementation without a follow-up RFC. - -[RFC 2091]: https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md |
