-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
Open
Kivooeo
wants to merge
2
commits into
rust-lang:master
Choose a base branch
from
Kivooeo:tf27
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.
Open
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; | ||
} |
11 changes: 2 additions & 9 deletions
11
tests/ui/try-operator-hygiene.rs → ...y-trait/try-operator-expansion-hygiene.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 was deleted.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
tests/ui/type-inference/type-inference-none-in-generic-ref.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,9 @@ | ||
//! Checks that unconstrained `None` is rejected through references and generics | ||
|
||
struct S<'a, T: 'a> { | ||
o: &'a Option<T>, | ||
} | ||
|
||
fn main() { | ||
S { o: &None }; //~ ERROR type annotations needed [E0282] | ||
} |
2 changes: 1 addition & 1 deletion
2
tests/ui/unconstrained-ref.stderr → ...type-inference-none-in-generic-ref.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,5 @@ | ||
//! Regression test for <https://github.com/rust-lang/rust/issues/5062>. | ||
|
||
fn main() { | ||
None; //~ ERROR type annotations needed [E0282] | ||
} |
2 changes: 1 addition & 1 deletion
2
tests/ui/unconstrained-none.stderr → .../type-inference-unconstrained-none.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.
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.
Why is this deleted?
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.
AFAIK, it's not true anymore, it expands into this https://doc.rust-lang.org/std/ops/trait.Try.html#tymethod.branch
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.
like this
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.
Also if it'll help to you invistigation what is going here, here is a discussion about it #84277 (comment)