- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
          tests/ui: A New Order [23/N]
          #143298
        
          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
                    
  
    tests/ui: A New Order [23/N]
  
  #143298
                      Changes from all commits
      Commits
    
    
            Show all changes
          
          
            2 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      
    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
    
  
  
    
              
        
          
          
            14 changes: 8 additions & 6 deletions
          
          14 
        
  tests/ui/optimization-remark.rs → ...s/ui/codegen/remark-flag-functionality.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
    
  
  
    
              
  
    
      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,19 @@ | ||
| //! Ensure shift operations don't mutate their right operand. | ||
| //! | ||
| //! This test checks that expressions like `0 << b` don't accidentally | ||
| //! modify the variable `b` due to codegen issues with virtual registers. | ||
| //! | ||
| //! Regression test for <https://github.com/rust-lang/rust/issues/152>. | ||
|  | ||
| //@ run-pass | ||
|  | ||
| pub fn main() { | ||
| let mut b: usize = 1; | ||
| while b < size_of::<usize>() { | ||
| // This shift operation should not mutate `b` | ||
| let _ = 0_usize << b; | ||
| b <<= 1; | ||
| std::hint::black_box(b); | ||
| } | ||
| assert_eq!(size_of::<usize>(), b); | ||
| } | ||
  
    
      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,28 @@ | ||
| //! Check that functions with sret results don't violate aliasing rules. | ||
| //! | ||
| //! When `foo = func(&mut foo)` is called, the compiler must avoid creating | ||
| //! two mutable references to the same variable simultaneously (one for the | ||
| //! parameter and one for the hidden sret out-pointer). | ||
| //! | ||
| //! Regression test for <https://github.com/rust-lang/rust/pull/18250>. | ||
|  | ||
| //@ run-pass | ||
|  | ||
| #[derive(Copy, Clone)] | ||
| pub struct Foo { | ||
| f1: isize, | ||
| _f2: isize, | ||
| } | ||
|  | ||
| #[inline(never)] | ||
| pub fn foo(f: &mut Foo) -> Foo { | ||
| let ret = *f; | ||
| f.f1 = 0; | ||
| ret | ||
| } | ||
|  | ||
| pub fn main() { | ||
| let mut f = Foo { f1: 8, _f2: 9 }; | ||
| f = foo(&mut f); | ||
| assert_eq!(f.f1, 8); | ||
| } | 
        
          
          
            6 changes: 4 additions & 2 deletions
          
          6 
        
  tests/ui/paren-span.rs → .../ui/macros/macro-paren-span-diagnostic.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
    
  
  
    
              
        
          
          
            2 changes: 1 addition & 1 deletion
          
          2 
        
  tests/ui/paren-span.stderr → ...macros/macro-paren-span-diagnostic.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
    
  
  
    
              This file was deleted.
      
      Oops, something went wrong.
      
    
  This file was deleted.
      
      Oops, something went wrong.
      
    
  This file was deleted.
      
      Oops, something went wrong.
      
    
  
  
    
      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
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| //! Check that closures can be used inside `#[panic_handler]` functions. | ||
|  | ||
| //@ check-pass | ||
|  | ||
| #![crate_type = "rlib"] | ||
| #![no_std] | ||
|  | ||
| #[panic_handler] | ||
| pub fn panicfmt(_: &::core::panic::PanicInfo) -> ! { | ||
| |x: u8| x; | ||
| loop {} | ||
| } | 
  
    
      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,20 @@ | ||
| //! Check that UFCS syntax works correctly in return statements | ||
| //! without requiring workaround parentheses. | ||
| //! | ||
| //! Regression test for <https://github.com/rust-lang/rust/issues/37765>. | ||
|  | ||
| //@ run-pass | ||
| //@ run-rustfix | ||
|  | ||
| #![allow(dead_code)] | ||
| #![warn(unused_parens)] | ||
|  | ||
| fn with_parens<T: ToString>(arg: T) -> String { | ||
| return <T as ToString>::to_string(&arg); //~ WARN unnecessary parentheses around `return` value | ||
| } | ||
|  | ||
| fn no_parens<T: ToString>(arg: T) -> String { | ||
| return <T as ToString>::to_string(&arg); | ||
| } | ||
|  | ||
| fn main() {} | 
  
    
      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,20 @@ | ||
| //! Check that UFCS syntax works correctly in return statements | ||
| //! without requiring workaround parentheses. | ||
| //! | ||
| //! Regression test for <https://github.com/rust-lang/rust/issues/37765>. | ||
|  | ||
| //@ run-pass | ||
| //@ run-rustfix | ||
|  | ||
| #![allow(dead_code)] | ||
| #![warn(unused_parens)] | ||
|  | ||
| fn with_parens<T: ToString>(arg: T) -> String { | ||
| return (<T as ToString>::to_string(&arg)); //~ WARN unnecessary parentheses around `return` value | ||
| } | ||
|  | ||
| fn no_parens<T: ToString>(arg: T) -> String { | ||
| return <T as ToString>::to_string(&arg); | ||
| } | ||
|  | ||
| fn main() {} | 
        
          
          
            4 changes: 2 additions & 2 deletions
          
          4 
        
  tests/ui/path-lookahead.stderr → ...i/parser/ufcs-return-unused-parens.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
    
  
  
    
              This file was deleted.
      
      Oops, something went wrong.
      
    
  This file was deleted.
      
      Oops, something went wrong.
      
    
  
        
          
          
            4 changes: 3 additions & 1 deletion
          
          4 
        
  tests/ui/partialeq_help.rs → ...aits/partialeq-ref-mismatch-diagnostic.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
    
  
  
    
              
      
      Oops, something went wrong.
        
    
  
      
      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.
  
    
  
    
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.
Wow, old issue! That's only two months after https://www.github.com/rust-lang/rust/issues/1