forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#97265 - JohnTitor:rollup-kgthnjt, r=JohnTitor
Rollup of 6 pull requests Successful merges: - rust-lang#97144 (Fix rusty grammar in `std::error::Reporter` docs) - rust-lang#97225 (Fix `Display` for `cell::{Ref,RefMut}`) - rust-lang#97228 (Omit stdarch workspace from rust-src) - rust-lang#97236 (Recover when resolution did not resolve lifetimes.) - rust-lang#97245 (Fix typo in futex RwLock::write_contended.) - rust-lang#97259 (Fix typo in Mir phase docs) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
11 changed files
with
106 additions
and
24 deletions.
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
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
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
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
extern "C" { | ||
fn a(&mut self) { | ||
//~^ ERROR incorrect function inside `extern` block | ||
//~| ERROR `self` parameter is only allowed in associated functions | ||
fn b(buf: &Self) {} | ||
} | ||
} | ||
|
||
fn main() {} |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
error: incorrect function inside `extern` block | ||
--> $DIR/issue-97193.rs:2:8 | ||
| | ||
LL | extern "C" { | ||
| ---------- `extern` blocks define existing foreign functions and functions inside of them cannot have a body | ||
LL | fn a(&mut self) { | ||
| ________^____________- | ||
| | | | ||
| | cannot have a body | ||
LL | | | ||
LL | | | ||
LL | | fn b(buf: &Self) {} | ||
LL | | } | ||
| |_____- help: remove the invalid body: `;` | ||
| | ||
= help: you might have meant to write a function accessible through FFI, which can be done by writing `extern fn` outside of the `extern` block | ||
= note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html | ||
|
||
error: `self` parameter is only allowed in associated functions | ||
--> $DIR/issue-97193.rs:2:10 | ||
| | ||
LL | fn a(&mut self) { | ||
| ^^^^^^^^^ not semantically valid as function parameter | ||
| | ||
= note: associated functions are those in `impl` or `trait` definitions | ||
|
||
error: aborting due to 2 previous errors | ||
|
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
extern "C" { | ||
fn bget(&self, index: [usize; Self::DIM]) -> bool { | ||
//~^ ERROR incorrect function inside `extern` block | ||
//~| ERROR `self` parameter is only allowed in associated functions | ||
//~| ERROR use of undeclared type `Self` | ||
type T<'a> = &'a str; | ||
} | ||
} | ||
|
||
fn main() {} |
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
error: incorrect function inside `extern` block | ||
--> $DIR/issue-97194.rs:2:8 | ||
| | ||
LL | extern "C" { | ||
| ---------- `extern` blocks define existing foreign functions and functions inside of them cannot have a body | ||
LL | fn bget(&self, index: [usize; Self::DIM]) -> bool { | ||
| ________^^^^___________________________________________- | ||
| | | | ||
| | cannot have a body | ||
LL | | | ||
LL | | | ||
LL | | | ||
LL | | type T<'a> = &'a str; | ||
LL | | } | ||
| |_____- help: remove the invalid body: `;` | ||
| | ||
= help: you might have meant to write a function accessible through FFI, which can be done by writing `extern fn` outside of the `extern` block | ||
= note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html | ||
|
||
error: `self` parameter is only allowed in associated functions | ||
--> $DIR/issue-97194.rs:2:13 | ||
| | ||
LL | fn bget(&self, index: [usize; Self::DIM]) -> bool { | ||
| ^^^^^ not semantically valid as function parameter | ||
| | ||
= note: associated functions are those in `impl` or `trait` definitions | ||
|
||
error[E0433]: failed to resolve: use of undeclared type `Self` | ||
--> $DIR/issue-97194.rs:2:35 | ||
| | ||
LL | fn bget(&self, index: [usize; Self::DIM]) -> bool { | ||
| ^^^^ use of undeclared type `Self` | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0433`. |