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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
warning: `extern` fn uses type `char`, which is not FFI-safe
--> $DIR/naked-functions-ffi.rs:8:28
--> $DIR/ffi.rs:8:28
|
LL | pub extern "C" fn naked(p: char) -> u128 {
| ^^^^ not FFI-safe
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
error[E0736]: attribute incompatible with `#[unsafe(naked)]`
--> $DIR/naked-functions-inline.rs:13:3
--> $DIR/inline.rs:13:3
|
LL | #[unsafe(naked)]
| ---------------- function marked with `#[unsafe(naked)]` here
LL | #[inline]
| ^^^^^^ the `inline` attribute is incompatible with `#[unsafe(naked)]`

error[E0736]: attribute incompatible with `#[unsafe(naked)]`
--> $DIR/naked-functions-inline.rs:20:3
--> $DIR/inline.rs:20:3
|
LL | #[unsafe(naked)]
| ---------------- function marked with `#[unsafe(naked)]` here
LL | #[inline(always)]
| ^^^^^^ the `inline` attribute is incompatible with `#[unsafe(naked)]`

error[E0736]: attribute incompatible with `#[unsafe(naked)]`
--> $DIR/naked-functions-inline.rs:27:3
--> $DIR/inline.rs:27:3
|
LL | #[unsafe(naked)]
| ---------------- function marked with `#[unsafe(naked)]` here
LL | #[inline(never)]
| ^^^^^^ the `inline` attribute is incompatible with `#[unsafe(naked)]`

error[E0736]: attribute incompatible with `#[unsafe(naked)]`
--> $DIR/naked-functions-inline.rs:34:18
--> $DIR/inline.rs:34:18
|
LL | #[unsafe(naked)]
| ---------------- function marked with `#[unsafe(naked)]` here
Expand Down
Original file line number Diff line number Diff line change
@@ -1,59 +1,59 @@
error[E0433]: cannot find module or crate `a` in the crate root
--> $DIR/naked-invalid-attr.rs:57:5
--> $DIR/invalid-attr.rs:57:5
|
LL | #[::a]
| ^ use of unresolved module or unlinked crate `a`

error: the `naked` attribute cannot be used on crates
--> $DIR/naked-invalid-attr.rs:5:11
--> $DIR/invalid-attr.rs:5:11
|
LL | #![unsafe(naked)]
| ^^^^^
|
= help: the `naked` attribute can only be applied to functions

error: the `naked` attribute cannot be used on foreign functions
--> $DIR/naked-invalid-attr.rs:10:14
--> $DIR/invalid-attr.rs:10:14
|
LL | #[unsafe(naked)]
| ^^^^^
|
= help: the `naked` attribute can only be applied to functions with a body

error: the `naked` attribute cannot be used on structs
--> $DIR/naked-invalid-attr.rs:14:10
--> $DIR/invalid-attr.rs:14:10
|
LL | #[unsafe(naked)]
| ^^^^^
|
= help: the `naked` attribute can only be applied to functions

error: the `naked` attribute cannot be used on struct fields
--> $DIR/naked-invalid-attr.rs:17:14
--> $DIR/invalid-attr.rs:17:14
|
LL | #[unsafe(naked)]
| ^^^^^
|
= help: the `naked` attribute can only be applied to functions

error: the `naked` attribute cannot be used on required trait methods
--> $DIR/naked-invalid-attr.rs:23:14
--> $DIR/invalid-attr.rs:23:14
|
LL | #[unsafe(naked)]
| ^^^^^
|
= help: the `naked` attribute can only be applied to functions with a body

error: the `naked` attribute cannot be used on closures
--> $DIR/naked-invalid-attr.rs:52:14
--> $DIR/invalid-attr.rs:52:14
|
LL | #[unsafe(naked)]
| ^^^^^
|
= help: the `naked` attribute can be applied to functions and methods

error[E0736]: attribute incompatible with `#[unsafe(naked)]`
--> $DIR/naked-invalid-attr.rs:57:3
--> $DIR/invalid-attr.rs:57:3
|
LL | #[::a]
| ^^^ the `::a` attribute is incompatible with `#[unsafe(naked)]`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
error: the `repr(C)` attribute cannot be used on functions
--> $DIR/naked-with-invalid-repr-attr.rs:10:3
--> $DIR/invalid-repr-attr.rs:10:3
|
LL | #[repr(C)]
| ^^^^^^^
|
= help: the `repr(C)` attribute can only be applied to data types

error: the `repr(transparent)` attribute cannot be used on functions
--> $DIR/naked-with-invalid-repr-attr.rs:17:3
--> $DIR/invalid-repr-attr.rs:17:3
|
LL | #[repr(transparent)]
| ^^^^^^^^^^^^^^^^^
|
= help: the `repr(transparent)` attribute can only be applied to data types

error: the `repr(C)` attribute cannot be used on functions
--> $DIR/naked-with-invalid-repr-attr.rs:24:3
--> $DIR/invalid-repr-attr.rs:24:3
|
LL | #[repr(C)]
| ^^^^^^^
|
= help: the `repr(C)` attribute can only be applied to data types

error: the `repr(C)` attribute cannot be used on functions
--> $DIR/naked-with-invalid-repr-attr.rs:33:3
--> $DIR/invalid-repr-attr.rs:33:3
|
LL | #[repr(C, packed)]
| ^^^^^^^^^^^^^^^
|
= help: the `repr(C)` attribute can only be applied to data types

error: the `repr(packed)` attribute cannot be used on functions
--> $DIR/naked-with-invalid-repr-attr.rs:33:3
--> $DIR/invalid-repr-attr.rs:33:3
|
LL | #[repr(C, packed)]
| ^^^^^^^^^^^^^^^
|
= help: the `repr(packed)` attribute can only be applied to data types

error: the `repr(u8)` attribute cannot be used on functions
--> $DIR/naked-with-invalid-repr-attr.rs:41:3
--> $DIR/invalid-repr-attr.rs:41:3
|
LL | #[repr(u8)]
| ^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
error[E0736]: cannot use `#[unsafe(naked)]` with testing attributes
--> $DIR/naked-functions-testattrs.rs:11:1
--> $DIR/testattrs.rs:11:1
|
LL | #[test]
| ------- function marked with testing attribute here
LL | #[unsafe(naked)]
| ^^^^^^^^^^^^^^^^ `#[unsafe(naked)]` is incompatible with testing attributes

error[E0736]: cannot use `#[unsafe(naked)]` with testing attributes
--> $DIR/naked-functions-testattrs.rs:19:1
--> $DIR/testattrs.rs:19:1
|
LL | #[test]
| ------- function marked with testing attribute here
LL | #[unsafe(naked)]
| ^^^^^^^^^^^^^^^^ `#[unsafe(naked)]` is incompatible with testing attributes

error[E0736]: cannot use `#[unsafe(naked)]` with testing attributes
--> $DIR/naked-functions-testattrs.rs:27:1
--> $DIR/testattrs.rs:27:1
|
LL | #[test]
| ------- function marked with testing attribute here
LL | #[unsafe(naked)]
| ^^^^^^^^^^^^^^^^ `#[unsafe(naked)]` is incompatible with testing attributes

error[E0736]: cannot use `#[unsafe(naked)]` with testing attributes
--> $DIR/naked-functions-testattrs.rs:34:1
--> $DIR/testattrs.rs:34:1
|
LL | #[bench]
| -------- function marked with testing attribute here
Expand Down
Original file line number Diff line number Diff line change
@@ -1,66 +1,66 @@
error: unused variable: `a`
--> $DIR/naked-functions-unused.rs:16:32
--> $DIR/unused.rs:23:32
|
LL | pub extern "C" fn function(a: usize, b: usize) -> usize {
| ^ help: if this is intentional, prefix it with an underscore: `_a`
|
note: the lint level is defined here
--> $DIR/naked-functions-unused.rs:5:9
--> $DIR/unused.rs:11:9
|
LL | #![deny(unused)]
| ^^^^^^
= note: `#[deny(unused_variables)]` implied by `#[deny(unused)]`

error: unused variable: `b`
--> $DIR/naked-functions-unused.rs:16:42
--> $DIR/unused.rs:23:42
|
LL | pub extern "C" fn function(a: usize, b: usize) -> usize {
| ^ help: if this is intentional, prefix it with an underscore: `_b`

error: unused variable: `a`
--> $DIR/naked-functions-unused.rs:27:38
--> $DIR/unused.rs:34:38
|
LL | pub extern "C" fn associated(a: usize, b: usize) -> usize {
| ^ help: if this is intentional, prefix it with an underscore: `_a`

error: unused variable: `b`
--> $DIR/naked-functions-unused.rs:27:48
--> $DIR/unused.rs:34:48
|
LL | pub extern "C" fn associated(a: usize, b: usize) -> usize {
| ^ help: if this is intentional, prefix it with an underscore: `_b`

error: unused variable: `a`
--> $DIR/naked-functions-unused.rs:35:41
--> $DIR/unused.rs:42:41
|
LL | pub extern "C" fn method(&self, a: usize, b: usize) -> usize {
| ^ help: if this is intentional, prefix it with an underscore: `_a`

error: unused variable: `b`
--> $DIR/naked-functions-unused.rs:35:51
--> $DIR/unused.rs:42:51
|
LL | pub extern "C" fn method(&self, a: usize, b: usize) -> usize {
| ^ help: if this is intentional, prefix it with an underscore: `_b`

error: unused variable: `a`
--> $DIR/naked-functions-unused.rs:45:40
--> $DIR/unused.rs:52:40
|
LL | extern "C" fn trait_associated(a: usize, b: usize) -> usize {
| ^ help: if this is intentional, prefix it with an underscore: `_a`

error: unused variable: `b`
--> $DIR/naked-functions-unused.rs:45:50
--> $DIR/unused.rs:52:50
|
LL | extern "C" fn trait_associated(a: usize, b: usize) -> usize {
| ^ help: if this is intentional, prefix it with an underscore: `_b`

error: unused variable: `a`
--> $DIR/naked-functions-unused.rs:53:43
--> $DIR/unused.rs:60:43
|
LL | extern "C" fn trait_method(&self, a: usize, b: usize) -> usize {
| ^ help: if this is intentional, prefix it with an underscore: `_a`

error: unused variable: `b`
--> $DIR/naked-functions-unused.rs:53:53
--> $DIR/unused.rs:60:53
|
LL | extern "C" fn trait_method(&self, a: usize, b: usize) -> usize {
| ^ help: if this is intentional, prefix it with an underscore: `_b`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
//@ add-minicore
//@ revisions: x86_64 aarch64
//@ needs-asm-support
//@[x86_64] only-x86_64
//@[aarch64] only-aarch64
#![deny(unused)]
//@[x86_64] compile-flags: --target x86_64-unknown-linux-gnu
//@[x86_64] needs-llvm-components: x86
//@[aarch64] compile-flags: --target aarch64-unknown-linux-gnu
//@[aarch64] needs-llvm-components: aarch64
//@ ignore-backends: gcc
#![crate_type = "lib"]
#![feature(no_core)]
#![no_core]
#![deny(unused)]

extern crate minicore;

pub trait Trait {
extern "C" fn trait_associated(a: usize, b: usize) -> usize;
extern "C" fn trait_method(&self, a: usize, b: usize) -> usize;
}

pub mod normal {
use std::arch::asm;
use minicore::asm;

pub extern "C" fn function(a: usize, b: usize) -> usize {
//~^ ERROR unused variable: `a`
Expand Down Expand Up @@ -61,7 +68,7 @@ pub mod normal {
}

pub mod naked {
use std::arch::naked_asm;
use minicore::naked_asm;

#[unsafe(naked)]
pub extern "C" fn function(a: usize, b: usize) -> usize {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,66 +1,66 @@
error: unused variable: `a`
--> $DIR/naked-functions-unused.rs:16:32
--> $DIR/unused.rs:23:32
|
LL | pub extern "C" fn function(a: usize, b: usize) -> usize {
| ^ help: if this is intentional, prefix it with an underscore: `_a`
|
note: the lint level is defined here
--> $DIR/naked-functions-unused.rs:5:9
--> $DIR/unused.rs:11:9
|
LL | #![deny(unused)]
| ^^^^^^
= note: `#[deny(unused_variables)]` implied by `#[deny(unused)]`

error: unused variable: `b`
--> $DIR/naked-functions-unused.rs:16:42
--> $DIR/unused.rs:23:42
|
LL | pub extern "C" fn function(a: usize, b: usize) -> usize {
| ^ help: if this is intentional, prefix it with an underscore: `_b`

error: unused variable: `a`
--> $DIR/naked-functions-unused.rs:27:38
--> $DIR/unused.rs:34:38
|
LL | pub extern "C" fn associated(a: usize, b: usize) -> usize {
| ^ help: if this is intentional, prefix it with an underscore: `_a`

error: unused variable: `b`
--> $DIR/naked-functions-unused.rs:27:48
--> $DIR/unused.rs:34:48
|
LL | pub extern "C" fn associated(a: usize, b: usize) -> usize {
| ^ help: if this is intentional, prefix it with an underscore: `_b`

error: unused variable: `a`
--> $DIR/naked-functions-unused.rs:35:41
--> $DIR/unused.rs:42:41
|
LL | pub extern "C" fn method(&self, a: usize, b: usize) -> usize {
| ^ help: if this is intentional, prefix it with an underscore: `_a`

error: unused variable: `b`
--> $DIR/naked-functions-unused.rs:35:51
--> $DIR/unused.rs:42:51
|
LL | pub extern "C" fn method(&self, a: usize, b: usize) -> usize {
| ^ help: if this is intentional, prefix it with an underscore: `_b`

error: unused variable: `a`
--> $DIR/naked-functions-unused.rs:45:40
--> $DIR/unused.rs:52:40
|
LL | extern "C" fn trait_associated(a: usize, b: usize) -> usize {
| ^ help: if this is intentional, prefix it with an underscore: `_a`

error: unused variable: `b`
--> $DIR/naked-functions-unused.rs:45:50
--> $DIR/unused.rs:52:50
|
LL | extern "C" fn trait_associated(a: usize, b: usize) -> usize {
| ^ help: if this is intentional, prefix it with an underscore: `_b`

error: unused variable: `a`
--> $DIR/naked-functions-unused.rs:53:43
--> $DIR/unused.rs:60:43
|
LL | extern "C" fn trait_method(&self, a: usize, b: usize) -> usize {
| ^ help: if this is intentional, prefix it with an underscore: `_a`

error: unused variable: `b`
--> $DIR/naked-functions-unused.rs:53:53
--> $DIR/unused.rs:60:53
|
LL | extern "C" fn trait_method(&self, a: usize, b: usize) -> usize {
| ^ help: if this is intentional, prefix it with an underscore: `_b`
Expand Down
Loading