-
Notifications
You must be signed in to change notification settings - Fork 13.6k
tests/ui
: A New Order [27/N]
#143302
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 [27/N]
#143302
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
17 changes: 9 additions & 8 deletions
17
tests/ui/type-param-constraints.rs → ...auto-traits/auto-traits-type-parameter.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,15 @@ | ||
//! This checks that compiler correctly evaluate constant array lengths within trait `impl` headers. | ||
//! | ||
//! Regression test for <https://github.com/rust-lang/rust/issues/49208>. | ||
|
||
trait Foo { | ||
fn foo(); | ||
} | ||
|
||
impl Foo for [(); 1] { | ||
fn foo() {} | ||
} | ||
|
||
fn main() { | ||
<[(); 0] as Foo>::foo() //~ ERROR E0277 | ||
} |
2 changes: 1 addition & 1 deletion
2
...i/unevaluated_fixed_size_array_len.stderr → ...onsts/const-eval-array-len-in-impl.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/typestate-multi-decl.rs → ...gnment/let-binding-tuple-destructuring.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
4 changes: 2 additions & 2 deletions
4
tests/ui/type_length_limit.stderr → ...mits/type-length-limit-enforcement.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,12 @@ | ||
//! Verifies that the reserved underscore `_` cannot be used as an `ident` fragment specifier | ||
//! within a macro pattern, as it leads to a compilation error. | ||
|
||
macro_rules! identity { | ||
($i: ident) => { | ||
$i | ||
}; | ||
} | ||
|
||
fn main() { | ||
let identity!(_) = 10; //~ ERROR no rules expected reserved identifier `_` | ||
} |
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: 14 additions & 0 deletions
14
tests/ui/namespace/struct-type-and-function-name-coexistence.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,14 @@ | ||
//@ run-pass | ||
|
||
struct A { | ||
a: isize, | ||
} | ||
|
||
fn a(a: A) -> isize { | ||
return a.a; | ||
} | ||
|
||
pub fn main() { | ||
let x: A = A { a: 1 }; | ||
assert_eq!(a(x), 1); | ||
} |
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 @@ | ||
//! Checks that methods with names starting with an underscore (`_`) can be | ||
//! successfully called directly on integer literals, confirming the correct | ||
//! parsing of such expressions where the underscore is part of the method identifier. | ||
|
||
//@ run-pass | ||
|
||
trait Tr: Sized { | ||
fn _method_on_numbers(self) {} | ||
} | ||
|
||
impl Tr for i32 {} | ||
|
||
fn main() { | ||
42._method_on_numbers(); | ||
} |
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,18 @@ | ||
//! Validates the correct behavior of writing a `bool` value using `std::ptr::write`. | ||
//! | ||
//! This test addresses historical concerns regarding the internal representation of `bool` | ||
//! (e.g., as `i1` in LLVM versus its byte-aligned memory layout) and checks that | ||
//! `ptr::write` correctly handles this type without issues, confirming its memory | ||
//! behavior is as expected. | ||
|
||
//@ run-pass | ||
|
||
use std::ptr; | ||
|
||
pub fn main() { | ||
unsafe { | ||
let mut x: bool = false; | ||
// this line breaks it | ||
ptr::write(&mut x, false); | ||
} | ||
} |
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,18 @@ | ||
//! Checks the basic usage of raw pointers (`*const isize`) as function argument and return types. | ||
|
||
//@ run-pass | ||
|
||
#![allow(dead_code)] | ||
|
||
fn f(a: *const isize) -> *const isize { | ||
return a; | ||
} | ||
|
||
fn g(a: *const isize) -> *const isize { | ||
let b = f(a); | ||
return b; | ||
} | ||
|
||
pub fn main() { | ||
return; | ||
} |
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,24 @@ | ||
//! This test verifies that the `?` operator expansion is hygienic, | ||
//! i.e., it's not affected by other `val` and `err` bindings that may be in scope. | ||
//! | ||
//! Note: Prior to the Try trait stabilization, `expr?` expanded to a match | ||
//! with `val` and `err` bindings. The current implementation uses Try::branch() | ||
//! but this test remains relevant for hygiene verification. | ||
|
||
//@ run-pass | ||
|
||
#![allow(non_upper_case_globals)] | ||
#![allow(dead_code)] | ||
|
||
use std::num::ParseIntError; | ||
|
||
fn main() { | ||
assert_eq!(parse(), Ok(1)); | ||
} | ||
|
||
fn parse() -> Result<i32, ParseIntError> { | ||
const val: char = 'a'; | ||
const err: char = 'b'; | ||
|
||
Ok("1".parse::<i32>()?) | ||
} |
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.
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.
Just drop it like this with no any addition?
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.
Yeah - the default is
check-fail
, and I'm thinking that is fine here since we're testing frontend diagnostics. We prefer that because it's cheap+fast (no codegen required).build-fail
is used for things that are expected to fail later, like linking problems.Some more info at https://rustc-dev-guide.rust-lang.org/tests/ui.html#controlling-passfail-expectations
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.
Test is not passing if i remove build-fail, so... I guess we should keep it