Auto merge of #153872 - cyrgani:deriving-span-tests, r=Kivooeo

merge and cleanup the `generate-deriving-span-tests.py` tests

These tests are all about making sure that `#[derive]` errors will point at the field of a struct or variant of an enum that does not implement the required trait.

This PR merges the four test files per macro into one, cleans it up a bit and removes the extremely outdated generator script.
This commit is contained in:
bors
2026-03-14 20:07:55 +00:00
79 changed files with 737 additions and 1075 deletions
-121
View File
@@ -1,121 +0,0 @@
#!/usr/bin/env python
"""
This script creates a pile of UI tests check that all the
derives have spans that point to the fields, rather than the
#[derive(...)] line.
sample usage: src/etc/generate-deriving-span-tests.py
"""
import os
import stat
TEST_DIR = os.path.abspath(
os.path.join(os.path.dirname(__file__), "../test/ui/derives/")
)
TEMPLATE = """\
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
{error_deriving}
struct Error;
{code}
fn main() {{}}
"""
ENUM_STRING = """
#[derive({traits})]
enum Enum {{
A(
Error {errors}
)
}}
"""
ENUM_STRUCT_VARIANT_STRING = """
#[derive({traits})]
enum Enum {{
A {{
x: Error {errors}
}}
}}
"""
STRUCT_STRING = """
#[derive({traits})]
struct Struct {{
x: Error {errors}
}}
"""
STRUCT_TUPLE_STRING = """
#[derive({traits})]
struct Struct(
Error {errors}
);
"""
ENUM_TUPLE, ENUM_STRUCT, STRUCT_FIELDS, STRUCT_TUPLE = range(4)
def create_test_case(type, trait, super_traits, error_count):
string = [
ENUM_STRING,
ENUM_STRUCT_VARIANT_STRING,
STRUCT_STRING,
STRUCT_TUPLE_STRING,
][type]
all_traits = ",".join([trait] + super_traits)
super_traits = ",".join(super_traits)
error_deriving = "#[derive(%s)]" % super_traits if super_traits else ""
errors = "\n".join("//~%s ERROR" % ("^" * n) for n in range(error_count))
code = string.format(traits=all_traits, errors=errors)
return TEMPLATE.format(error_deriving=error_deriving, code=code)
def write_file(name, string):
test_file = os.path.join(TEST_DIR, "derives-span-%s.rs" % name)
# set write permission if file exists, so it can be changed
if os.path.exists(test_file):
os.chmod(test_file, stat.S_IWUSR)
with open(test_file, "w") as f:
f.write(string)
# mark file read-only
os.chmod(test_file, stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH)
ENUM = 1
STRUCT = 2
ALL = STRUCT | ENUM
traits = {
"Default": (STRUCT, [], 1),
"FromPrimitive": (0, [], 0), # only works for C-like enums
"Decodable": (0, [], 0), # FIXME: quoting gives horrible spans
"Encodable": (0, [], 0), # FIXME: quoting gives horrible spans
}
for trait, supers, errs in [
("Clone", [], 1),
("PartialEq", [], 2),
("PartialOrd", ["PartialEq"], 1),
("Eq", ["PartialEq"], 1),
("Ord", ["Eq", "PartialOrd", "PartialEq"], 1),
("Debug", [], 1),
("Hash", [], 1),
]:
traits[trait] = (ALL, supers, errs)
for trait, (types, super_traits, error_count) in traits.items():
def mk(ty, t=trait, st=super_traits, ec=error_count):
return create_test_case(ty, t, st, ec)
if types & ENUM:
write_file(trait + "-enum", mk(ENUM_TUPLE))
write_file(trait + "-enum-struct-variant", mk(ENUM_STRUCT))
if types & STRUCT:
write_file(trait + "-struct", mk(STRUCT_FIELDS))
write_file(trait + "-tuple-struct", mk(STRUCT_TUPLE))
@@ -1,13 +0,0 @@
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
struct Error;
#[derive(Clone)]
enum Enum {
A {
x: Error //~ ERROR
}
}
fn main() {}
@@ -1,18 +0,0 @@
error[E0277]: the trait bound `Error: Clone` is not satisfied
--> $DIR/derives-span-Clone-enum-struct-variant.rs:9:6
|
LL | #[derive(Clone)]
| ----- in this derive macro expansion
...
LL | x: Error
| ^^^^^^^^ the trait `Clone` is not implemented for `Error`
|
help: consider annotating `Error` with `#[derive(Clone)]`
|
LL + #[derive(Clone)]
LL | struct Error;
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.
@@ -1,13 +0,0 @@
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
struct Error;
#[derive(Clone)]
enum Enum {
A(
Error //~ ERROR
)
}
fn main() {}
@@ -1,18 +0,0 @@
error[E0277]: the trait bound `Error: Clone` is not satisfied
--> $DIR/derives-span-Clone-enum.rs:9:6
|
LL | #[derive(Clone)]
| ----- in this derive macro expansion
...
LL | Error
| ^^^^^ the trait `Clone` is not implemented for `Error`
|
help: consider annotating `Error` with `#[derive(Clone)]`
|
LL + #[derive(Clone)]
LL | struct Error;
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.
@@ -1,11 +0,0 @@
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
struct Error;
#[derive(Clone)]
struct Struct {
x: Error //~ ERROR
}
fn main() {}
@@ -1,18 +0,0 @@
error[E0277]: the trait bound `Error: Clone` is not satisfied
--> $DIR/derives-span-Clone-struct.rs:8:5
|
LL | #[derive(Clone)]
| ----- in this derive macro expansion
LL | struct Struct {
LL | x: Error
| ^^^^^^^^ the trait `Clone` is not implemented for `Error`
|
help: consider annotating `Error` with `#[derive(Clone)]`
|
LL + #[derive(Clone)]
LL | struct Error;
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.
@@ -1,11 +0,0 @@
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
struct Error;
#[derive(Clone)]
struct Struct(
Error //~ ERROR
);
fn main() {}
@@ -1,18 +0,0 @@
error[E0277]: the trait bound `Error: Clone` is not satisfied
--> $DIR/derives-span-Clone-tuple-struct.rs:8:5
|
LL | #[derive(Clone)]
| ----- in this derive macro expansion
LL | struct Struct(
LL | Error
| ^^^^^ the trait `Clone` is not implemented for `Error`
|
help: consider annotating `Error` with `#[derive(Clone)]`
|
LL + #[derive(Clone)]
LL | struct Error;
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.
+30
View File
@@ -0,0 +1,30 @@
//! Check that all the derives have spans that point to the fields,
//! rather than the #[derive(Clone)] line.
struct Error;
#[derive(Clone)]
enum EnumStructVariant {
A {
x: Error, //~ ERROR
},
}
#[derive(Clone)]
enum EnumTupleVariant {
A(
Error, //~ ERROR
),
}
#[derive(Clone)]
struct Struct {
x: Error, //~ ERROR
}
#[derive(Clone)]
struct TupleStruct(
Error, //~ ERROR
);
fn main() {}
@@ -0,0 +1,63 @@
error[E0277]: the trait bound `Error: Clone` is not satisfied
--> $DIR/derives-span-Clone.rs:9:9
|
LL | #[derive(Clone)]
| ----- in this derive macro expansion
...
LL | x: Error,
| ^^^^^^^^ the trait `Clone` is not implemented for `Error`
|
help: consider annotating `Error` with `#[derive(Clone)]`
|
LL + #[derive(Clone)]
LL | struct Error;
|
error[E0277]: the trait bound `Error: Clone` is not satisfied
--> $DIR/derives-span-Clone.rs:16:9
|
LL | #[derive(Clone)]
| ----- in this derive macro expansion
...
LL | Error,
| ^^^^^ the trait `Clone` is not implemented for `Error`
|
help: consider annotating `Error` with `#[derive(Clone)]`
|
LL + #[derive(Clone)]
LL | struct Error;
|
error[E0277]: the trait bound `Error: Clone` is not satisfied
--> $DIR/derives-span-Clone.rs:22:5
|
LL | #[derive(Clone)]
| ----- in this derive macro expansion
LL | struct Struct {
LL | x: Error,
| ^^^^^^^^ the trait `Clone` is not implemented for `Error`
|
help: consider annotating `Error` with `#[derive(Clone)]`
|
LL + #[derive(Clone)]
LL | struct Error;
|
error[E0277]: the trait bound `Error: Clone` is not satisfied
--> $DIR/derives-span-Clone.rs:27:5
|
LL | #[derive(Clone)]
| ----- in this derive macro expansion
LL | struct TupleStruct(
LL | Error,
| ^^^^^ the trait `Clone` is not implemented for `Error`
|
help: consider annotating `Error` with `#[derive(Clone)]`
|
LL + #[derive(Clone)]
LL | struct Error;
|
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0277`.
@@ -1,13 +0,0 @@
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
struct Error;
#[derive(Debug)]
enum Enum {
A {
x: Error //~ ERROR
}
}
fn main() {}
@@ -1,19 +0,0 @@
error[E0277]: `Error` doesn't implement `Debug`
--> $DIR/derives-span-Debug-enum-struct-variant.rs:9:6
|
LL | #[derive(Debug)]
| ----- in this derive macro expansion
...
LL | x: Error
| ^^^^^^^^ the trait `Debug` is not implemented for `Error`
|
= note: add `#[derive(Debug)]` to `Error` or manually `impl Debug for Error`
help: consider annotating `Error` with `#[derive(Debug)]`
|
LL + #[derive(Debug)]
LL | struct Error;
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.
@@ -1,13 +0,0 @@
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
struct Error;
#[derive(Debug)]
enum Enum {
A(
Error //~ ERROR
)
}
fn main() {}
@@ -1,19 +0,0 @@
error[E0277]: `Error` doesn't implement `Debug`
--> $DIR/derives-span-Debug-enum.rs:9:6
|
LL | #[derive(Debug)]
| ----- in this derive macro expansion
...
LL | Error
| ^^^^^ the trait `Debug` is not implemented for `Error`
|
= note: add `#[derive(Debug)]` to `Error` or manually `impl Debug for Error`
help: consider annotating `Error` with `#[derive(Debug)]`
|
LL + #[derive(Debug)]
LL | struct Error;
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.
@@ -1,11 +0,0 @@
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
struct Error;
#[derive(Debug)]
struct Struct {
x: Error //~ ERROR
}
fn main() {}
@@ -1,19 +0,0 @@
error[E0277]: `Error` doesn't implement `Debug`
--> $DIR/derives-span-Debug-struct.rs:8:5
|
LL | #[derive(Debug)]
| ----- in this derive macro expansion
LL | struct Struct {
LL | x: Error
| ^^^^^^^^ the trait `Debug` is not implemented for `Error`
|
= note: add `#[derive(Debug)]` to `Error` or manually `impl Debug for Error`
help: consider annotating `Error` with `#[derive(Debug)]`
|
LL + #[derive(Debug)]
LL | struct Error;
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.
@@ -1,11 +0,0 @@
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
struct Error;
#[derive(Debug)]
struct Struct(
Error //~ ERROR
);
fn main() {}
@@ -1,19 +0,0 @@
error[E0277]: `Error` doesn't implement `Debug`
--> $DIR/derives-span-Debug-tuple-struct.rs:8:5
|
LL | #[derive(Debug)]
| ----- in this derive macro expansion
LL | struct Struct(
LL | Error
| ^^^^^ the trait `Debug` is not implemented for `Error`
|
= note: add `#[derive(Debug)]` to `Error` or manually `impl Debug for Error`
help: consider annotating `Error` with `#[derive(Debug)]`
|
LL + #[derive(Debug)]
LL | struct Error;
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.
+29
View File
@@ -0,0 +1,29 @@
//! Check that all the derives have spans that point to the fields,
//! rather than the #[derive(Debug)] line.
struct Error;
#[derive(Debug)]
enum EnumStructVariant {
A {
x: Error, //~ ERROR
},
}
#[derive(Debug)]
enum EnumTupleVariant {
A(
Error, //~ ERROR
),
}
#[derive(Debug)]
struct Struct {
x: Error, //~ ERROR
}
#[derive(Debug)]
struct TupleStruct(
Error, //~ ERROR
);
fn main() {}
@@ -0,0 +1,67 @@
error[E0277]: `Error` doesn't implement `Debug`
--> $DIR/derives-span-Debug.rs:9:9
|
LL | #[derive(Debug)]
| ----- in this derive macro expansion
...
LL | x: Error,
| ^^^^^^^^ the trait `Debug` is not implemented for `Error`
|
= note: add `#[derive(Debug)]` to `Error` or manually `impl Debug for Error`
help: consider annotating `Error` with `#[derive(Debug)]`
|
LL + #[derive(Debug)]
LL | struct Error;
|
error[E0277]: `Error` doesn't implement `Debug`
--> $DIR/derives-span-Debug.rs:16:9
|
LL | #[derive(Debug)]
| ----- in this derive macro expansion
...
LL | Error,
| ^^^^^ the trait `Debug` is not implemented for `Error`
|
= note: add `#[derive(Debug)]` to `Error` or manually `impl Debug for Error`
help: consider annotating `Error` with `#[derive(Debug)]`
|
LL + #[derive(Debug)]
LL | struct Error;
|
error[E0277]: `Error` doesn't implement `Debug`
--> $DIR/derives-span-Debug.rs:21:5
|
LL | #[derive(Debug)]
| ----- in this derive macro expansion
LL | struct Struct {
LL | x: Error,
| ^^^^^^^^ the trait `Debug` is not implemented for `Error`
|
= note: add `#[derive(Debug)]` to `Error` or manually `impl Debug for Error`
help: consider annotating `Error` with `#[derive(Debug)]`
|
LL + #[derive(Debug)]
LL | struct Error;
|
error[E0277]: `Error` doesn't implement `Debug`
--> $DIR/derives-span-Debug.rs:26:5
|
LL | #[derive(Debug)]
| ----- in this derive macro expansion
LL | struct TupleStruct(
LL | Error,
| ^^^^^ the trait `Debug` is not implemented for `Error`
|
= note: add `#[derive(Debug)]` to `Error` or manually `impl Debug for Error`
help: consider annotating `Error` with `#[derive(Debug)]`
|
LL + #[derive(Debug)]
LL | struct Error;
|
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0277`.
@@ -1,11 +0,0 @@
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
struct Error;
#[derive(Default)]
struct Struct {
x: Error //~ ERROR
}
fn main() {}
@@ -1,18 +0,0 @@
error[E0277]: the trait bound `Error: Default` is not satisfied
--> $DIR/derives-span-Default-struct.rs:8:5
|
LL | #[derive(Default)]
| ------- in this derive macro expansion
LL | struct Struct {
LL | x: Error
| ^^^^^^^^ the trait `Default` is not implemented for `Error`
|
help: consider annotating `Error` with `#[derive(Default)]`
|
LL + #[derive(Default)]
LL | struct Error;
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.
@@ -1,11 +0,0 @@
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
struct Error;
#[derive(Default)]
struct Struct(
Error //~ ERROR
);
fn main() {}
@@ -1,18 +0,0 @@
error[E0277]: the trait bound `Error: Default` is not satisfied
--> $DIR/derives-span-Default-tuple-struct.rs:8:5
|
LL | #[derive(Default)]
| ------- in this derive macro expansion
LL | struct Struct(
LL | Error
| ^^^^^ the trait `Default` is not implemented for `Error`
|
help: consider annotating `Error` with `#[derive(Default)]`
|
LL + #[derive(Default)]
LL | struct Error;
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.
+16
View File
@@ -0,0 +1,16 @@
//! Check that all the derives have spans that point to the fields,
//! rather than the #[derive(Default)] line.
struct Error;
#[derive(Default)]
struct Struct {
x: Error, //~ ERROR
}
#[derive(Default)]
struct TupleStruct(
Error, //~ ERROR
);
fn main() {}
@@ -0,0 +1,33 @@
error[E0277]: the trait bound `Error: Default` is not satisfied
--> $DIR/derives-span-Default.rs:8:5
|
LL | #[derive(Default)]
| ------- in this derive macro expansion
LL | struct Struct {
LL | x: Error,
| ^^^^^^^^ the trait `Default` is not implemented for `Error`
|
help: consider annotating `Error` with `#[derive(Default)]`
|
LL + #[derive(Default)]
LL | struct Error;
|
error[E0277]: the trait bound `Error: Default` is not satisfied
--> $DIR/derives-span-Default.rs:13:5
|
LL | #[derive(Default)]
| ------- in this derive macro expansion
LL | struct TupleStruct(
LL | Error,
| ^^^^^ the trait `Default` is not implemented for `Error`
|
help: consider annotating `Error` with `#[derive(Default)]`
|
LL + #[derive(Default)]
LL | struct Error;
|
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0277`.
@@ -1,13 +0,0 @@
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
#[derive(PartialEq)]
struct Error;
#[derive(Eq,PartialEq)]
enum Enum {
A {
x: Error //~ ERROR
}
}
fn main() {}
@@ -1,20 +0,0 @@
error[E0277]: the trait bound `Error: Eq` is not satisfied
--> $DIR/derives-span-Eq-enum-struct-variant.rs:9:6
|
LL | #[derive(Eq,PartialEq)]
| -- in this derive macro expansion
...
LL | x: Error
| ^^^^^^^^ the trait `Eq` is not implemented for `Error`
|
note: required by a bound in `std::cmp::AssertParamIsEq`
--> $SRC_DIR/core/src/cmp.rs:LL:COL
help: consider annotating `Error` with `#[derive(Eq)]`
|
LL + #[derive(Eq)]
LL | struct Error;
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.
-13
View File
@@ -1,13 +0,0 @@
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
#[derive(PartialEq)]
struct Error;
#[derive(Eq,PartialEq)]
enum Enum {
A(
Error //~ ERROR
)
}
fn main() {}
@@ -1,20 +0,0 @@
error[E0277]: the trait bound `Error: Eq` is not satisfied
--> $DIR/derives-span-Eq-enum.rs:9:6
|
LL | #[derive(Eq,PartialEq)]
| -- in this derive macro expansion
...
LL | Error
| ^^^^^ the trait `Eq` is not implemented for `Error`
|
note: required by a bound in `std::cmp::AssertParamIsEq`
--> $SRC_DIR/core/src/cmp.rs:LL:COL
help: consider annotating `Error` with `#[derive(Eq)]`
|
LL + #[derive(Eq)]
LL | struct Error;
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.
@@ -1,11 +0,0 @@
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
#[derive(PartialEq)]
struct Error;
#[derive(Eq,PartialEq)]
struct Struct {
x: Error //~ ERROR
}
fn main() {}
@@ -1,20 +0,0 @@
error[E0277]: the trait bound `Error: Eq` is not satisfied
--> $DIR/derives-span-Eq-struct.rs:8:5
|
LL | #[derive(Eq,PartialEq)]
| -- in this derive macro expansion
LL | struct Struct {
LL | x: Error
| ^^^^^^^^ the trait `Eq` is not implemented for `Error`
|
note: required by a bound in `std::cmp::AssertParamIsEq`
--> $SRC_DIR/core/src/cmp.rs:LL:COL
help: consider annotating `Error` with `#[derive(Eq)]`
|
LL + #[derive(Eq)]
LL | struct Error;
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.
@@ -1,11 +0,0 @@
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
#[derive(PartialEq)]
struct Error;
#[derive(Eq,PartialEq)]
struct Struct(
Error //~ ERROR
);
fn main() {}
@@ -1,20 +0,0 @@
error[E0277]: the trait bound `Error: Eq` is not satisfied
--> $DIR/derives-span-Eq-tuple-struct.rs:8:5
|
LL | #[derive(Eq,PartialEq)]
| -- in this derive macro expansion
LL | struct Struct(
LL | Error
| ^^^^^ the trait `Eq` is not implemented for `Error`
|
note: required by a bound in `std::cmp::AssertParamIsEq`
--> $SRC_DIR/core/src/cmp.rs:LL:COL
help: consider annotating `Error` with `#[derive(Eq)]`
|
LL + #[derive(Eq)]
LL | struct Error;
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.
+31
View File
@@ -0,0 +1,31 @@
//! Check that all the derives have spans that point to the fields,
//! rather than the #[derive(Eq)] line.
#[derive(PartialEq)]
struct Error;
#[derive(Eq, PartialEq)]
enum EnumStructVariant {
A {
x: Error, //~ ERROR
},
}
#[derive(Eq, PartialEq)]
enum EnumTupleVariant {
A(
Error, //~ ERROR
),
}
#[derive(Eq, PartialEq)]
struct Struct {
x: Error, //~ ERROR
}
#[derive(Eq, PartialEq)]
struct TupleStruct(
Error, //~ ERROR
);
fn main() {}
+71
View File
@@ -0,0 +1,71 @@
error[E0277]: the trait bound `Error: Eq` is not satisfied
--> $DIR/derives-span-Eq.rs:10:9
|
LL | #[derive(Eq, PartialEq)]
| -- in this derive macro expansion
...
LL | x: Error,
| ^^^^^^^^ the trait `Eq` is not implemented for `Error`
|
note: required by a bound in `std::cmp::AssertParamIsEq`
--> $SRC_DIR/core/src/cmp.rs:LL:COL
help: consider annotating `Error` with `#[derive(Eq)]`
|
LL + #[derive(Eq)]
LL | struct Error;
|
error[E0277]: the trait bound `Error: Eq` is not satisfied
--> $DIR/derives-span-Eq.rs:17:9
|
LL | #[derive(Eq, PartialEq)]
| -- in this derive macro expansion
...
LL | Error,
| ^^^^^ the trait `Eq` is not implemented for `Error`
|
note: required by a bound in `std::cmp::AssertParamIsEq`
--> $SRC_DIR/core/src/cmp.rs:LL:COL
help: consider annotating `Error` with `#[derive(Eq)]`
|
LL + #[derive(Eq)]
LL | struct Error;
|
error[E0277]: the trait bound `Error: Eq` is not satisfied
--> $DIR/derives-span-Eq.rs:23:5
|
LL | #[derive(Eq, PartialEq)]
| -- in this derive macro expansion
LL | struct Struct {
LL | x: Error,
| ^^^^^^^^ the trait `Eq` is not implemented for `Error`
|
note: required by a bound in `std::cmp::AssertParamIsEq`
--> $SRC_DIR/core/src/cmp.rs:LL:COL
help: consider annotating `Error` with `#[derive(Eq)]`
|
LL + #[derive(Eq)]
LL | struct Error;
|
error[E0277]: the trait bound `Error: Eq` is not satisfied
--> $DIR/derives-span-Eq.rs:28:5
|
LL | #[derive(Eq, PartialEq)]
| -- in this derive macro expansion
LL | struct TupleStruct(
LL | Error,
| ^^^^^ the trait `Eq` is not implemented for `Error`
|
note: required by a bound in `std::cmp::AssertParamIsEq`
--> $SRC_DIR/core/src/cmp.rs:LL:COL
help: consider annotating `Error` with `#[derive(Eq)]`
|
LL + #[derive(Eq)]
LL | struct Error;
|
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0277`.
@@ -1,13 +0,0 @@
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
struct Error;
#[derive(Hash)]
enum Enum {
A {
x: Error //~ ERROR
}
}
fn main() {}
@@ -1,18 +0,0 @@
error[E0277]: the trait bound `Error: Hash` is not satisfied
--> $DIR/derives-span-Hash-enum-struct-variant.rs:9:6
|
LL | #[derive(Hash)]
| ---- in this derive macro expansion
...
LL | x: Error
| ^^^^^^^^ the trait `Hash` is not implemented for `Error`
|
help: consider annotating `Error` with `#[derive(Hash)]`
|
LL + #[derive(Hash)]
LL | struct Error;
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.
@@ -1,12 +0,0 @@
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
struct Error;
#[derive(Hash)]
enum Enum {
A(
Error //~ ERROR
)
}
fn main() {}
@@ -1,18 +0,0 @@
error[E0277]: the trait bound `Error: Hash` is not satisfied
--> $DIR/derives-span-Hash-enum.rs:8:6
|
LL | #[derive(Hash)]
| ---- in this derive macro expansion
...
LL | Error
| ^^^^^ the trait `Hash` is not implemented for `Error`
|
help: consider annotating `Error` with `#[derive(Hash)]`
|
LL + #[derive(Hash)]
LL | struct Error;
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.
@@ -1,11 +0,0 @@
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
struct Error;
#[derive(Hash)]
struct Struct {
x: Error //~ ERROR
}
fn main() {}
@@ -1,18 +0,0 @@
error[E0277]: the trait bound `Error: Hash` is not satisfied
--> $DIR/derives-span-Hash-struct.rs:8:5
|
LL | #[derive(Hash)]
| ---- in this derive macro expansion
LL | struct Struct {
LL | x: Error
| ^^^^^^^^ the trait `Hash` is not implemented for `Error`
|
help: consider annotating `Error` with `#[derive(Hash)]`
|
LL + #[derive(Hash)]
LL | struct Error;
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.
@@ -1,11 +0,0 @@
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
struct Error;
#[derive(Hash)]
struct Struct(
Error //~ ERROR
);
fn main() {}
@@ -1,18 +0,0 @@
error[E0277]: the trait bound `Error: Hash` is not satisfied
--> $DIR/derives-span-Hash-tuple-struct.rs:8:5
|
LL | #[derive(Hash)]
| ---- in this derive macro expansion
LL | struct Struct(
LL | Error
| ^^^^^ the trait `Hash` is not implemented for `Error`
|
help: consider annotating `Error` with `#[derive(Hash)]`
|
LL + #[derive(Hash)]
LL | struct Error;
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.
+30
View File
@@ -0,0 +1,30 @@
//! Check that all the derives have spans that point to the fields,
//! rather than the #[derive(Hash)] line.
struct Error;
#[derive(Hash)]
enum EnumStructVariant {
A {
x: Error, //~ ERROR
},
}
#[derive(Hash)]
enum EnumTupleVariant {
A(
Error, //~ ERROR
),
}
#[derive(Hash)]
struct Struct {
x: Error, //~ ERROR
}
#[derive(Hash)]
struct TupleStruct(
Error, //~ ERROR
);
fn main() {}
+63
View File
@@ -0,0 +1,63 @@
error[E0277]: the trait bound `Error: Hash` is not satisfied
--> $DIR/derives-span-Hash.rs:9:9
|
LL | #[derive(Hash)]
| ---- in this derive macro expansion
...
LL | x: Error,
| ^^^^^^^^ the trait `Hash` is not implemented for `Error`
|
help: consider annotating `Error` with `#[derive(Hash)]`
|
LL + #[derive(Hash)]
LL | struct Error;
|
error[E0277]: the trait bound `Error: Hash` is not satisfied
--> $DIR/derives-span-Hash.rs:16:9
|
LL | #[derive(Hash)]
| ---- in this derive macro expansion
...
LL | Error,
| ^^^^^ the trait `Hash` is not implemented for `Error`
|
help: consider annotating `Error` with `#[derive(Hash)]`
|
LL + #[derive(Hash)]
LL | struct Error;
|
error[E0277]: the trait bound `Error: Hash` is not satisfied
--> $DIR/derives-span-Hash.rs:22:5
|
LL | #[derive(Hash)]
| ---- in this derive macro expansion
LL | struct Struct {
LL | x: Error,
| ^^^^^^^^ the trait `Hash` is not implemented for `Error`
|
help: consider annotating `Error` with `#[derive(Hash)]`
|
LL + #[derive(Hash)]
LL | struct Error;
|
error[E0277]: the trait bound `Error: Hash` is not satisfied
--> $DIR/derives-span-Hash.rs:27:5
|
LL | #[derive(Hash)]
| ---- in this derive macro expansion
LL | struct TupleStruct(
LL | Error,
| ^^^^^ the trait `Hash` is not implemented for `Error`
|
help: consider annotating `Error` with `#[derive(Hash)]`
|
LL + #[derive(Hash)]
LL | struct Error;
|
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0277`.
@@ -1,13 +0,0 @@
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
#[derive(Eq,PartialOrd,PartialEq)]
struct Error;
#[derive(Ord,Eq,PartialOrd,PartialEq)]
enum Enum {
A {
x: Error //~ ERROR
}
}
fn main() {}
@@ -1,18 +0,0 @@
error[E0277]: the trait bound `Error: Ord` is not satisfied
--> $DIR/derives-span-Ord-enum-struct-variant.rs:9:6
|
LL | #[derive(Ord,Eq,PartialOrd,PartialEq)]
| --- in this derive macro expansion
...
LL | x: Error
| ^^^^^^^^ the trait `Ord` is not implemented for `Error`
|
help: consider annotating `Error` with `#[derive(Ord)]`
|
LL + #[derive(Ord)]
LL | struct Error;
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.
-13
View File
@@ -1,13 +0,0 @@
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
#[derive(Eq,PartialOrd,PartialEq)]
struct Error;
#[derive(Ord,Eq,PartialOrd,PartialEq)]
enum Enum {
A(
Error //~ ERROR
)
}
fn main() {}
@@ -1,18 +0,0 @@
error[E0277]: the trait bound `Error: Ord` is not satisfied
--> $DIR/derives-span-Ord-enum.rs:9:6
|
LL | #[derive(Ord,Eq,PartialOrd,PartialEq)]
| --- in this derive macro expansion
...
LL | Error
| ^^^^^ the trait `Ord` is not implemented for `Error`
|
help: consider annotating `Error` with `#[derive(Ord)]`
|
LL + #[derive(Ord)]
LL | struct Error;
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.
@@ -1,11 +0,0 @@
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
#[derive(Eq,PartialOrd,PartialEq)]
struct Error;
#[derive(Ord,Eq,PartialOrd,PartialEq)]
struct Struct {
x: Error //~ ERROR
}
fn main() {}
@@ -1,18 +0,0 @@
error[E0277]: the trait bound `Error: Ord` is not satisfied
--> $DIR/derives-span-Ord-struct.rs:8:5
|
LL | #[derive(Ord,Eq,PartialOrd,PartialEq)]
| --- in this derive macro expansion
LL | struct Struct {
LL | x: Error
| ^^^^^^^^ the trait `Ord` is not implemented for `Error`
|
help: consider annotating `Error` with `#[derive(Ord)]`
|
LL + #[derive(Ord)]
LL | struct Error;
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.
@@ -1,11 +0,0 @@
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
#[derive(Eq,PartialOrd,PartialEq)]
struct Error;
#[derive(Ord,Eq,PartialOrd,PartialEq)]
struct Struct(
Error //~ ERROR
);
fn main() {}
@@ -1,18 +0,0 @@
error[E0277]: the trait bound `Error: Ord` is not satisfied
--> $DIR/derives-span-Ord-tuple-struct.rs:8:5
|
LL | #[derive(Ord,Eq,PartialOrd,PartialEq)]
| --- in this derive macro expansion
LL | struct Struct(
LL | Error
| ^^^^^ the trait `Ord` is not implemented for `Error`
|
help: consider annotating `Error` with `#[derive(Ord)]`
|
LL + #[derive(Ord)]
LL | struct Error;
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.
+31
View File
@@ -0,0 +1,31 @@
//! Check that all the derives have spans that point to the fields,
//! rather than the #[derive(Ord)] line.
#[derive(Eq, PartialOrd, PartialEq)]
struct Error;
#[derive(Ord, Eq, PartialOrd, PartialEq)]
enum EnumStructVariant {
A {
x: Error, //~ ERROR
},
}
#[derive(Ord, Eq, PartialOrd, PartialEq)]
enum EnumTupleVariant {
A(
Error, //~ ERROR
),
}
#[derive(Ord, Eq, PartialOrd, PartialEq)]
struct Struct {
x: Error, //~ ERROR
}
#[derive(Ord, Eq, PartialOrd, PartialEq)]
struct TupleStruct(
Error, //~ ERROR
);
fn main() {}
+63
View File
@@ -0,0 +1,63 @@
error[E0277]: the trait bound `Error: Ord` is not satisfied
--> $DIR/derives-span-Ord.rs:10:9
|
LL | #[derive(Ord, Eq, PartialOrd, PartialEq)]
| --- in this derive macro expansion
...
LL | x: Error,
| ^^^^^^^^ the trait `Ord` is not implemented for `Error`
|
help: consider annotating `Error` with `#[derive(Ord)]`
|
LL + #[derive(Ord)]
LL | struct Error;
|
error[E0277]: the trait bound `Error: Ord` is not satisfied
--> $DIR/derives-span-Ord.rs:17:9
|
LL | #[derive(Ord, Eq, PartialOrd, PartialEq)]
| --- in this derive macro expansion
...
LL | Error,
| ^^^^^ the trait `Ord` is not implemented for `Error`
|
help: consider annotating `Error` with `#[derive(Ord)]`
|
LL + #[derive(Ord)]
LL | struct Error;
|
error[E0277]: the trait bound `Error: Ord` is not satisfied
--> $DIR/derives-span-Ord.rs:23:5
|
LL | #[derive(Ord, Eq, PartialOrd, PartialEq)]
| --- in this derive macro expansion
LL | struct Struct {
LL | x: Error,
| ^^^^^^^^ the trait `Ord` is not implemented for `Error`
|
help: consider annotating `Error` with `#[derive(Ord)]`
|
LL + #[derive(Ord)]
LL | struct Error;
|
error[E0277]: the trait bound `Error: Ord` is not satisfied
--> $DIR/derives-span-Ord.rs:28:5
|
LL | #[derive(Ord, Eq, PartialOrd, PartialEq)]
| --- in this derive macro expansion
LL | struct TupleStruct(
LL | Error,
| ^^^^^ the trait `Ord` is not implemented for `Error`
|
help: consider annotating `Error` with `#[derive(Ord)]`
|
LL + #[derive(Ord)]
LL | struct Error;
|
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0277`.
@@ -1,13 +0,0 @@
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
struct Error;
#[derive(PartialEq)]
enum Enum {
A {
x: Error //~ ERROR
}
}
fn main() {}
@@ -1,23 +0,0 @@
error[E0369]: binary operation `==` cannot be applied to type `&Error`
--> $DIR/derives-span-PartialEq-enum-struct-variant.rs:9:6
|
LL | #[derive(PartialEq)]
| --------- in this derive macro expansion
...
LL | x: Error
| ^^^^^^^^
|
note: an implementation of `PartialEq` might be missing for `Error`
--> $DIR/derives-span-PartialEq-enum-struct-variant.rs:4:1
|
LL | struct Error;
| ^^^^^^^^^^^^ must implement `PartialEq`
help: consider annotating `Error` with `#[derive(PartialEq)]`
|
LL + #[derive(PartialEq)]
LL | struct Error;
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0369`.
@@ -1,13 +0,0 @@
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
struct Error;
#[derive(PartialEq)]
enum Enum {
A(
Error //~ ERROR
)
}
fn main() {}
@@ -1,23 +0,0 @@
error[E0369]: binary operation `==` cannot be applied to type `&Error`
--> $DIR/derives-span-PartialEq-enum.rs:9:6
|
LL | #[derive(PartialEq)]
| --------- in this derive macro expansion
...
LL | Error
| ^^^^^
|
note: an implementation of `PartialEq` might be missing for `Error`
--> $DIR/derives-span-PartialEq-enum.rs:4:1
|
LL | struct Error;
| ^^^^^^^^^^^^ must implement `PartialEq`
help: consider annotating `Error` with `#[derive(PartialEq)]`
|
LL + #[derive(PartialEq)]
LL | struct Error;
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0369`.
@@ -1,11 +0,0 @@
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
struct Error;
#[derive(PartialEq)]
struct Struct {
x: Error //~ ERROR
}
fn main() {}
@@ -1,23 +0,0 @@
error[E0369]: binary operation `==` cannot be applied to type `Error`
--> $DIR/derives-span-PartialEq-struct.rs:8:5
|
LL | #[derive(PartialEq)]
| --------- in this derive macro expansion
LL | struct Struct {
LL | x: Error
| ^^^^^^^^
|
note: an implementation of `PartialEq` might be missing for `Error`
--> $DIR/derives-span-PartialEq-struct.rs:4:1
|
LL | struct Error;
| ^^^^^^^^^^^^ must implement `PartialEq`
help: consider annotating `Error` with `#[derive(PartialEq)]`
|
LL + #[derive(PartialEq)]
LL | struct Error;
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0369`.
@@ -1,11 +0,0 @@
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
struct Error;
#[derive(PartialEq)]
struct Struct(
Error //~ ERROR
);
fn main() {}
@@ -1,23 +0,0 @@
error[E0369]: binary operation `==` cannot be applied to type `Error`
--> $DIR/derives-span-PartialEq-tuple-struct.rs:8:5
|
LL | #[derive(PartialEq)]
| --------- in this derive macro expansion
LL | struct Struct(
LL | Error
| ^^^^^
|
note: an implementation of `PartialEq` might be missing for `Error`
--> $DIR/derives-span-PartialEq-tuple-struct.rs:4:1
|
LL | struct Error;
| ^^^^^^^^^^^^ must implement `PartialEq`
help: consider annotating `Error` with `#[derive(PartialEq)]`
|
LL + #[derive(PartialEq)]
LL | struct Error;
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0369`.
@@ -0,0 +1,29 @@
//! Check that all the derives have spans that point to the fields,
//! rather than the #[derive(PartialEq)] line.
struct Error;
#[derive(PartialEq)]
enum EnumStructVariant {
A {
x: Error, //~ ERROR
},
}
#[derive(PartialEq)]
enum EnumTupleVariant {
A(
Error, //~ ERROR
),
}
#[derive(PartialEq)]
struct Struct {
x: Error, //~ ERROR
}
#[derive(PartialEq)]
struct TupleStruct(
Error, //~ ERROR
);
fn main() {}
@@ -0,0 +1,83 @@
error[E0369]: binary operation `==` cannot be applied to type `&Error`
--> $DIR/derives-span-PartialEq.rs:9:9
|
LL | #[derive(PartialEq)]
| --------- in this derive macro expansion
...
LL | x: Error,
| ^^^^^^^^
|
note: an implementation of `PartialEq` might be missing for `Error`
--> $DIR/derives-span-PartialEq.rs:4:1
|
LL | struct Error;
| ^^^^^^^^^^^^ must implement `PartialEq`
help: consider annotating `Error` with `#[derive(PartialEq)]`
|
LL + #[derive(PartialEq)]
LL | struct Error;
|
error[E0369]: binary operation `==` cannot be applied to type `&Error`
--> $DIR/derives-span-PartialEq.rs:16:9
|
LL | #[derive(PartialEq)]
| --------- in this derive macro expansion
...
LL | Error,
| ^^^^^
|
note: an implementation of `PartialEq` might be missing for `Error`
--> $DIR/derives-span-PartialEq.rs:4:1
|
LL | struct Error;
| ^^^^^^^^^^^^ must implement `PartialEq`
help: consider annotating `Error` with `#[derive(PartialEq)]`
|
LL + #[derive(PartialEq)]
LL | struct Error;
|
error[E0369]: binary operation `==` cannot be applied to type `Error`
--> $DIR/derives-span-PartialEq.rs:21:5
|
LL | #[derive(PartialEq)]
| --------- in this derive macro expansion
LL | struct Struct {
LL | x: Error,
| ^^^^^^^^
|
note: an implementation of `PartialEq` might be missing for `Error`
--> $DIR/derives-span-PartialEq.rs:4:1
|
LL | struct Error;
| ^^^^^^^^^^^^ must implement `PartialEq`
help: consider annotating `Error` with `#[derive(PartialEq)]`
|
LL + #[derive(PartialEq)]
LL | struct Error;
|
error[E0369]: binary operation `==` cannot be applied to type `Error`
--> $DIR/derives-span-PartialEq.rs:26:5
|
LL | #[derive(PartialEq)]
| --------- in this derive macro expansion
LL | struct TupleStruct(
LL | Error,
| ^^^^^
|
note: an implementation of `PartialEq` might be missing for `Error`
--> $DIR/derives-span-PartialEq.rs:4:1
|
LL | struct Error;
| ^^^^^^^^^^^^ must implement `PartialEq`
help: consider annotating `Error` with `#[derive(PartialEq)]`
|
LL + #[derive(PartialEq)]
LL | struct Error;
|
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0369`.
@@ -1,13 +0,0 @@
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
#[derive(PartialEq)]
struct Error;
#[derive(PartialOrd,PartialEq)]
enum Enum {
A {
x: Error //~ ERROR can't compare `Error` with `Error`
}
}
fn main() {}
@@ -1,19 +0,0 @@
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-enum-struct-variant.rs:9:6
|
LL | #[derive(PartialOrd,PartialEq)]
| ---------- in this derive macro expansion
...
LL | x: Error
| ^^^^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `PartialOrd` is not implemented for `Error`
help: consider annotating `Error` with `#[derive(PartialOrd)]`
|
LL + #[derive(PartialOrd)]
LL | struct Error;
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.
@@ -1,13 +0,0 @@
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
#[derive(PartialEq)]
struct Error;
#[derive(PartialOrd,PartialEq)]
enum Enum {
A(
Error //~ ERROR can't compare `Error` with `Error`
)
}
fn main() {}
@@ -1,19 +0,0 @@
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-enum.rs:9:6
|
LL | #[derive(PartialOrd,PartialEq)]
| ---------- in this derive macro expansion
...
LL | Error
| ^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `PartialOrd` is not implemented for `Error`
help: consider annotating `Error` with `#[derive(PartialOrd)]`
|
LL + #[derive(PartialOrd)]
LL | struct Error;
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.
@@ -1,11 +0,0 @@
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
#[derive(PartialEq)]
struct Error;
#[derive(PartialOrd,PartialEq)]
struct Struct {
x: Error //~ ERROR can't compare `Error` with `Error`
}
fn main() {}
@@ -1,19 +0,0 @@
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-struct.rs:8:5
|
LL | #[derive(PartialOrd,PartialEq)]
| ---------- in this derive macro expansion
LL | struct Struct {
LL | x: Error
| ^^^^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `PartialOrd` is not implemented for `Error`
help: consider annotating `Error` with `#[derive(PartialOrd)]`
|
LL + #[derive(PartialOrd)]
LL | struct Error;
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.
@@ -1,11 +0,0 @@
// This file was auto-generated using 'src/etc/generate-deriving-span-tests.py'
#[derive(PartialEq)]
struct Error;
#[derive(PartialOrd,PartialEq)]
struct Struct(
Error //~ ERROR can't compare `Error` with `Error`
);
fn main() {}
@@ -1,19 +0,0 @@
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-tuple-struct.rs:8:5
|
LL | #[derive(PartialOrd,PartialEq)]
| ---------- in this derive macro expansion
LL | struct Struct(
LL | Error
| ^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `PartialOrd` is not implemented for `Error`
help: consider annotating `Error` with `#[derive(PartialOrd)]`
|
LL + #[derive(PartialOrd)]
LL | struct Error;
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0277`.
@@ -0,0 +1,31 @@
//! Check that all the derives have spans that point to the fields,
//! rather than the #[derive(PartialOrd)] line.
#[derive(PartialEq)]
struct Error;
#[derive(PartialOrd, PartialEq)]
enum EnumStructVariant {
A {
x: Error, //~ ERROR
},
}
#[derive(PartialOrd, PartialEq)]
enum EnumTupleVariant {
A(
Error, //~ ERROR
),
}
#[derive(PartialOrd, PartialEq)]
struct Struct {
x: Error, //~ ERROR
}
#[derive(PartialOrd, PartialEq)]
struct TupleStruct(
Error, //~ ERROR
);
fn main() {}
@@ -0,0 +1,67 @@
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd.rs:10:9
|
LL | #[derive(PartialOrd, PartialEq)]
| ---------- in this derive macro expansion
...
LL | x: Error,
| ^^^^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `PartialOrd` is not implemented for `Error`
help: consider annotating `Error` with `#[derive(PartialOrd)]`
|
LL + #[derive(PartialOrd)]
LL | struct Error;
|
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd.rs:17:9
|
LL | #[derive(PartialOrd, PartialEq)]
| ---------- in this derive macro expansion
...
LL | Error,
| ^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `PartialOrd` is not implemented for `Error`
help: consider annotating `Error` with `#[derive(PartialOrd)]`
|
LL + #[derive(PartialOrd)]
LL | struct Error;
|
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd.rs:23:5
|
LL | #[derive(PartialOrd, PartialEq)]
| ---------- in this derive macro expansion
LL | struct Struct {
LL | x: Error,
| ^^^^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `PartialOrd` is not implemented for `Error`
help: consider annotating `Error` with `#[derive(PartialOrd)]`
|
LL + #[derive(PartialOrd)]
LL | struct Error;
|
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd.rs:28:5
|
LL | #[derive(PartialOrd, PartialEq)]
| ---------- in this derive macro expansion
LL | struct TupleStruct(
LL | Error,
| ^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `PartialOrd` is not implemented for `Error`
help: consider annotating `Error` with `#[derive(PartialOrd)]`
|
LL + #[derive(PartialOrd)]
LL | struct Error;
|
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0277`.
-5
View File
@@ -1,5 +0,0 @@
#[derive(FromPrimitive)] //~ ERROR cannot find derive macro `FromPrimitive` in this scope
//~| ERROR cannot find derive macro `FromPrimitive` in this scope
enum Foo {}
fn main() {}
@@ -1,16 +0,0 @@
error: cannot find derive macro `FromPrimitive` in this scope
--> $DIR/deriving-primitive.rs:1:10
|
LL | #[derive(FromPrimitive)]
| ^^^^^^^^^^^^^
error: cannot find derive macro `FromPrimitive` in this scope
--> $DIR/deriving-primitive.rs:1:10
|
LL | #[derive(FromPrimitive)]
| ^^^^^^^^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: aborting due to 2 previous errors