diff options
| author | Michael Goulet <michael@errs.io> | 2022-12-09 20:59:26 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-01-13 23:06:29 +0000 |
| commit | 16cfadbfe835cadd24dc65481ab3ad0b5b627c5a (patch) | |
| tree | 5cc4dd2a65bc23a95e5049239a9cc756494efa95 /src | |
| parent | 333c6bf523019fd1565a5236d3c727172ec844f2 (diff) | |
| download | rust-16cfadbfe835cadd24dc65481ab3ad0b5b627c5a.tar.gz rust-16cfadbfe835cadd24dc65481ab3ad0b5b627c5a.zip | |
Suggest lifetime bound in illegal Copy impl
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/ui/traits/copy-is-not-modulo-regions.not_static.stderr | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/ui/traits/copy-is-not-modulo-regions.not_static.stderr b/src/test/ui/traits/copy-is-not-modulo-regions.not_static.stderr index 1c4d2136677..edd94d2010b 100644 --- a/src/test/ui/traits/copy-is-not-modulo-regions.not_static.stderr +++ b/src/test/ui/traits/copy-is-not-modulo-regions.not_static.stderr @@ -6,6 +6,16 @@ LL | struct Bar<'lt>(Foo<'lt>); ... LL | impl<'any> Copy for Bar<'any> {} | ^^^^^^^^^ + | +note: the `Copy` impl for `Foo<'any>` requires that `'any: 'static` + --> $DIR/copy-is-not-modulo-regions.rs:10:17 + | +LL | struct Bar<'lt>(Foo<'lt>); + | ^^^^^^^^ +help: consider restricting type parameter `'any` + | +LL | impl<'any: 'static> Copy for Bar<'any> {} + | +++++++++ error: aborting due to previous error |
