- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
Better sanitize attr diagnostic #145182
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
Better sanitize attr diagnostic #145182
Conversation
| error: invalid setting for `address` | ||
| --> $DIR/invalid-sanitize.rs:15:12 | ||
| | | ||
| LL | #[sanitize(address = "bogus")] | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like for this to only mark the "bogus" part. I couldn't figure out how to get the correct span for that.
e327696    to
    2b7dbe6      
    Compare
  
    
      
        
              This comment was marked as resolved.
        
        
      
    
  This comment was marked as resolved.
2b7dbe6    to
    cf64064      
    Compare
  
    
      
        
              This comment was marked as resolved.
        
        
      
    
  This comment was marked as resolved.
cf64064    to
    afc3b7f      
    Compare
  
    | r? @davidtwco rustbot has assigned @davidtwco. Use  | 
| Some changes occurred in compiler/rustc_codegen_ssa | 
| @luca3s these errors would also be fixed by porting the attribute to the new parsing infrastructure. let me know if you'd be interested in doing that. If not, we could just merge this now and me or someone else will soon replace the code here. Alternatively we could close and again let me or someone else look at a new parser for this attribute soon. | 
| actually, it's easier than that. I've just written the code to port sanitize already :). Feel like giving that a review? I'm sorry for taking your idea but I think this is a better permanent solution. Thanks for finding this in any case <3 | 
| No Problem :) Do you have a link to that PR? | 
| I'm just running the tests on my version, I'll link it in just a sec | 
While working on a new sanitizer i noticed that the error messages here could be better.
This now differentiates between a wrong / nonexisting sanitizer and a wrong / nonexisting value for a valid sanitizer.
This is my first time doing a PR to rustc, so i could have missed something.