-
Notifications
You must be signed in to change notification settings - Fork 13.5k
tests/ui
: A New Order [9/N]
#142214
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
Open
Kivooeo
wants to merge
8
commits into
rust-lang:master
Choose a base branch
from
Kivooeo:tf9
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+85
−74
Open
tests/ui
: A New Order [9/N]
#142214
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
fb03acb
moved renamed docs stderr formatted | diverging-fn-tail-35849.rs
Kivooeo 33c334f
moved renamed docs | double-ref.rs
Kivooeo 38ee2e8
moved renamed docs stderr | double-type-import.rs
Kivooeo 8f9a3ad
moved renamed docs formatted | early-ret-binop-add.rs
Kivooeo c4ff80c
moved renamed docs stderr formatted | elide-errors-on-mismatched-tupl…
Kivooeo e0758c7
moved renamed docs stderr formatted | elided-test.rs
Kivooeo d6230bf
deleted | else-if.rs
Kivooeo d35e40a
moved renamed docs formatted | empty-allocation-non-null.rs
Kivooeo 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
6 changes: 6 additions & 0 deletions
6
tests/ui/empty-allocation-non-null.rs → ...llocator/empty-alloc-nonnull-guarantee.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 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 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,19 @@ | ||
//! Test early return within binary operation expressions | ||
|
||
//@ run-pass | ||
|
||
#![allow(dead_code)] | ||
#![allow(unreachable_code)] | ||
|
||
use std::ops::Add; | ||
|
||
/// Function that performs addition with an early return in the right operand | ||
fn add_with_early_return<T: Add<Output = T> + Copy>(n: T) -> T { | ||
n + { return n } | ||
} | ||
|
||
pub fn main() { | ||
// Test with different numeric types to ensure generic behavior works | ||
let _result1 = add_with_early_return(42i32); | ||
let _result2 = add_with_early_return(3.14f64); | ||
} |
2 changes: 2 additions & 0 deletions
2
tests/ui/double-type-import.rs → tests/ui/imports/duplicate-use-bindings.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/double-type-import.stderr → .../ui/imports/duplicate-use-bindings.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,25 @@ | ||
//! Regression test for issue #50333: elide irrelevant E0277 errors on tuple mismatch | ||
|
||
// Hide irrelevant E0277 errors (#50333) | ||
|
||
trait T {} | ||
|
||
struct A; | ||
|
||
impl T for A {} | ||
|
||
impl A { | ||
fn new() -> Self { | ||
Self {} | ||
} | ||
} | ||
|
||
fn main() { | ||
// This creates a tuple type mismatch: 2-element tuple destructured into 3 variables | ||
let (a, b, c) = (A::new(), A::new()); | ||
//~^ ERROR mismatched types | ||
|
||
// This line should NOT produce an E0277 error about `Sized` trait bounds, | ||
// because `a`, `b`, and `c` are `TyErr` due to the mismatch above | ||
let _ts: Vec<&dyn T> = vec![&a, &b, &c]; | ||
} |
4 changes: 2 additions & 2 deletions
4
...i/elide-errors-on-mismatched-tuple.stderr → ...ched_types/elide-on-tuple-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
2 changes: 2 additions & 0 deletions
2
tests/ui/double-ref.rs → ...ui/parser/reference-whitespace-parsing.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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
//! Test parsing of multiple references with various whitespace arrangements | ||
//@ run-pass | ||
|
||
#![allow(dead_code)] | ||
|
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,8 @@ | ||
//! Test that #[test] functions are elided when not running tests, causing missing main error | ||
#[test] | ||
fn main() { | ||
// This function would normally serve as main, but since it's marked with #[test], | ||
// it gets elided when not running tests | ||
} | ||
//~^ ERROR `main` function not found in crate `test_function_elided_no_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,9 @@ | ||
error[E0601]: `main` function not found in crate `test_function_elided_no_main` | ||
--> $DIR/test-function-elided-no-main.rs:7:2 | ||
| | ||
LL | } | ||
| ^ consider adding a `main` function to `$DIR/test-function-elided-no-main.rs` | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0601`. |
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,10 @@ | ||
//! Regression test for issue #35849: transmute with panic in diverging function | ||
|
||
fn assert_sizeof() -> ! { | ||
unsafe { | ||
::std::mem::transmute::<f64, [u8; 8]>(panic!()) | ||
//~^ ERROR mismatched types | ||
} | ||
} | ||
|
||
fn main() {} |
2 changes: 1 addition & 1 deletion
2
tests/ui/diverging-fn-tail-35849.stderr → ...i/transmute/diverging-fn-transmute.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
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.
Nit: this guarantee is overly strong for what this test actually does, it's more like