- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1.5k
 
Update enum_use.md #1960
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
    
                
     Merged
            
            Update enum_use.md #1960
Conversation
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
    Make code more idiomatic. A person learning Rust for the first time seeing `use crate::Role::*` gets spun into a rabbit hole of: - understanding what "crate::" means here - is a single file a crate? (look it up in the docs) - do even enums local to the file have to be specified with an absolute path from crate root? Besides, `use crate:: ...` is taught in the example for use later on, which is linked to at the bottom of this document. Using this document to only teach about unpacking enums into the name space, and then using the other document to introduce `use crate::`, means less things need to be learned all at once, reducing confusion.
| 
           r? @marioidival rustbot has assigned @marioidival. Use   | 
    
    
  Zalathar 
      added a commit
        to Zalathar/rust
      that referenced
      this pull request
    
      Nov 4, 2025 
    
    
      
  
    
      
    
  
Update books ## rust-lang/book 6 commits in af415fc6c8a6823dfb4595074f27d5a3e9e2fe49..f660f341887c8bbcd6c24fbfdf5d2a262f523965 2025-10-28 01:41:51 UTC to 2025-10-24 15:39:51 UTC - Update to Rust 1.90 (rust-lang/book#4545) - Update to Rust 1.89 (rust-lang/book#4544) - Update to Rust 1.88 (rust-lang/book#4543) - Update to Rust 1.87 (rust-lang/book#4542) - Update to Rust 1.86 (rust-lang/book#4541) - Remove unused subheadings (rust-lang/book#4538) ## rust-lang/edition-guide 1 commits in e2ed891f00361efc26616d82590b1c85d7a8920e..5c621253d8f2a5a4adb64a6365905db67dffe3a2 2025-10-23 14:13:01 UTC to 2025-10-23 14:13:01 UTC - Add back the link for never_type_fallback_flowing_into_unsafe (rust-lang/edition-guide#378) ## rust-lang/reference 12 commits in 752eab01cebdd6a2d90b53087298844c251859a1..e122eefff3fef362eb7e0c08fb7ffbf5f9461905 2025-10-28 20:52:27 UTC to 2025-10-21 19:42:06 UTC - Remove custom redirect scripts (rust-lang/reference#2065) - Avoid specifying "last import wins" for MBEs (rust-lang/reference#2057) - Add caveats about mutable references in consts (rust-lang/reference#2058) - Move punctuation index to an appendix, and expand for other syntaxes (rust-lang/reference#2061) - Use American spelling for "labeled" (rust-lang/reference#2066) - Remove rules from names intro (rust-lang/reference#2060) - Minor adjustments to inner/outer attribute definitions (rust-lang/reference#2059) - Change underscore to be a keyword (rust-lang/reference#2049) - Update `proc_macro_attribute` to use the attribute template (rust-lang/reference#1889) - Update `proc_macro` to use the attribute template (rust-lang/reference#1887) - Update `macro_use` to use the attribute template (rust-lang/reference#1886) - Update `macro_export` to use the attribute template (rust-lang/reference#1885) ## rust-lang/rust-by-example 7 commits in 2c9b490d70e535cf166bf17feba59e594579843f..160e6bbca70b0c01aa4de88d19db7fc5ff8447c3 2025-11-03 12:26:45 UTC to 2025-10-22 13:19:06 UTC - Fix typos in flow_control/match/binding (rust-lang/rust-by-example#1971) - add clarification on overflowing_literals lint (rust-lang/rust-by-example#1970) - Update enum_use.md (rust-lang/rust-by-example#1960) - Remove weird extra spaces in code (rust-lang/rust-by-example#1962) - Include a link to The Rust Reference in flow_control/match/destructuring (rust-lang/rust-by-example#1963) - Add an example showing pattern binding when matching several values in a match arm (rust-lang/rust-by-example#1966) - Fix typo in linked list length calculation comment (rust-lang/rust-by-example#1968)
    
  Zalathar 
      added a commit
        to Zalathar/rust
      that referenced
      this pull request
    
      Nov 4, 2025 
    
    
      
  
    
      
    
  
