Skip to content

Compile fail stderr #18072

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ jobs:
target/
key: ${{ runner.os }}-cargo-build-stable-${{ hashFiles('**/Cargo.toml') }}
- uses: dtolnay/rust-toolchain@stable
with:
# Compile fail tests need std sources for the errors to display correctly
components: rust-src
- name: Install Linux dependencies
uses: ./.github/actions/install-linux-deps
- name: Build & run tests
Expand All @@ -63,7 +66,7 @@ jobs:
key: ${{ runner.os }}-cargo-ci-${{ hashFiles('**/Cargo.toml') }}
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
components: rustfmt, clippy, rust-src
- name: Install Linux dependencies
uses: ./.github/actions/install-linux-deps
with:
Expand Down Expand Up @@ -123,6 +126,8 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
# Compile fail tests need std sources for the errors to display correctly
components: rust-src
- name: Install Linux dependencies
uses: ./.github/actions/install-linux-deps
- name: Check Compile
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
error: unexpected token in attribute
--> tests/deref_derive/invalid_attribute_fail.rs:8:12
|
8 | #[deref()] String
| ^
--> tests/deref_derive/invalid_attribute_fail.rs:LL:CC
|
LL | #[deref()] String
| ^

error: unexpected token in attribute
--> tests/deref_derive/invalid_attribute_fail.rs:15:12
--> tests/deref_derive/invalid_attribute_fail.rs:LL:CC
|
15 | #[deref()]
LL | #[deref()]
| ^

error: aborting due to 2 previous errors

Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
error: Deref cannot be derived on field-less structs
--> tests/deref_derive/invalid_item_fail.rs:3:10
|
3 | #[derive(Deref)]
| ^^^^^
|
--> tests/deref_derive/invalid_item_fail.rs:LL:CC
|
LL | #[derive(Deref)]
| ^^^^^
|
= note: this error originates in the derive macro `Deref` (in Nightly builds, run with -Z macro-backtrace for more info)

error: Deref can only be derived on structs
--> tests/deref_derive/invalid_item_fail.rs:7:10
|
7 | #[derive(Deref)]
| ^^^^^
|
--> tests/deref_derive/invalid_item_fail.rs:LL:CC
|
LL | #[derive(Deref)]
| ^^^^^
|
= note: this error originates in the derive macro `Deref` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 2 previous errors

Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
error: deriving Deref on multi-field structs requires one field to have the `#[deref]` attribute
--> tests/deref_derive/missing_attribute_fail.rs:3:10
|
3 | #[derive(Deref)]
| ^^^^^
|
--> tests/deref_derive/missing_attribute_fail.rs:LL:CC
|
LL | #[derive(Deref)]
| ^^^^^
|
= note: this error originates in the derive macro `Deref` (in Nightly builds, run with -Z macro-backtrace for more info)

error: deriving Deref on multi-field structs requires one field to have the `#[deref]` attribute
--> tests/deref_derive/missing_attribute_fail.rs:7:10
|
7 | #[derive(Deref)]
| ^^^^^
|
--> tests/deref_derive/missing_attribute_fail.rs:LL:CC
|
LL | #[derive(Deref)]
| ^^^^^
|
= note: this error originates in the derive macro `Deref` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 2 previous errors

Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
error: `#[deref]` attribute can only be used on a single field
--> tests/deref_derive/multiple_attributes_fail.rs:6:5
|
6 | #[deref] String
| ^^^^^^^^
--> tests/deref_derive/multiple_attributes_fail.rs:LL:CC
|
LL | #[deref] String
| ^^^^^^^^

error: `#[deref]` attribute can only be used on a single field
--> tests/deref_derive/multiple_attributes_fail.rs:14:5
--> tests/deref_derive/multiple_attributes_fail.rs:LL:CC
|
14 | #[deref]
LL | #[deref]
| ^^^^^^^^

error: aborting due to 2 previous errors

Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
error: unexpected token in attribute
--> tests/deref_mut_derive/invalid_attribute_fail.rs:9:12
|
9 | #[deref()] String
| ^
--> tests/deref_mut_derive/invalid_attribute_fail.rs:LL:CC
|
LL | #[deref()] String
| ^

error: unexpected token in attribute
--> tests/deref_mut_derive/invalid_attribute_fail.rs:24:12
--> tests/deref_mut_derive/invalid_attribute_fail.rs:LL:CC
|
24 | #[deref()]
LL | #[deref()]
| ^

error: aborting due to 2 previous errors

Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
error: DerefMut cannot be derived on field-less structs
--> tests/deref_mut_derive/invalid_item_fail.rs:3:10
|
3 | #[derive(DerefMut)]
| ^^^^^^^^
|
--> tests/deref_mut_derive/invalid_item_fail.rs:LL:CC
|
LL | #[derive(DerefMut)]
| ^^^^^^^^
|
= note: this error originates in the derive macro `DerefMut` (in Nightly builds, run with -Z macro-backtrace for more info)

