diff --git a/src/etc/generate-deriving-span-tests.py b/src/etc/generate-deriving-span-tests.py deleted file mode 100755 index 2e810d7df97b..000000000000 --- a/src/etc/generate-deriving-span-tests.py +++ /dev/null @@ -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)) diff --git a/tests/ui/derives/derives-span-Clone-enum-struct-variant.rs b/tests/ui/derives/derives-span-Clone-enum-struct-variant.rs deleted file mode 100644 index b556d442420e..000000000000 --- a/tests/ui/derives/derives-span-Clone-enum-struct-variant.rs +++ /dev/null @@ -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() {} diff --git a/tests/ui/derives/derives-span-Clone-enum-struct-variant.stderr b/tests/ui/derives/derives-span-Clone-enum-struct-variant.stderr deleted file mode 100644 index 9aeb3a8c03d2..000000000000 --- a/tests/ui/derives/derives-span-Clone-enum-struct-variant.stderr +++ /dev/null @@ -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`. diff --git a/tests/ui/derives/derives-span-Clone-enum.rs b/tests/ui/derives/derives-span-Clone-enum.rs deleted file mode 100644 index 9bb4f486c3ef..000000000000 --- a/tests/ui/derives/derives-span-Clone-enum.rs +++ /dev/null @@ -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() {} diff --git a/tests/ui/derives/derives-span-Clone-enum.stderr b/tests/ui/derives/derives-span-Clone-enum.stderr deleted file mode 100644 index 6b4f22416631..000000000000 --- a/tests/ui/derives/derives-span-Clone-enum.stderr +++ /dev/null @@ -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`. diff --git a/tests/ui/derives/derives-span-Clone-struct.rs b/tests/ui/derives/derives-span-Clone-struct.rs deleted file mode 100644 index f151636f848a..000000000000 --- a/tests/ui/derives/derives-span-Clone-struct.rs +++ /dev/null @@ -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() {} diff --git a/tests/ui/derives/derives-span-Clone-struct.stderr b/tests/ui/derives/derives-span-Clone-struct.stderr deleted file mode 100644 index 17e3f0eccf92..000000000000 --- a/tests/ui/derives/derives-span-Clone-struct.stderr +++ /dev/null @@ -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`. diff --git a/tests/ui/derives/derives-span-Clone-tuple-struct.rs b/tests/ui/derives/derives-span-Clone-tuple-struct.rs deleted file mode 100644 index 7a62885324eb..000000000000 --- a/tests/ui/derives/derives-span-Clone-tuple-struct.rs +++ /dev/null @@ -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() {} diff --git a/tests/ui/derives/derives-span-Clone-tuple-struct.stderr b/tests/ui/derives/derives-span-Clone-tuple-struct.stderr deleted file mode 100644 index f8380d197b06..000000000000 --- a/tests/ui/derives/derives-span-Clone-tuple-struct.stderr +++ /dev/null @@ -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`. diff --git a/tests/ui/derives/derives-span-Clone.rs b/tests/ui/derives/derives-span-Clone.rs new file mode 100644 index 000000000000..985fbd36db6d --- /dev/null +++ b/tests/ui/derives/derives-span-Clone.rs @@ -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() {} diff --git a/tests/ui/derives/derives-span-Clone.stderr b/tests/ui/derives/derives-span-Clone.stderr new file mode 100644 index 000000000000..daf8ef209819 --- /dev/null +++ b/tests/ui/derives/derives-span-Clone.stderr @@ -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`. diff --git a/tests/ui/derives/derives-span-Debug-enum-struct-variant.rs b/tests/ui/derives/derives-span-Debug-enum-struct-variant.rs deleted file mode 100644 index 949597bc8f6e..000000000000 --- a/tests/ui/derives/derives-span-Debug-enum-struct-variant.rs +++ /dev/null @@ -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() {} diff --git a/tests/ui/derives/derives-span-Debug-enum-struct-variant.stderr b/tests/ui/derives/derives-span-Debug-enum-struct-variant.stderr deleted file mode 100644 index 147910b715f5..000000000000 --- a/tests/ui/derives/derives-span-Debug-enum-struct-variant.stderr +++ /dev/null @@ -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`. diff --git a/tests/ui/derives/derives-span-Debug-enum.rs b/tests/ui/derives/derives-span-Debug-enum.rs deleted file mode 100644 index b2a39708ceb9..000000000000 --- a/tests/ui/derives/derives-span-Debug-enum.rs +++ /dev/null @@ -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() {} diff --git a/tests/ui/derives/derives-span-Debug-enum.stderr b/tests/ui/derives/derives-span-Debug-enum.stderr deleted file mode 100644 index 6f97ceb02d3a..000000000000 --- a/tests/ui/derives/derives-span-Debug-enum.stderr +++ /dev/null @@ -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`. diff --git a/tests/ui/derives/derives-span-Debug-struct.rs b/tests/ui/derives/derives-span-Debug-struct.rs deleted file mode 100644 index cf91c9436a62..000000000000 --- a/tests/ui/derives/derives-span-Debug-struct.rs +++ /dev/null @@ -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() {} diff --git a/tests/ui/derives/derives-span-Debug-struct.stderr b/tests/ui/derives/derives-span-Debug-struct.stderr deleted file mode 100644 index 46d69a892f25..000000000000 --- a/tests/ui/derives/derives-span-Debug-struct.stderr +++ /dev/null @@ -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`. diff --git a/tests/ui/derives/derives-span-Debug-tuple-struct.rs b/tests/ui/derives/derives-span-Debug-tuple-struct.rs deleted file mode 100644 index cea973c91a78..000000000000 --- a/tests/ui/derives/derives-span-Debug-tuple-struct.rs +++ /dev/null @@ -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() {} diff --git a/tests/ui/derives/derives-span-Debug-tuple-struct.stderr b/tests/ui/derives/derives-span-Debug-tuple-struct.stderr deleted file mode 100644 index a3feeff6df37..000000000000 --- a/tests/ui/derives/derives-span-Debug-tuple-struct.stderr +++ /dev/null @@ -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`. diff --git a/tests/ui/derives/derives-span-Debug.rs b/tests/ui/derives/derives-span-Debug.rs new file mode 100644 index 000000000000..1bc10a04c6f1 --- /dev/null +++ b/tests/ui/derives/derives-span-Debug.rs @@ -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() {} diff --git a/tests/ui/derives/derives-span-Debug.stderr b/tests/ui/derives/derives-span-Debug.stderr new file mode 100644 index 000000000000..e4a2560db451 --- /dev/null +++ b/tests/ui/derives/derives-span-Debug.stderr @@ -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`. diff --git a/tests/ui/derives/derives-span-Default-struct.rs b/tests/ui/derives/derives-span-Default-struct.rs deleted file mode 100644 index 71fd5829e758..000000000000 --- a/tests/ui/derives/derives-span-Default-struct.rs +++ /dev/null @@ -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() {} diff --git a/tests/ui/derives/derives-span-Default-struct.stderr b/tests/ui/derives/derives-span-Default-struct.stderr deleted file mode 100644 index 442081f78ce7..000000000000 --- a/tests/ui/derives/derives-span-Default-struct.stderr +++ /dev/null @@ -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`. diff --git a/tests/ui/derives/derives-span-Default-tuple-struct.rs b/tests/ui/derives/derives-span-Default-tuple-struct.rs deleted file mode 100644 index 463f7d230ca4..000000000000 --- a/tests/ui/derives/derives-span-Default-tuple-struct.rs +++ /dev/null @@ -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() {} diff --git a/tests/ui/derives/derives-span-Default-tuple-struct.stderr b/tests/ui/derives/derives-span-Default-tuple-struct.stderr deleted file mode 100644 index e786ec1e9dab..000000000000 --- a/tests/ui/derives/derives-span-Default-tuple-struct.stderr +++ /dev/null @@ -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`. diff --git a/tests/ui/derives/derives-span-Default.rs b/tests/ui/derives/derives-span-Default.rs new file mode 100644 index 000000000000..7ea91acf823d --- /dev/null +++ b/tests/ui/derives/derives-span-Default.rs @@ -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() {} diff --git a/tests/ui/derives/derives-span-Default.stderr b/tests/ui/derives/derives-span-Default.stderr new file mode 100644 index 000000000000..9c606171cde8 --- /dev/null +++ b/tests/ui/derives/derives-span-Default.stderr @@ -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`. diff --git a/tests/ui/derives/derives-span-Eq-enum-struct-variant.rs b/tests/ui/derives/derives-span-Eq-enum-struct-variant.rs deleted file mode 100644 index d2dab8687f77..000000000000 --- a/tests/ui/derives/derives-span-Eq-enum-struct-variant.rs +++ /dev/null @@ -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() {} diff --git a/tests/ui/derives/derives-span-Eq-enum-struct-variant.stderr b/tests/ui/derives/derives-span-Eq-enum-struct-variant.stderr deleted file mode 100644 index 42dc8d46b575..000000000000 --- a/tests/ui/derives/derives-span-Eq-enum-struct-variant.stderr +++ /dev/null @@ -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`. diff --git a/tests/ui/derives/derives-span-Eq-enum.rs b/tests/ui/derives/derives-span-Eq-enum.rs deleted file mode 100644 index c6c0d4321083..000000000000 --- a/tests/ui/derives/derives-span-Eq-enum.rs +++ /dev/null @@ -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() {} diff --git a/tests/ui/derives/derives-span-Eq-enum.stderr b/tests/ui/derives/derives-span-Eq-enum.stderr deleted file mode 100644 index ef1d9e3242ad..000000000000 --- a/tests/ui/derives/derives-span-Eq-enum.stderr +++ /dev/null @@ -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`. diff --git a/tests/ui/derives/derives-span-Eq-struct.rs b/tests/ui/derives/derives-span-Eq-struct.rs deleted file mode 100644 index df310039847d..000000000000 --- a/tests/ui/derives/derives-span-Eq-struct.rs +++ /dev/null @@ -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() {} diff --git a/tests/ui/derives/derives-span-Eq-struct.stderr b/tests/ui/derives/derives-span-Eq-struct.stderr deleted file mode 100644 index bae7bb0361df..000000000000 --- a/tests/ui/derives/derives-span-Eq-struct.stderr +++ /dev/null @@ -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`. diff --git a/tests/ui/derives/derives-span-Eq-tuple-struct.rs b/tests/ui/derives/derives-span-Eq-tuple-struct.rs deleted file mode 100644 index abf6526b9007..000000000000 --- a/tests/ui/derives/derives-span-Eq-tuple-struct.rs +++ /dev/null @@ -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() {} diff --git a/tests/ui/derives/derives-span-Eq-tuple-struct.stderr b/tests/ui/derives/derives-span-Eq-tuple-struct.stderr deleted file mode 100644 index 13396cb27246..000000000000 --- a/tests/ui/derives/derives-span-Eq-tuple-struct.stderr +++ /dev/null @@ -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`. diff --git a/tests/ui/derives/derives-span-Eq.rs b/tests/ui/derives/derives-span-Eq.rs new file mode 100644 index 000000000000..d2c889c10b9e --- /dev/null +++ b/tests/ui/derives/derives-span-Eq.rs @@ -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() {} diff --git a/tests/ui/derives/derives-span-Eq.stderr b/tests/ui/derives/derives-span-Eq.stderr new file mode 100644 index 000000000000..02da9e2ade45 --- /dev/null +++ b/tests/ui/derives/derives-span-Eq.stderr @@ -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`. diff --git a/tests/ui/derives/derives-span-Hash-enum-struct-variant.rs b/tests/ui/derives/derives-span-Hash-enum-struct-variant.rs deleted file mode 100644 index 3018a7b6d03e..000000000000 --- a/tests/ui/derives/derives-span-Hash-enum-struct-variant.rs +++ /dev/null @@ -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() {} diff --git a/tests/ui/derives/derives-span-Hash-enum-struct-variant.stderr b/tests/ui/derives/derives-span-Hash-enum-struct-variant.stderr deleted file mode 100644 index 9854b61d31bb..000000000000 --- a/tests/ui/derives/derives-span-Hash-enum-struct-variant.stderr +++ /dev/null @@ -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`. diff --git a/tests/ui/derives/derives-span-Hash-enum.rs b/tests/ui/derives/derives-span-Hash-enum.rs deleted file mode 100644 index 8ce7df18f06f..000000000000 --- a/tests/ui/derives/derives-span-Hash-enum.rs +++ /dev/null @@ -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() {} diff --git a/tests/ui/derives/derives-span-Hash-enum.stderr b/tests/ui/derives/derives-span-Hash-enum.stderr deleted file mode 100644 index 60e7d0cf1ff9..000000000000 --- a/tests/ui/derives/derives-span-Hash-enum.stderr +++ /dev/null @@ -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`. diff --git a/tests/ui/derives/derives-span-Hash-struct.rs b/tests/ui/derives/derives-span-Hash-struct.rs deleted file mode 100644 index fa5e2af6be87..000000000000 --- a/tests/ui/derives/derives-span-Hash-struct.rs +++ /dev/null @@ -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() {} diff --git a/tests/ui/derives/derives-span-Hash-struct.stderr b/tests/ui/derives/derives-span-Hash-struct.stderr deleted file mode 100644 index 3851cf8ce8b0..000000000000 --- a/tests/ui/derives/derives-span-Hash-struct.stderr +++ /dev/null @@ -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`. diff --git a/tests/ui/derives/derives-span-Hash-tuple-struct.rs b/tests/ui/derives/derives-span-Hash-tuple-struct.rs deleted file mode 100644 index 3822bce1466e..000000000000 --- a/tests/ui/derives/derives-span-Hash-tuple-struct.rs +++ /dev/null @@ -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() {} diff --git a/tests/ui/derives/derives-span-Hash-tuple-struct.stderr b/tests/ui/derives/derives-span-Hash-tuple-struct.stderr deleted file mode 100644 index e5a3e7a55664..000000000000 --- a/tests/ui/derives/derives-span-Hash-tuple-struct.stderr +++ /dev/null @@ -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`. diff --git a/tests/ui/derives/derives-span-Hash.rs b/tests/ui/derives/derives-span-Hash.rs new file mode 100644 index 000000000000..73dacb67c6b6 --- /dev/null +++ b/tests/ui/derives/derives-span-Hash.rs @@ -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() {} diff --git a/tests/ui/derives/derives-span-Hash.stderr b/tests/ui/derives/derives-span-Hash.stderr new file mode 100644 index 000000000000..41ba8d42ac5a --- /dev/null +++ b/tests/ui/derives/derives-span-Hash.stderr @@ -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`. diff --git a/tests/ui/derives/derives-span-Ord-enum-struct-variant.rs b/tests/ui/derives/derives-span-Ord-enum-struct-variant.rs deleted file mode 100644 index 62355cc2d961..000000000000 --- a/tests/ui/derives/derives-span-Ord-enum-struct-variant.rs +++ /dev/null @@ -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() {} diff --git a/tests/ui/derives/derives-span-Ord-enum-struct-variant.stderr b/tests/ui/derives/derives-span-Ord-enum-struct-variant.stderr deleted file mode 100644 index e253a9173fc5..000000000000 --- a/tests/ui/derives/derives-span-Ord-enum-struct-variant.stderr +++ /dev/null @@ -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`. diff --git a/tests/ui/derives/derives-span-Ord-enum.rs b/tests/ui/derives/derives-span-Ord-enum.rs deleted file mode 100644 index 72738931d10f..000000000000 --- a/tests/ui/derives/derives-span-Ord-enum.rs +++ /dev/null @@ -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() {} diff --git a/tests/ui/derives/derives-span-Ord-enum.stderr b/tests/ui/derives/derives-span-Ord-enum.stderr deleted file mode 100644 index 8a92458b51ca..000000000000 --- a/tests/ui/derives/derives-span-Ord-enum.stderr +++ /dev/null @@ -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`. diff --git a/tests/ui/derives/derives-span-Ord-struct.rs b/tests/ui/derives/derives-span-Ord-struct.rs deleted file mode 100644 index 53d4c2c22b55..000000000000 --- a/tests/ui/derives/derives-span-Ord-struct.rs +++ /dev/null @@ -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() {} diff --git a/tests/ui/derives/derives-span-Ord-struct.stderr b/tests/ui/derives/derives-span-Ord-struct.stderr deleted file mode 100644 index ae110d51196f..000000000000 --- a/tests/ui/derives/derives-span-Ord-struct.stderr +++ /dev/null @@ -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`. diff --git a/tests/ui/derives/derives-span-Ord-tuple-struct.rs b/tests/ui/derives/derives-span-Ord-tuple-struct.rs deleted file mode 100644 index 4e09c2709864..000000000000 --- a/tests/ui/derives/derives-span-Ord-tuple-struct.rs +++ /dev/null @@ -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() {} diff --git a/tests/ui/derives/derives-span-Ord-tuple-struct.stderr b/tests/ui/derives/derives-span-Ord-tuple-struct.stderr deleted file mode 100644 index e2a6d5266b71..000000000000 --- a/tests/ui/derives/derives-span-Ord-tuple-struct.stderr +++ /dev/null @@ -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`. diff --git a/tests/ui/derives/derives-span-Ord.rs b/tests/ui/derives/derives-span-Ord.rs new file mode 100644 index 000000000000..91c3b50a030d --- /dev/null +++ b/tests/ui/derives/derives-span-Ord.rs @@ -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() {} diff --git a/tests/ui/derives/derives-span-Ord.stderr b/tests/ui/derives/derives-span-Ord.stderr new file mode 100644 index 000000000000..b0aaad19003d --- /dev/null +++ b/tests/ui/derives/derives-span-Ord.stderr @@ -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`. diff --git a/tests/ui/derives/derives-span-PartialEq-enum-struct-variant.rs b/tests/ui/derives/derives-span-PartialEq-enum-struct-variant.rs deleted file mode 100644 index 67a27729db7e..000000000000 --- a/tests/ui/derives/derives-span-PartialEq-enum-struct-variant.rs +++ /dev/null @@ -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() {} diff --git a/tests/ui/derives/derives-span-PartialEq-enum-struct-variant.stderr b/tests/ui/derives/derives-span-PartialEq-enum-struct-variant.stderr deleted file mode 100644 index 09104289c64a..000000000000 --- a/tests/ui/derives/derives-span-PartialEq-enum-struct-variant.stderr +++ /dev/null @@ -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`. diff --git a/tests/ui/derives/derives-span-PartialEq-enum.rs b/tests/ui/derives/derives-span-PartialEq-enum.rs deleted file mode 100644 index 0becc7e0d10f..000000000000 --- a/tests/ui/derives/derives-span-PartialEq-enum.rs +++ /dev/null @@ -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() {} diff --git a/tests/ui/derives/derives-span-PartialEq-enum.stderr b/tests/ui/derives/derives-span-PartialEq-enum.stderr deleted file mode 100644 index 40dca92ef23c..000000000000 --- a/tests/ui/derives/derives-span-PartialEq-enum.stderr +++ /dev/null @@ -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`. diff --git a/tests/ui/derives/derives-span-PartialEq-struct.rs b/tests/ui/derives/derives-span-PartialEq-struct.rs deleted file mode 100644 index c92ef5fadf73..000000000000 --- a/tests/ui/derives/derives-span-PartialEq-struct.rs +++ /dev/null @@ -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() {} diff --git a/tests/ui/derives/derives-span-PartialEq-struct.stderr b/tests/ui/derives/derives-span-PartialEq-struct.stderr deleted file mode 100644 index cfd9fc41d061..000000000000 --- a/tests/ui/derives/derives-span-PartialEq-struct.stderr +++ /dev/null @@ -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`. diff --git a/tests/ui/derives/derives-span-PartialEq-tuple-struct.rs b/tests/ui/derives/derives-span-PartialEq-tuple-struct.rs deleted file mode 100644 index 10ac347aa0be..000000000000 --- a/tests/ui/derives/derives-span-PartialEq-tuple-struct.rs +++ /dev/null @@ -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() {} diff --git a/tests/ui/derives/derives-span-PartialEq-tuple-struct.stderr b/tests/ui/derives/derives-span-PartialEq-tuple-struct.stderr deleted file mode 100644 index 4e35cbb534d9..000000000000 --- a/tests/ui/derives/derives-span-PartialEq-tuple-struct.stderr +++ /dev/null @@ -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`. diff --git a/tests/ui/derives/derives-span-PartialEq.rs b/tests/ui/derives/derives-span-PartialEq.rs new file mode 100644 index 000000000000..ef79f095f46e --- /dev/null +++ b/tests/ui/derives/derives-span-PartialEq.rs @@ -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() {} diff --git a/tests/ui/derives/derives-span-PartialEq.stderr b/tests/ui/derives/derives-span-PartialEq.stderr new file mode 100644 index 000000000000..c2e928885ce2 --- /dev/null +++ b/tests/ui/derives/derives-span-PartialEq.stderr @@ -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`. diff --git a/tests/ui/derives/derives-span-PartialOrd-enum-struct-variant.rs b/tests/ui/derives/derives-span-PartialOrd-enum-struct-variant.rs deleted file mode 100644 index a769c137657c..000000000000 --- a/tests/ui/derives/derives-span-PartialOrd-enum-struct-variant.rs +++ /dev/null @@ -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() {} diff --git a/tests/ui/derives/derives-span-PartialOrd-enum-struct-variant.stderr b/tests/ui/derives/derives-span-PartialOrd-enum-struct-variant.stderr deleted file mode 100644 index 7fe09d45cc1b..000000000000 --- a/tests/ui/derives/derives-span-PartialOrd-enum-struct-variant.stderr +++ /dev/null @@ -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`. diff --git a/tests/ui/derives/derives-span-PartialOrd-enum.rs b/tests/ui/derives/derives-span-PartialOrd-enum.rs deleted file mode 100644 index 4f0d794e42d7..000000000000 --- a/tests/ui/derives/derives-span-PartialOrd-enum.rs +++ /dev/null @@ -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() {} diff --git a/tests/ui/derives/derives-span-PartialOrd-enum.stderr b/tests/ui/derives/derives-span-PartialOrd-enum.stderr deleted file mode 100644 index 2a14e6e96187..000000000000 --- a/tests/ui/derives/derives-span-PartialOrd-enum.stderr +++ /dev/null @@ -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`. diff --git a/tests/ui/derives/derives-span-PartialOrd-struct.rs b/tests/ui/derives/derives-span-PartialOrd-struct.rs deleted file mode 100644 index da857c674357..000000000000 --- a/tests/ui/derives/derives-span-PartialOrd-struct.rs +++ /dev/null @@ -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() {} diff --git a/tests/ui/derives/derives-span-PartialOrd-struct.stderr b/tests/ui/derives/derives-span-PartialOrd-struct.stderr deleted file mode 100644 index 0904e3ace8f0..000000000000 --- a/tests/ui/derives/derives-span-PartialOrd-struct.stderr +++ /dev/null @@ -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`. diff --git a/tests/ui/derives/derives-span-PartialOrd-tuple-struct.rs b/tests/ui/derives/derives-span-PartialOrd-tuple-struct.rs deleted file mode 100644 index 61d507670880..000000000000 --- a/tests/ui/derives/derives-span-PartialOrd-tuple-struct.rs +++ /dev/null @@ -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() {} diff --git a/tests/ui/derives/derives-span-PartialOrd-tuple-struct.stderr b/tests/ui/derives/derives-span-PartialOrd-tuple-struct.stderr deleted file mode 100644 index 501fea02e8ef..000000000000 --- a/tests/ui/derives/derives-span-PartialOrd-tuple-struct.stderr +++ /dev/null @@ -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`. diff --git a/tests/ui/derives/derives-span-PartialOrd.rs b/tests/ui/derives/derives-span-PartialOrd.rs new file mode 100644 index 000000000000..7f7f188b1abb --- /dev/null +++ b/tests/ui/derives/derives-span-PartialOrd.rs @@ -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() {} diff --git a/tests/ui/derives/derives-span-PartialOrd.stderr b/tests/ui/derives/derives-span-PartialOrd.stderr new file mode 100644 index 000000000000..3429ee19ccf6 --- /dev/null +++ b/tests/ui/derives/derives-span-PartialOrd.stderr @@ -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`. diff --git a/tests/ui/derives/deriving-primitive.rs b/tests/ui/derives/deriving-primitive.rs deleted file mode 100644 index 1173eca640fc..000000000000 --- a/tests/ui/derives/deriving-primitive.rs +++ /dev/null @@ -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() {} diff --git a/tests/ui/derives/deriving-primitive.stderr b/tests/ui/derives/deriving-primitive.stderr deleted file mode 100644 index b39637825e56..000000000000 --- a/tests/ui/derives/deriving-primitive.stderr +++ /dev/null @@ -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 -