-
Notifications
You must be signed in to change notification settings - Fork 13.5k
tests/ui
: A New Order [24/N]
#143299
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
+264
−204
Merged
tests/ui
: A New Order [24/N]
#143299
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
10 changes: 5 additions & 5 deletions
10
tests/ui/realloc-16687.rs → tests/ui/allocator/alloc-shrink-oob-read.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
6 changes: 3 additions & 3 deletions
6
tests/ui/phantom-auto-trait.rs → ...-traits/auto-trait-phantom-data-bounds.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
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,15 @@ | ||
//! Test evaluation order in binary operations with primitive types. | ||
//@ run-pass | ||
|
||
fn main() { | ||
let x = Box::new(0); | ||
assert_eq!( | ||
0, | ||
*x + { | ||
drop(x); | ||
let _ = Box::new(main); | ||
0 | ||
} | ||
); | ||
} |
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,24 @@ | ||
//! Tests basic pointer coercions | ||
//@ run-pass | ||
|
||
pub fn main() { | ||
// &mut -> & | ||
let x: &mut isize = &mut 42; | ||
let _x: &isize = x; | ||
let _x: &isize = &mut 42; | ||
|
||
// & -> *const | ||
let x: &isize = &42; | ||
let _x: *const isize = x; | ||
let _x: *const isize = &42; | ||
|
||
// &mut -> *const | ||
let x: &mut isize = &mut 42; | ||
let _x: *const isize = x; | ||
let _x: *const isize = &mut 42; | ||
|
||
// *mut -> *const | ||
let _x: *mut isize = &mut 42; | ||
let _x: *const isize = x; | ||
} |
3 changes: 1 addition & 2 deletions
3
tests/ui/ptr-coercion.rs → tests/ui/coercion/ptr-mutability-errors.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
3 changes: 3 additions & 0 deletions
3
tests/ui/print-stdout-eprint-stderr.rs → .../ui/io-checks/stdout-stderr-separation.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
25 changes: 25 additions & 0 deletions
25
tests/ui/mismatched_types/closure-parameter-type-inference-mismatch.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,25 @@ | ||
//! Test closure parameter type inference and type mismatch errors. | ||
//! | ||
//! Related to <https://github.com/rust-lang/rust/issues/2093>. | ||
//@ dont-require-annotations: NOTE | ||
|
||
fn let_in<T, F>(x: T, f: F) | ||
where | ||
F: FnOnce(T), | ||
{ | ||
} | ||
|
||
fn main() { | ||
let_in(3u32, |i| { | ||
assert!(i == 3i32); | ||
//~^ ERROR mismatched types | ||
//~| NOTE expected `u32`, found `i32` | ||
}); | ||
|
||
let_in(3i32, |i| { | ||
assert!(i == 3u32); | ||
//~^ ERROR mismatched types | ||
//~| NOTE expected `i32`, found `u32` | ||
}); | ||
} |
31 changes: 31 additions & 0 deletions
31
tests/ui/mismatched_types/closure-parameter-type-inference-mismatch.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,31 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/closure-parameter-type-inference-mismatch.rs:15:22 | ||
| | ||
LL | assert!(i == 3i32); | ||
| - ^^^^ expected `u32`, found `i32` | ||
| | | ||
| expected because this is `u32` | ||
| | ||
help: change the type of the numeric literal from `i32` to `u32` | ||
| | ||
LL - assert!(i == 3i32); | ||
LL + assert!(i == 3u32); | ||
| | ||
|
||
error[E0308]: mismatched types | ||
--> $DIR/closure-parameter-type-inference-mismatch.rs:21:22 | ||
| | ||
LL | assert!(i == 3u32); | ||
| - ^^^^ expected `i32`, found `u32` | ||
| | | ||
| expected because this is `i32` | ||
| | ||
help: change the type of the numeric literal from `u32` to `i32` | ||
| | ||
LL - assert!(i == 3u32); | ||
LL + assert!(i == 3i32); | ||
| | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0308`. |
6 changes: 5 additions & 1 deletion
6
...-type-err-cause-on-impl-trait-return-2.rs → ...ype-error-diagnostic-in-complex-return.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
...e-err-cause-on-impl-trait-return-2.stderr → ...error-diagnostic-in-complex-return.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 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,13 @@ | ||
//! Tests correct parsing of doc comments on generic parameters in traits. | ||
//! Checks that compiler doesn't panic when processing this. | ||
//@ check-pass | ||
|
||
#![crate_type = "lib"] | ||
|
||
pub trait Layer< | ||
/// Documentation for generic parameter. | ||
Input, | ||
> | ||
{ | ||
} | ||
Binary file not shown.
24 changes: 24 additions & 0 deletions
24
tests/ui/pattern/move-ref-patterns/pattern-ref-bindings-reassignment.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,24 @@ | ||
//! Tests how we behave when the user attempts to mutate an immutable | ||
//! binding that was introduced by either `ref` or `ref mut` | ||
//! patterns. | ||
//! | ||
//! Such bindings cannot be made mutable via the mere addition of the | ||
//! `mut` keyword, and thus we want to check that the compiler does not | ||
//! suggest doing so. | ||
fn main() { | ||
let (mut one_two, mut three_four) = ((1, 2), (3, 4)); | ||
|
||
// Bind via pattern: | ||
// - `a` as immutable reference (`ref`) | ||
// - `b` as mutable reference (`ref mut`) | ||
let &mut (ref a, ref mut b) = &mut one_two; | ||
|
||
// Attempt to reassign immutable `ref`-bound variable | ||
a = &three_four.0; | ||
//~^ ERROR cannot assign twice to immutable variable `a` | ||
|
||
// Attempt to reassign mutable `ref mut`-bound variable | ||
b = &mut three_four.1; | ||
//~^ ERROR cannot assign twice to immutable variable `b` | ||
} |
5 changes: 3 additions & 2 deletions
5
tests/ui/reassign-ref-mut.stderr → .../pattern-ref-bindings-reassignment.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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
//! Test that `--print calling-conventions` outputs all supported calling conventions. | ||
//@ compile-flags: --print calling-conventions | ||
//@ build-pass |
File renamed without changes.
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.
Uh oh!
There was an error while loading. Please reload this page.