File tree Expand file tree Collapse file tree 8 files changed +6
-14
lines changed 
tests/ui/traits/const-traits Expand file tree Collapse file tree 8 files changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ fn test_convert() {
2121    assert ! ( char :: try_from( 0xFFFF_FFFF_u32 ) . is_err( ) ) ; 
2222} 
2323
24- /* FIXME(#110395) 
2524#[ test]  
2625const  fn  test_convert_const ( )  { 
2726    assert ! ( u32 :: from( 'a' )  == 0x61 ) ; 
@@ -31,7 +30,6 @@ const fn test_convert_const() {
3130    assert ! ( char :: from( b'a' )  == 'a' ) ; 
3231    assert ! ( char :: from( b'\xFF' )  == '\u{FF}' ) ; 
3332} 
34- */ 
3533
3634#[ test]  
3735fn  test_from_str ( )  { 
Original file line number Diff line number Diff line change 1- /* FIXME(#110395) 
21#[ test]  
32fn  convert ( )  { 
43    const  fn  from ( x :  i32 )  -> i32  { 
@@ -15,4 +14,3 @@ fn convert() {
1514    const  BAR :  Vec < String >  = into ( Vec :: new ( ) ) ; 
1615    assert_eq ! ( BAR ,  Vec :: <String >:: new( ) ) ; 
1716} 
18- */ 
Original file line number Diff line number Diff line change 1818#![ feature( const_deref) ]  
1919#![ feature( const_destruct) ]  
2020#![ feature( const_eval_select) ]  
21+ #![ feature( const_from) ]  
2122#![ feature( const_ops) ]  
23+ #![ feature( const_option_ops) ]  
2224#![ feature( const_ref_cell) ]  
2325#![ feature( const_result_trait_fn) ]  
2426#![ feature( const_trait_impl) ]  
Original file line number Diff line number Diff line change @@ -214,13 +214,11 @@ fn nonzero_const() {
214214    const  ONE :  Option < NonZero < u8 > >  = NonZero :: new ( 1 ) ; 
215215    assert ! ( ONE . is_some( ) ) ; 
216216
217-     /* FIXME(#110395) 
218217    const  FROM_NONZERO_U8 :  u8  = u8:: from ( NONZERO_U8 ) ; 
219218    assert_eq ! ( FROM_NONZERO_U8 ,  5 ) ; 
220219
221220    const  NONZERO_CONVERT :  NonZero < u32 >  = NonZero :: < u32 > :: from ( NONZERO_U8 ) ; 
222221    assert_eq ! ( NONZERO_CONVERT . get( ) ,  5 ) ; 
223-     */ 
224222} 
225223
226224#[ test]  
Original file line number Diff line number Diff line change 1- /* FIXME(#110395) 
21#[ test]  
32fn  from ( )  { 
43    use  core:: convert:: TryFrom ; 
@@ -24,4 +23,3 @@ fn from() {
2423    const  I16_FROM_U16 :  Result < i16 ,  TryFromIntError >  = i16:: try_from ( 1u16 ) ; 
2524    assert_eq ! ( I16_FROM_U16 ,  Ok ( 1i16 ) ) ; 
2625} 
27- */ 
Original file line number Diff line number Diff line change @@ -87,7 +87,6 @@ fn test_and() {
8787    assert_eq ! ( x. and( Some ( 2 ) ) ,  None ) ; 
8888    assert_eq ! ( x. and( None :: <isize >) ,  None ) ; 
8989
90-     /* FIXME(#110395) 
9190    const  FOO :  Option < isize >  = Some ( 1 ) ; 
9291    const  A :  Option < isize >  = FOO . and ( Some ( 2 ) ) ; 
9392    const  B :  Option < isize >  = FOO . and ( None ) ; 
@@ -99,7 +98,6 @@ fn test_and() {
9998    const  D :  Option < isize >  = BAR . and ( None ) ; 
10099    assert_eq ! ( C ,  None ) ; 
101100    assert_eq ! ( D ,  None ) ; 
102-     */ 
103101} 
104102
105103#[ test]  
Original file line number Diff line number Diff line change 1- //@ known-bug: #110395 
2- 
31#![ feature( const_trait_impl,  const_ops) ]  
42
53pub  struct  Int ( i32 ) ; 
64
75impl  const  std:: ops:: Add  for  i32  { 
6+     //~^ ERROR only traits defined in the current crate can be implemented for primitive types 
87    type  Output  = Self ; 
98
109    fn  add ( self ,  rhs :  Self )  -> Self  { 
@@ -21,6 +20,7 @@ impl std::ops::Add for Int {
2120} 
2221
2322impl  const  std:: ops:: Add  for  Int  { 
23+     //~^ ERROR conflicting implementations of trait 
2424    type  Output  = Self ; 
2525
2626    fn  add ( self ,  rhs :  Self )  -> Self  { 
Original file line number Diff line number Diff line change 11error[E0119]: conflicting implementations of trait `Add` for type `Int`
2-   --> $DIR/const-and-non-const-impl.rs:23 :1
2+   --> $DIR/const-and-non-const-impl.rs:22 :1
33   |
44LL | impl std::ops::Add for Int {
55   | -------------------------- first implementation here
@@ -8,7 +8,7 @@ LL | impl const std::ops::Add for Int {
88   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Int`
99
1010error[E0117]: only traits defined in the current crate can be implemented for primitive types
11-   --> $DIR/const-and-non-const-impl.rs:7 :1
11+   --> $DIR/const-and-non-const-impl.rs:5 :1
1212   |
1313LL | impl const std::ops::Add for i32 {
1414   | ^^^^^^^^^^^-------------^^^^^---
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments