File tree 1 file changed +45
-0
lines changed
1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -3833,3 +3833,48 @@ fn test() {
3833
3833
"# ,
3834
3834
)
3835
3835
}
3836
+
3837
+ #[ test]
3838
+ fn auto_trait_bound ( ) {
3839
+ check_types (
3840
+ r#"
3841
+ auto trait Send {}
3842
+ impl<T> !Send for *const T {}
3843
+
3844
+ struct Yes;
3845
+ trait IsSend { const IS_SEND: Yes; }
3846
+ impl<T: Send> IsSend for T { const IS_SEND: Yes = Yes; }
3847
+
3848
+ struct Struct<T>(T);
3849
+ enum Enum<T> { A, B(T) }
3850
+ union Union<T> { t: T }
3851
+
3852
+ fn f<T: Send, U>() {
3853
+ T::IS_SEND;
3854
+ //^^^^^^^^^^Yes
3855
+ U::IS_SEND;
3856
+ //^^^^^^^^^^{unknown}
3857
+ <*const T>::IS_SEND;
3858
+ //^^^^^^^^^^^^^^^^^^^{unknown}
3859
+ Struct::<T>::IS_SEND;
3860
+ //^^^^^^^^^^^^^^^^^^^^Yes
3861
+ Struct::<U>::IS_SEND;
3862
+ //^^^^^^^^^^^^^^^^^^^^{unknown}
3863
+ Struct::<*const T>::IS_SEND;
3864
+ //^^^^^^^^^^^^^^^^^^^^^^^^^^^{unknown}
3865
+ Enum::<T>::IS_SEND;
3866
+ //^^^^^^^^^^^^^^^^^^Yes
3867
+ Enum::<U>::IS_SEND;
3868
+ //^^^^^^^^^^^^^^^^^^{unknown}
3869
+ Enum::<*const T>::IS_SEND;
3870
+ //^^^^^^^^^^^^^^^^^^^^^^^^^{unknown}
3871
+ Union::<T>::IS_SEND;
3872
+ //^^^^^^^^^^^^^^^^^^^Yes
3873
+ Union::<U>::IS_SEND;
3874
+ //^^^^^^^^^^^^^^^^^^^{unknown}
3875
+ Union::<*const T>::IS_SEND;
3876
+ //^^^^^^^^^^^^^^^^^^^^^^^^^^{unknown}
3877
+ }
3878
+ "# ,
3879
+ ) ;
3880
+ }
You can’t perform that action at this time.
0 commit comments