about summary refs log tree commit diff
path: root/tests/ui/wf
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2025-07-25 23:07:20 +0000
committerCamille GILLOT <gillot.camille@gmail.com>2025-07-25 23:39:26 +0000
commit7c6496145f86133655a941e0dafd5dfa368514d4 (patch)
tree59ba9f26ea549e782af33a87d6bc1a1b26185037 /tests/ui/wf
parentec8146477e90337517b3483b84738eb5dfe53770 (diff)
downloadrust-7c6496145f86133655a941e0dafd5dfa368514d4.tar.gz
rust-7c6496145f86133655a941e0dafd5dfa368514d4.zip
Check statics' type in type_of.
Diffstat (limited to 'tests/ui/wf')
-rw-r--r--tests/ui/wf/wf-static-type.rs2
-rw-r--r--tests/ui/wf/wf-static-type.stderr39
2 files changed, 1 insertions, 40 deletions
diff --git a/tests/ui/wf/wf-static-type.rs b/tests/ui/wf/wf-static-type.rs
index 1980c5de40c..1c35e1daf44 100644
--- a/tests/ui/wf/wf-static-type.rs
+++ b/tests/ui/wf/wf-static-type.rs
@@ -9,8 +9,6 @@ struct NotCopy;
 
 static FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None };
 //~^ ERROR E0277
-//~| ERROR E0277
-//~| ERROR E0277
 
 
 fn main() { }
diff --git a/tests/ui/wf/wf-static-type.stderr b/tests/ui/wf/wf-static-type.stderr
index 53b90c69960..2fa8ae06c45 100644
--- a/tests/ui/wf/wf-static-type.stderr
+++ b/tests/ui/wf/wf-static-type.stderr
@@ -16,43 +16,6 @@ LL + #[derive(Copy)]
 LL | struct NotCopy;
    |
 
-error[E0277]: the trait bound `NotCopy: Copy` is not satisfied
-  --> $DIR/wf-static-type.rs:10:13
-   |
-LL | static FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None };
-   |             ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `NotCopy`
-   |
-   = note: required for `Option<NotCopy>` to implement `Copy`
-note: required by a bound in `IsCopy`
-  --> $DIR/wf-static-type.rs:7:17
-   |
-LL | struct IsCopy<T:Copy> { t: T }
-   |                 ^^^^ required by this bound in `IsCopy`
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-help: consider annotating `NotCopy` with `#[derive(Copy)]`
-   |
-LL + #[derive(Copy)]
-LL | struct NotCopy;
-   |
-
-error[E0277]: the trait bound `NotCopy: Copy` is not satisfied
-  --> $DIR/wf-static-type.rs:10:51
-   |
-LL | static FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None };
-   |                                                   ^^^^ the trait `Copy` is not implemented for `NotCopy`
-   |
-   = note: required for `Option<NotCopy>` to implement `Copy`
-note: required by a bound in `IsCopy`
-  --> $DIR/wf-static-type.rs:7:17
-   |
-LL | struct IsCopy<T:Copy> { t: T }
-   |                 ^^^^ required by this bound in `IsCopy`
-help: consider annotating `NotCopy` with `#[derive(Copy)]`
-   |
-LL + #[derive(Copy)]
-LL | struct NotCopy;
-   |
-
-error: aborting due to 3 previous errors
+error: aborting due to 1 previous error
 
 For more information about this error, try `rustc --explain E0277`.