error: DerefMut can only be derived on structs
--> tests/deref_mut_derive/invalid_item_fail.rs:7:10
|
7 | #[derive(DerefMut)]
| ^^^^^^^^
|
--> tests/deref_mut_derive/invalid_item_fail.rs:LL:CC
|
LL | #[derive(DerefMut)]
| ^^^^^^^^
|
= note: this error originates in the derive macro `DerefMut` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 2 previous errors

Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
error[E0308]: mismatched types
--> tests/deref_mut_derive/mismatched_target_type_fail.rs:4:10
|
4 | #[derive(DerefMut)]
| ^^^^^^^^
| |
| expected `&mut String`, found `&mut usize`
| expected `&mut String` because of return type
|
--> tests/deref_mut_derive/mismatched_target_type_fail.rs:LL:CC
|
LL | #[derive(DerefMut)]
| ^^^^^^^^
| |
| expected `&mut String`, found `&mut usize`
| expected `&mut String` because of return type
|
= note: expected mutable reference `&mut String`
found mutable reference `&mut usize`
= note: this error originates in the derive macro `DerefMut` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
--> tests/deref_mut_derive/mismatched_target_type_fail.rs:16:10
--> tests/deref_mut_derive/mismatched_target_type_fail.rs:LL:CC
|
16 | #[derive(DerefMut)]
LL | #[derive(DerefMut)]
| ^^^^^^^^
| |
| expected `&mut String`, found `&mut usize`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
error: deriving DerefMut on multi-field structs requires one field to have the `#[deref]` attribute
--> tests/deref_mut_derive/missing_attribute_fail.rs:4:10
|
4 | #[derive(DerefMut)]
| ^^^^^^^^
|
--> tests/deref_mut_derive/missing_attribute_fail.rs:LL:CC
|
LL | #[derive(DerefMut)]
| ^^^^^^^^
|
= note: this error originates in the derive macro `DerefMut` (in Nightly builds, run with -Z macro-backtrace for more info)

error: deriving DerefMut on multi-field structs requires one field to have the `#[deref]` attribute
--> tests/deref_mut_derive/missing_attribute_fail.rs:16:10
--> tests/deref_mut_derive/missing_attribute_fail.rs:LL:CC
|
16 | #[derive(DerefMut)]
LL | #[derive(DerefMut)]
| ^^^^^^^^
|
= note: this error originates in the derive macro `DerefMut` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 2 previous errors

Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
error[E0277]: the trait bound `TupleStruct: Deref` is not satisfied
--> tests/deref_mut_derive/missing_deref_fail.rs:10:8
|
10 | struct TupleStruct(usize, #[deref] String);
| ^^^^^^^^^^^ the trait `Deref` is not implemented for `TupleStruct`
|
--> tests/deref_mut_derive/missing_deref_fail.rs:LL:CC
|
LL | struct TupleStruct(usize, #[deref] String);
| ^^^^^^^^^^^ the trait `Deref` is not implemented for `TupleStruct`
|
note: required by a bound in `DerefMut`
--> $RUSTUP_HOME/.rustup/toolchains/stable-x86_64-pc-windows-msvc/lib/rustlib/src/rust/library/core/src/ops/deref.rs:264:21
|
264 | pub trait DerefMut: Deref {
| ^^^^^ required by this bound in `DerefMut`
--> RUSTLIB/core/src/ops/deref.rs:LL:CC
|
LL | pub trait DerefMut: ~const Deref {
| ^^^^^^^^^^^^ required by this bound in `DerefMut`

error[E0277]: the trait bound `TupleStruct: Deref` is not satisfied
--> tests/deref_mut_derive/missing_deref_fail.rs:7:10
|
7 | #[derive(DerefMut)]
| ^^^^^^^^ the trait `Deref` is not implemented for `TupleStruct`
|
--> tests/deref_mut_derive/missing_deref_fail.rs:LL:CC
|
LL | #[derive(DerefMut)]
| ^^^^^^^^ the trait `Deref` is not implemented for `TupleStruct`
|
= note: this error originates in the derive macro `DerefMut` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `Struct: Deref` is not satisfied
--> tests/deref_mut_derive/missing_deref_fail.rs:15:8
|
15 | struct Struct {
| ^^^^^^ the trait `Deref` is not implemented for `Struct`
|
--> tests/deref_mut_derive/missing_deref_fail.rs:LL:CC
|
LL | struct Struct {
| ^^^^^^ the trait `Deref` is not implemented for `Struct`
|
note: required by a bound in `DerefMut`
--> $RUSTUP_HOME/.rustup/toolchains/stable-x86_64-pc-windows-msvc/lib/rustlib/src/rust/library/core/src/ops/deref.rs:264:21
|
264 | pub trait DerefMut: Deref {
| ^^^^^ required by this bound in `DerefMut`
--> RUSTLIB/core/src/ops/deref.rs:LL:CC
|
LL | pub trait DerefMut: ~const Deref {
| ^^^^^^^^^^^^ required by this bound in `DerefMut`

error[E0277]: the trait bound `Struct: Deref` is not satisfied
--> tests/deref_mut_derive/missing_deref_fail.rs:13:10
--> tests/deref_mut_derive/missing_deref_fail.rs:LL:CC
|
13 | #[derive(DerefMut)]
LL | #[derive(DerefMut)]
| ^^^^^^^^ the trait `Deref` is not implemented for `Struct`
|
= note: this error originates in the derive macro `DerefMut` (in Nightly builds, run with -Z macro-backtrace for more info)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
error: `#[deref]` attribute can only be used on a single field
--> tests/deref_mut_derive/multiple_attributes_fail.rs:7:5
|
7 | #[deref] String
| ^^^^^^^^
--> tests/deref_mut_derive/multiple_attributes_fail.rs:LL:CC
|
LL | #[deref] String
| ^^^^^^^^

error: `#[deref]` attribute can only be used on a single field
--> tests/deref_mut_derive/multiple_attributes_fail.rs:23:5
--> tests/deref_mut_derive/multiple_attributes_fail.rs:LL:CC
|
23 | #[deref]
LL | #[deref]
| ^^^^^^^^

error: aborting due to 2 previous errors

Loading
Loading