- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
Replace visibility test with reachability test in dead code detection #119552
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
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            9 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      a0fe413
              
                Replace visibility test with reachability test in dead code detection
              
              
                krtab ccd99b3
              
                Remove unused fields in some structures
              
              
                krtab 701dd5b
              
                Allow unused fields in some tests
              
              
                krtab 2b8a548
              
                Mark codegen_gcc fields used only on feature master as such
              
              
                krtab 9ee59f3
              
                fix: allow-one-hash-in-raw-strings option of needless_raw_string_hash…
              
              
                krtab 99b8ec2
              
                Allow dead_code for unused struct fields that are now causing a warning
              
              
                krtab e788518
              
                Allow dead code in thread local dtor
              
              
                krtab f60c4ed
              
                Allow dead code in sys/pal
              
              
                krtab 7342cc4
              
                Delete dead fields of deserialized cargo output
              
              
                krtab File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
        
          
          
            1 change: 1 addition & 0 deletions
          
          1 
        
  src/tools/clippy/tests/ui-toml/needless_raw_string_hashes_one_allowed/clippy.toml
  
  
      
      
   
        
      
      
    
  
    
      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
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1 @@ | ||
| allow-one-hash-in-raw-strings = true | 
        
          
          
            9 changes: 9 additions & 0 deletions
          
          9 
        
  ...ppy/tests/ui-toml/needless_raw_string_hashes_one_allowed/needless_raw_string_hashes.fixed
  
  
      
      
   
        
      
      
    
  
    
      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
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #![allow(clippy::no_effect, unused)] | ||
| #![warn(clippy::needless_raw_string_hashes)] | ||
|  | ||
| fn main() { | ||
| r#"\aaa"#; | ||
| r#"\aaa"#; | ||
| r#"Hello "world"!"#; | ||
| r####" "### "## "# "####; | ||
| } | 
        
          
          
            9 changes: 9 additions & 0 deletions
          
          9 
        
  ...clippy/tests/ui-toml/needless_raw_string_hashes_one_allowed/needless_raw_string_hashes.rs
  
  
      
      
   
        
      
      
    
  
    
      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
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #![allow(clippy::no_effect, unused)] | ||
| #![warn(clippy::needless_raw_string_hashes)] | ||
|  | ||
| fn main() { | ||
| r#"\aaa"#; | ||
| r##"\aaa"##; | ||
| r##"Hello "world"!"##; | ||
| r######" "### "## "# "######; | ||
| } | 
        
          
          
            40 changes: 40 additions & 0 deletions
          
          40 
        
  ...py/tests/ui-toml/needless_raw_string_hashes_one_allowed/needless_raw_string_hashes.stderr
  
  
      
      
   
        
      
      
    
  
    
      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
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| error: unnecessary hashes around raw string literal | ||
| --> tests/ui-toml/needless_raw_string_hashes_one_allowed/needless_raw_string_hashes.rs:6:5 | ||
| | | ||
| LL | r##"\aaa"##; | ||
| | ^^^^^^^^^^^ | ||
| | | ||
| = note: `-D clippy::needless-raw-string-hashes` implied by `-D warnings` | ||
| = help: to override `-D warnings` add `#[allow(clippy::needless_raw_string_hashes)]` | ||
| help: remove one hash from both sides of the string literal | ||
| | | ||
| LL - r##"\aaa"##; | ||
| LL + r#"\aaa"#; | ||
| | | ||
|  | ||
| error: unnecessary hashes around raw string literal | ||
| --> tests/ui-toml/needless_raw_string_hashes_one_allowed/needless_raw_string_hashes.rs:7:5 | ||
| | | ||
| LL | r##"Hello "world"!"##; | ||
| | ^^^^^^^^^^^^^^^^^^^^^ | ||
| | | ||
| help: remove one hash from both sides of the string literal | ||
| | | ||
| LL - r##"Hello "world"!"##; | ||
| LL + r#"Hello "world"!"#; | ||
| | | ||
|  | ||
| error: unnecessary hashes around raw string literal | ||
| --> tests/ui-toml/needless_raw_string_hashes_one_allowed/needless_raw_string_hashes.rs:8:5 | ||
| | | ||
| LL | r######" "### "## "# "######; | ||
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | | ||
| help: remove 2 hashes from both sides of the string literal | ||
| | | ||
| LL - r######" "### "## "# "######; | ||
| LL + r####" "### "## "# "####; | ||
| | | ||
|  | ||
| error: aborting due to 3 previous errors | ||
|  | 
      
      Oops, something went wrong.
        
    
  
  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.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.