From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- .../derive-trait-for-method-call.stderr | 105 +++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 tests/ui/suggestions/derive-trait-for-method-call.stderr (limited to 'tests/ui/suggestions/derive-trait-for-method-call.stderr') diff --git a/tests/ui/suggestions/derive-trait-for-method-call.stderr b/tests/ui/suggestions/derive-trait-for-method-call.stderr new file mode 100644 index 000000000..924b26a8c --- /dev/null +++ b/tests/ui/suggestions/derive-trait-for-method-call.stderr @@ -0,0 +1,105 @@ +error[E0599]: the method `test` exists for struct `Foo`, but its trait bounds were not satisfied + --> $DIR/derive-trait-for-method-call.rs:28:15 + | +LL | enum Enum { + | --------- + | | + | doesn't satisfy `Enum: Clone` + | doesn't satisfy `Enum: Default` +... +LL | enum CloneEnum { + | -------------- doesn't satisfy `CloneEnum: Default` +... +LL | struct Foo (X, Y); + | ---------------- method `test` not found for this struct +... +LL | let y = x.test(); + | ^^^^ method cannot be called on `Foo` due to unsatisfied trait bounds + | +note: the following trait bounds were not satisfied: + `CloneEnum: Default` + `Enum: Clone` + `Enum: Default` + --> $DIR/derive-trait-for-method-call.rs:20:9 + | +LL | impl Foo { + | ^^^^^ ^^^^^^^ ^^^^^^^ --------- + | | | | + | | | unsatisfied trait bound introduced here + | | unsatisfied trait bound introduced here + | unsatisfied trait bound introduced here +note: the trait `Default` must be implemented + --> $SRC_DIR/core/src/default.rs:LL:COL +help: consider annotating `Enum` with `#[derive(Clone)]` + | +LL | #[derive(Clone)] + | + +error[E0599]: the method `test` exists for struct `Foo`, but its trait bounds were not satisfied + --> $DIR/derive-trait-for-method-call.rs:34:15 + | +LL | struct Struct { + | ------------- + | | + | doesn't satisfy `Struct: Clone` + | doesn't satisfy `Struct: Default` +... +LL | struct CloneStruct { + | ------------------ doesn't satisfy `CloneStruct: Default` +... +LL | struct Foo (X, Y); + | ---------------- method `test` not found for this struct +... +LL | let y = x.test(); + | ^^^^ method cannot be called on `Foo` due to unsatisfied trait bounds + | +note: the following trait bounds were not satisfied: + `CloneStruct: Default` + `Struct: Clone` + `Struct: Default` + --> $DIR/derive-trait-for-method-call.rs:20:9 + | +LL | impl Foo { + | ^^^^^ ^^^^^^^ ^^^^^^^ --------- + | | | | + | | | unsatisfied trait bound introduced here + | | unsatisfied trait bound introduced here + | unsatisfied trait bound introduced here +help: consider annotating `CloneStruct` with `#[derive(Default)]` + | +LL | #[derive(Default)] + | +help: consider annotating `Struct` with `#[derive(Clone, Default)]` + | +LL | #[derive(Clone, Default)] + | + +error[E0599]: the method `test` exists for struct `Foo, Instant>`, but its trait bounds were not satisfied + --> $DIR/derive-trait-for-method-call.rs:40:15 + | +LL | struct Foo (X, Y); + | ---------------- method `test` not found for this struct +... +LL | let y = x.test(); + | ^^^^ method cannot be called on `Foo, Instant>` due to unsatisfied trait bounds + --> $SRC_DIR/std/src/time.rs:LL:COL + | + = note: doesn't satisfy `Instant: Default` + --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL + | + = note: doesn't satisfy `Vec: Clone` + | +note: the following trait bounds were not satisfied: + `Instant: Default` + `Vec: Clone` + --> $DIR/derive-trait-for-method-call.rs:20:9 + | +LL | impl Foo { + | ^^^^^ ^^^^^^^ --------- + | | | + | | unsatisfied trait bound introduced here + | unsatisfied trait bound introduced here + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0599`. -- cgit v1.2.3