Update books ## rust-lang/book 6 commits in af415fc6c8a6823dfb4595074f27d5a3e9e2fe49..f660f341887c8bbcd6c24fbfdf5d2a262f523965 2025-10-28 01:41:51 UTC to 2025-10-24 15:39:51 UTC - Update to Rust 1.90 (rust-lang/book#4545) - Update to Rust 1.89 (rust-lang/book#4544) - Update to Rust 1.88 (rust-lang/book#4543) - Update to Rust 1.87 (rust-lang/book#4542) - Update to Rust 1.86 (rust-lang/book#4541) - Remove unused subheadings (rust-lang/book#4538) ## rust-lang/edition-guide 1 commits in e2ed891f00361efc26616d82590b1c85d7a8920e..5c621253d8f2a5a4adb64a6365905db67dffe3a2 2025-10-23 14:13:01 UTC to 2025-10-23 14:13:01 UTC - Add back the link for never_type_fallback_flowing_into_unsafe (rust-lang/edition-guide#378) ## rust-lang/reference 12 commits in 752eab01cebdd6a2d90b53087298844c251859a1..e122eefff3fef362eb7e0c08fb7ffbf5f9461905 2025-10-28 20:52:27 UTC to 2025-10-21 19:42:06 UTC - Remove custom redirect scripts (rust-lang/reference#2065) - Avoid specifying "last import wins" for MBEs (rust-lang/reference#2057) - Add caveats about mutable references in consts (rust-lang/reference#2058) - Move punctuation index to an appendix, and expand for other syntaxes (rust-lang/reference#2061) - Use American spelling for "labeled" (rust-lang/reference#2066) - Remove rules from names intro (rust-lang/reference#2060) - Minor adjustments to inner/outer attribute definitions (rust-lang/reference#2059) - Change underscore to be a keyword (rust-lang/reference#2049) - Update `proc_macro_attribute` to use the attribute template (rust-lang/reference#1889) - Update `proc_macro` to use the attribute template (rust-lang/reference#1887) - Update `macro_use` to use the attribute template (rust-lang/reference#1886) - Update `macro_export` to use the attribute template (rust-lang/reference#1885) ## rust-lang/rust-by-example 7 commits in 2c9b490d70e535cf166bf17feba59e594579843f..160e6bbca70b0c01aa4de88d19db7fc5ff8447c3 2025-11-03 12:26:45 UTC to 2025-10-22 13:19:06 UTC - Fix typos in flow_control/match/binding (rust-lang/rust-by-example#1971) - add clarification on overflowing_literals lint (rust-lang/rust-by-example#1970) - Update enum_use.md (rust-lang/rust-by-example#1960) - Remove weird extra spaces in code (rust-lang/rust-by-example#1962) - Include a link to The Rust Reference in flow_control/match/destructuring (rust-lang/rust-by-example#1963) - Add an example showing pattern binding when matching several values in a match arm (rust-lang/rust-by-example#1966) - Fix typo in linked list length calculation comment (rust-lang/rust-by-example#1968)
    
  Zalathar 
      added a commit
        to Zalathar/rust
      that referenced
      this pull request
    
      Nov 4, 2025 
    
    
      
  
    
      
    
  
Update books ## rust-lang/book 6 commits in af415fc6c8a6823dfb4595074f27d5a3e9e2fe49..f660f341887c8bbcd6c24fbfdf5d2a262f523965 2025-10-28 01:41:51 UTC to 2025-10-24 15:39:51 UTC - Update to Rust 1.90 (rust-lang/book#4545) - Update to Rust 1.89 (rust-lang/book#4544) - Update to Rust 1.88 (rust-lang/book#4543) - Update to Rust 1.87 (rust-lang/book#4542) - Update to Rust 1.86 (rust-lang/book#4541) - Remove unused subheadings (rust-lang/book#4538) ## rust-lang/edition-guide 1 commits in e2ed891f00361efc26616d82590b1c85d7a8920e..5c621253d8f2a5a4adb64a6365905db67dffe3a2 2025-10-23 14:13:01 UTC to 2025-10-23 14:13:01 UTC - Add back the link for never_type_fallback_flowing_into_unsafe (rust-lang/edition-guide#378) ## rust-lang/reference 12 commits in 752eab01cebdd6a2d90b53087298844c251859a1..e122eefff3fef362eb7e0c08fb7ffbf5f9461905 2025-10-28 20:52:27 UTC to 2025-10-21 19:42:06 UTC - Remove custom redirect scripts (rust-lang/reference#2065) - Avoid specifying "last import wins" for MBEs (rust-lang/reference#2057) - Add caveats about mutable references in consts (rust-lang/reference#2058) - Move punctuation index to an appendix, and expand for other syntaxes (rust-lang/reference#2061) - Use American spelling for "labeled" (rust-lang/reference#2066) - Remove rules from names intro (rust-lang/reference#2060) - Minor adjustments to inner/outer attribute definitions (rust-lang/reference#2059) - Change underscore to be a keyword (rust-lang/reference#2049) - Update `proc_macro_attribute` to use the attribute template (rust-lang/reference#1889) - Update `proc_macro` to use the attribute template (rust-lang/reference#1887) - Update `macro_use` to use the attribute template (rust-lang/reference#1886) - Update `macro_export` to use the attribute template (rust-lang/reference#1885) ## rust-lang/rust-by-example 7 commits in 2c9b490d70e535cf166bf17feba59e594579843f..160e6bbca70b0c01aa4de88d19db7fc5ff8447c3 2025-11-03 12:26:45 UTC to 2025-10-22 13:19:06 UTC - Fix typos in flow_control/match/binding (rust-lang/rust-by-example#1971) - add clarification on overflowing_literals lint (rust-lang/rust-by-example#1970) - Update enum_use.md (rust-lang/rust-by-example#1960) - Remove weird extra spaces in code (rust-lang/rust-by-example#1962) - Include a link to The Rust Reference in flow_control/match/destructuring (rust-lang/rust-by-example#1963) - Add an example showing pattern binding when matching several values in a match arm (rust-lang/rust-by-example#1966) - Fix typo in linked list length calculation comment (rust-lang/rust-by-example#1968)
    
  rust-timer 
      added a commit
        to rust-lang/rust
      that referenced
      this pull request
    
      Nov 4, 2025 
    
    
      
  
    
      
    
  
