Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

ices/97194.rs: fixed with errors #1268

Merged
merged 1 commit into from
May 23, 2022
Merged

ices/97194.rs: fixed with errors #1268

merged 1 commit into from
May 23, 2022

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#97194

extern "" {
    fn bget(&self, index: [usize; Self::DIM]) -> bool {
    type T;
    type T<'a> = &'a str;
}

fn main() {}
=== stdout ===
=== stderr ===
error: this file contains an unclosed delimiter
 --> /home/runner/work/glacier/glacier/ices/97194.rs:7:14
  |
1 | extern "" {
  |           - unclosed delimiter
2 |     fn bget(&self, index: [usize; Self::DIM]) -> bool {
  |                                                       - this delimiter might not be properly closed...
...
5 | }
  | - ...as it matches this but it has different indentation
6 | 
7 | fn main() {}
  |              ^

error[E0428]: the name `T` is defined multiple times
 --> /home/runner/work/glacier/glacier/ices/97194.rs:4:5
  |
3 |     type T;
  |     ------- previous definition of the type `T` here
4 |     type T<'a> = &'a str;
  |     ^^^^^^^^^^^^^^^^^^^^^ `T` redefined here
  |
  = note: `T` must be defined only once in the type namespace of this block

error: incorrect function inside `extern` block
 --> /home/runner/work/glacier/glacier/ices/97194.rs:2:8
  |
1 |   extern "" {
  |   --------- `extern` blocks define existing foreign functions and functions inside of them cannot have a body
2 |       fn bget(&self, index: [usize; Self::DIM]) -> bool {
  |  ________^^^^___________________________________________-
  | |        |
  | |        cannot have a body
3 | |     type T;
4 | |     type T<'a> = &'a str;
5 | | }
  | |_- 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
 --> /home/runner/work/glacier/glacier/ices/97194.rs:2:13
  |
2 |     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: free type alias without body
 --> /home/runner/work/glacier/glacier/ices/97194.rs:3:5
  |
3 |     type T;
  |     ^^^^^^-
  |           |
  |           help: provide a definition for the type: `= <type>;`

error: incorrect function inside `extern` block
 --> /home/runner/work/glacier/glacier/ices/97194.rs:7:4
  |
1 | extern "" {
  | --------- `extern` blocks define existing foreign functions and functions inside of them cannot have a body
...
7 | fn main() {}
  |    ^^^^   -- help: remove the invalid body: `;`
  |    |
  |    cannot have a 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[E0433]: failed to resolve: use of undeclared type `Self`
 --> /home/runner/work/glacier/glacier/ices/97194.rs:2:35
  |
2 |     fn bget(&self, index: [usize; Self::DIM]) -> bool {
  |                                   ^^^^ use of undeclared type `Self`

error[E0703]: invalid ABI: found ``
 --> /home/runner/work/glacier/glacier/ices/97194.rs:1:8
  |
1 | extern "" {
  |        ^^ invalid ABI
  |
  = help: valid ABIs: Rust, C, C-unwind, cdecl, cdecl-unwind, stdcall, stdcall-unwind, fastcall, fastcall-unwind, vectorcall, vectorcall-unwind, thiscall, thiscall-unwind, aapcs, aapcs-unwind, win64, win64-unwind, sysv64, sysv64-unwind, ptx-kernel, msp430-interrupt, x86-interrupt, amdgpu-kernel, efiapi, avr-interrupt, avr-non-blocking-interrupt, C-cmse-nonsecure-call, wasm, system, system-unwind, rust-intrinsic, rust-call, platform-intrinsic, unadjusted

error: the `main` function cannot be declared in an `extern` block
 --> /home/runner/work/glacier/glacier/ices/97194.rs:7:1
  |
7 | fn main() {}
  | ^^^^^^^^^^^^

error: aborting due to 9 previous errors

Some errors have detailed explanations: E0428, E0433, E0703.
For more information about an error, try `rustc --explain E0428`.
==============

=== stdout ===
=== stderr ===
error: this file contains an unclosed delimiter
 --> /home/runner/work/glacier/glacier/ices/97194.rs:7:14
  |
1 | extern "" {
  |           - unclosed delimiter
2 |     fn bget(&self, index: [usize; Self::DIM]) -> bool {
  |                                                       - this delimiter might not be properly closed...
...
5 | }
  | - ...as it matches this but it has different indentation
6 | 
7 | fn main() {}
  |              ^

error[E0428]: the name `T` is defined multiple times
 --> /home/runner/work/glacier/glacier/ices/97194.rs:4:5
  |
3 |     type T;
  |     ------- previous definition of the type `T` here
4 |     type T<'a> = &'a str;
  |     ^^^^^^^^^^^^^^^^^^^^^ `T` redefined here
  |
  = note: `T` must be defined only once in the type namespace of this block

error: incorrect function inside `extern` block
 --> /home/runner/work/glacier/glacier/ices/97194.rs:2:8
  |
1 |   extern "" {
  |   --------- `extern` blocks define existing foreign functions and functions inside of them cannot have a body
2 |       fn bget(&self, index: [usize; Self::DIM]) -> bool {
  |  ________^^^^___________________________________________-
  | |        |
  | |        cannot have a body
3 | |     type T;
4 | |     type T<'a> = &'a str;
5 | | }
  | |_- 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
 --> /home/runner/work/glacier/glacier/ices/97194.rs:2:13
  |
2 |     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: free type alias without body
 --> /home/runner/work/glacier/glacier/ices/97194.rs:3:5
  |
3 |     type T;
  |     ^^^^^^-
  |           |
  |           help: provide a definition for the type: `= <type>;`

error: incorrect function inside `extern` block
 --> /home/runner/work/glacier/glacier/ices/97194.rs:7:4
  |
1 | extern "" {
  | --------- `extern` blocks define existing foreign functions and functions inside of them cannot have a body
...
7 | fn main() {}
  |    ^^^^   -- help: remove the invalid body: `;`
  |    |
  |    cannot have a 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[E0433]: failed to resolve: use of undeclared type `Self`
 --> /home/runner/work/glacier/glacier/ices/97194.rs:2:35
  |
2 |     fn bget(&self, index: [usize; Self::DIM]) -> bool {
  |                                   ^^^^ use of undeclared type `Self`

error[E0703]: invalid ABI: found ``
 --> /home/runner/work/glacier/glacier/ices/97194.rs:1:8
  |
1 | extern "" {
  |        ^^ invalid ABI
  |
  = help: valid ABIs: Rust, C, C-unwind, cdecl, cdecl-unwind, stdcall, stdcall-unwind, fastcall, fastcall-unwind, vectorcall, vectorcall-unwind, thiscall, thiscall-unwind, aapcs, aapcs-unwind, win64, win64-unwind, sysv64, sysv64-unwind, ptx-kernel, msp430-interrupt, x86-interrupt, amdgpu-kernel, efiapi, avr-interrupt, avr-non-blocking-interrupt, C-cmse-nonsecure-call, wasm, system, system-unwind, rust-intrinsic, rust-call, platform-intrinsic, unadjusted

error: the `main` function cannot be declared in an `extern` block
 --> /home/runner/work/glacier/glacier/ices/97194.rs:7:1
  |
7 | fn main() {}
  | ^^^^^^^^^^^^

error: aborting due to 9 previous errors

Some errors have detailed explanations: E0428, E0433, E0703.
For more information about an error, try `rustc --explain E0428`.
==============
@JohnTitor JohnTitor merged commit 212c2b9 into master May 23, 2022
@JohnTitor JohnTitor deleted the autofix/ices/97194.rs branch May 23, 2022 12:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants