Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions tests/ui/extern/extern-crate-rename.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//@ aux-build:m1.rs
//@ aux-build:m2.rs
//@ reference: items.extern-crate.as


extern crate m1;
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/extern/extern-crate-rename.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0259]: the name `m1` is defined multiple times
--> $DIR/extern-crate-rename.rs:6:1
--> $DIR/extern-crate-rename.rs:7:1
|
LL | extern crate m1;
| ---------------- previous import of the extern crate `m1` here
Expand Down
3 changes: 3 additions & 0 deletions tests/ui/extern/extern-ffi-fn-with-body.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//@ reference: items.extern.fn.body
//@ reference: items.fn.extern.intro

extern "C" {
fn foo() -> i32 { //~ ERROR incorrect function inside `extern` block
return 0;
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/extern/extern-ffi-fn-with-body.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: incorrect function inside `extern` block
--> $DIR/extern-ffi-fn-with-body.rs:2:8
--> $DIR/extern-ffi-fn-with-body.rs:5:8
|
LL | extern "C" {
| ---------- `extern` blocks define existing foreign functions and functions inside of them cannot have a body
Expand Down
1 change: 1 addition & 0 deletions tests/ui/extern/extern-thiscall.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//@ run-pass
//@ only-x86
//@ reference: items.extern.abi.thiscall

trait A {
extern "thiscall" fn test1(i: i32);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//@ reference: items.extern.fn.body
// https://github.com/rust-lang/rust/issues/75283
extern "C" {
fn lol() { //~ ERROR incorrect function inside `extern` block
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: incorrect function inside `extern` block
--> $DIR/function-definition-in-extern-block-75283.rs:3:8
--> $DIR/function-definition-in-extern-block-75283.rs:4:8
|
LL | extern "C" {
| ---------- `extern` blocks define existing foreign functions and functions inside of them cannot have a body
Expand Down
2 changes: 2 additions & 0 deletions tests/ui/extern/issue-28324.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//@ reference: const-eval.const-expr.path-static
//@ reference: items.extern.static.safety
Comment thread
DanielEScherzer marked this conversation as resolved.
extern "C" {
static error_message_count: u32;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/extern/issue-28324.stderr
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
error[E0080]: cannot access extern static `error_message_count`
--> $DIR/issue-28324.rs:5:23
--> $DIR/issue-28324.rs:7:23
|
LL | pub static BAZ: u32 = *&error_message_count;
| ^^^^^^^^^^^^^^^^^^^^^ evaluation of `BAZ` failed here

error[E0133]: use of extern static is unsafe and requires unsafe function or block
--> $DIR/issue-28324.rs:5:25
--> $DIR/issue-28324.rs:7:25
|
LL | pub static BAZ: u32 = *&error_message_count;
| ^^^^^^^^^^^^^^^^^^^ use of extern static
Expand Down
1 change: 1 addition & 0 deletions tests/ui/extern/issue-47725.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//@ reference: items.extern.attributes.link_name.allowed-positions
#![warn(unused_attributes)] //~ NOTE lint level is defined here

#[link_name = "foo"]
Expand Down
10 changes: 5 additions & 5 deletions tests/ui/extern/issue-47725.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0539]: malformed `link_name` attribute input
--> $DIR/issue-47725.rs:19:1
--> $DIR/issue-47725.rs:20:1
|
LL | #[link_name]
| ^^^^^^^^^^^^
Expand All @@ -11,21 +11,21 @@ LL | #[link_name = "name"]
| ++++++++

warning: `#[link_name]` attribute cannot be used on structs
--> $DIR/issue-47725.rs:3:1
--> $DIR/issue-47725.rs:4:1
|
LL | #[link_name = "foo"]
| ^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= help: `#[link_name]` can be applied to foreign functions and foreign statics
note: the lint level is defined here
--> $DIR/issue-47725.rs:1:9
--> $DIR/issue-47725.rs:2:9
|
LL | #![warn(unused_attributes)]
| ^^^^^^^^^^^^^^^^^

warning: `#[link_name]` attribute cannot be used on foreign modules
--> $DIR/issue-47725.rs:10:1
--> $DIR/issue-47725.rs:11:1
|
LL | #[link_name = "foobar"]
| ^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -34,7 +34,7 @@ LL | #[link_name = "foobar"]
= help: `#[link_name]` can be applied to foreign functions and foreign statics

warning: `#[link_name]` attribute cannot be used on foreign modules
--> $DIR/issue-47725.rs:19:1
--> $DIR/issue-47725.rs:20:1
|
LL | #[link_name]
| ^^^^^^^^^^^^
Expand Down
1 change: 1 addition & 0 deletions tests/ui/extern/issue-95829.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//@ edition:2018
//@ reference: items.extern.fn.qualifiers

extern "C" {
async fn L() { //~ ERROR: incorrect function inside `extern` block
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/extern/issue-95829.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: incorrect function inside `extern` block
--> $DIR/issue-95829.rs:4:14
--> $DIR/issue-95829.rs:5:14
|
LL | extern "C" {
| ---------- `extern` blocks define existing foreign functions and functions inside of them cannot have a body
Expand All @@ -16,7 +16,7 @@ LL | | }
= note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html

error: functions in `extern` blocks cannot have `async` qualifier
--> $DIR/issue-95829.rs:4:5
--> $DIR/issue-95829.rs:5:5
|
LL | extern "C" {
| ---------- in this `extern` block
Expand Down
Loading