Rollup merge of #148448 - rustbot:docs-update, r=ehuss Update books ## rust-lang/book 6 commits in af415fc6c8a6823dfb4595074f27d5a3e9e2fe49..f660f341887c8bbcd6c24fbfdf5d2a262f523965 2025-10-28 01:41:51 UTC to 2025-10-24 15:39:51 UTC - Update to Rust 1.90 (rust-lang/book#4545) - Update to Rust 1.89 (rust-lang/book#4544) - Update to Rust 1.88 (rust-lang/book#4543) - Update to Rust 1.87 (rust-lang/book#4542) - Update to Rust 1.86 (rust-lang/book#4541) - Remove unused subheadings (rust-lang/book#4538) ## rust-lang/edition-guide 1 commits in e2ed891f00361efc26616d82590b1c85d7a8920e..5c621253d8f2a5a4adb64a6365905db67dffe3a2 2025-10-23 14:13:01 UTC to 2025-10-23 14:13:01 UTC - Add back the link for never_type_fallback_flowing_into_unsafe (rust-lang/edition-guide#378) ## rust-lang/reference 12 commits in 752eab01cebdd6a2d90b53087298844c251859a1..e122eefff3fef362eb7e0c08fb7ffbf5f9461905 2025-10-28 20:52:27 UTC to 2025-10-21 19:42:06 UTC - Remove custom redirect scripts (rust-lang/reference#2065) - Avoid specifying "last import wins" for MBEs (rust-lang/reference#2057) - Add caveats about mutable references in consts (rust-lang/reference#2058) - Move punctuation index to an appendix, and expand for other syntaxes (rust-lang/reference#2061) - Use American spelling for "labeled" (rust-lang/reference#2066) - Remove rules from names intro (rust-lang/reference#2060) - Minor adjustments to inner/outer attribute definitions (rust-lang/reference#2059) - Change underscore to be a keyword (rust-lang/reference#2049) - Update `proc_macro_attribute` to use the attribute template (rust-lang/reference#1889) - Update `proc_macro` to use the attribute template (rust-lang/reference#1887) - Update `macro_use` to use the attribute template (rust-lang/reference#1886) - Update `macro_export` to use the attribute template (rust-lang/reference#1885) ## rust-lang/rust-by-example 7 commits in 2c9b490d70e535cf166bf17feba59e594579843f..160e6bbca70b0c01aa4de88d19db7fc5ff8447c3 2025-11-03 12:26:45 UTC to 2025-10-22 13:19:06 UTC - Fix typos in flow_control/match/binding (rust-lang/rust-by-example#1971) - add clarification on overflowing_literals lint (rust-lang/rust-by-example#1970) - Update enum_use.md (rust-lang/rust-by-example#1960) - Remove weird extra spaces in code (rust-lang/rust-by-example#1962) - Include a link to The Rust Reference in flow_control/match/destructuring (rust-lang/rust-by-example#1963) - Add an example showing pattern binding when matching several values in a match arm (rust-lang/rust-by-example#1966) - Fix typo in linked list length calculation comment (rust-lang/rust-by-example#1968)
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
      
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Make code more idiomatic.
A person learning Rust for the first time seeing
use crate::Role::*gets spun into a rabbit hole of:Besides,
use crate:: ...is taught in the example for use later on, which is linked to at the bottom of this document. Using this document to only teach about unpacking enums into the name space, and then using the other document to introduceuse crate::, means less things need to be learned all at once, reducing confusion.