File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 1212//!     const SOME_PROPERTY: bool = true; 
1313//! } 
1414//! 
15- //! # trait QueryId { const SOME_PROPERTY: core::primitive::bool; } 
15+ //! # trait QueryId { const SOME_PROPERTY: :: core::primitive::bool; } 
1616//! ``` 
1717//! 
1818//! Note that the `SOME_PROPERTY` associated constant would not compile, as its 
2525//! pub struct bool; 
2626//! 
2727//! impl QueryId for bool { 
28- //!     const SOME_PROPERTY: core::primitive::bool = true; 
28+ //!     const SOME_PROPERTY: :: core::primitive::bool = true; 
2929//! } 
3030//! 
31- //! # trait QueryId { const SOME_PROPERTY: core::primitive::bool; } 
31+ //! # trait QueryId { const SOME_PROPERTY: :: core::primitive::bool; } 
3232//! ``` 
33+ //! 
34+ //! We also used `::core` instead of `core`, because `core` can be 
35+ //! shadowed, too. Paths, starting with `::`, are searched in 
36+ //! [extern prelude]. 
37+ //! 
38+ //! [extern prelude]: https://doc.rust-lang.org/nightly/reference/names/preludes.html#extern-prelude 
3339
3440#[ stable( feature = "core_primitive" ,  since = "1.43.0" ) ]  
3541pub  use  bool; 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments