-
Notifications
You must be signed in to change notification settings - Fork 13.6k
tests/ui
: A New Order [28/28] FINAL PART
#143303
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
//! Checks that `Weak` pointers can be created with an empty enum type parameter. | ||
//! And generic `Weak` handles zero-variant enums without error. | ||
//! | ||
//! Regression test for <https://github.com/rust-lang/rust/issues/48493> | ||
|
||
//@ run-pass | ||
|
||
enum Void {} | ||
|
||
fn main() { | ||
let _ = std::rc::Weak::<Void>::new(); | ||
let _ = std::sync::Weak::<Void>::new(); | ||
} |
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 that argument names starting with `_` are usable. | ||
|
||
//@ run-pass | ||
|
||
fn good(_a: &isize) {} | ||
|
||
fn called<F>(_f: F) | ||
where | ||
F: FnOnce(&isize), | ||
{ | ||
} | ||
|
||
pub fn main() { | ||
called(good); | ||
} |
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 @@ | ||
//! Checks borrow after move error when using `self` consuming method with struct update syntax. | ||
|
||
struct Mine { | ||
test: String, | ||
other_val: isize, | ||
} | ||
|
||
impl Mine { | ||
fn make_string_bar(mut self) -> Mine { | ||
self.test = "Bar".to_string(); | ||
self | ||
} | ||
} | ||
|
||
fn main() { | ||
let start = Mine { test: "Foo".to_string(), other_val: 0 }; | ||
let end = Mine { other_val: 1, ..start.make_string_bar() }; | ||
println!("{}", start.test); //~ ERROR borrow of moved value: `start` | ||
} |
12 changes: 6 additions & 6 deletions
12
tests/ui/walk-struct-literal-with.stderr → ...wnership-struct-update-moved-error.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/unused-move-capture.rs → tests/ui/closures/no-capture-closure-call.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 @@ | ||
//! Sanity check for no capture closures | ||
|
||
//@ run-pass | ||
|
||
pub fn main() { | ||
|
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions
12
tests/ui/drop/box-drop-unused-value-statement-regression.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,12 @@ | ||
//! Regression test for a crash caused by an "unsused move" | ||
//! (specifically, a variable bound to a `Box` used as a statement) | ||
//! leading to incorrect memory zero-filling after drop. | ||
//! | ||
//! Regression test for <https://github.com/rust-lang/rust/issues/3878>. | ||
|
||
//@ run-pass | ||
|
||
pub fn main() { | ||
let y: Box<_> = Box::new(1); | ||
drop(y); | ||
} |
File renamed without changes.
13 changes: 7 additions & 6 deletions
13
tests/ui/wrong-hashset-issue-42918.rs → tests/ui/hashmap/hashset-enum-variant.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,12 @@ | ||
//! Checks that compiler prevernt attempting to define an unrecognized or unknown lang item | ||
|
||
#![allow(unused)] | ||
#![feature(lang_items)] | ||
|
||
#[lang = "foo"] | ||
fn bar() -> ! { | ||
//~^^ ERROR definition of an unknown lang item: `foo` | ||
loop {} | ||
} | ||
|
||
fn main() {} |
2 changes: 1 addition & 1 deletion
2
tests/ui/unknown-language-item.stderr → ...lang-item-unknown-definition-error.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,20 @@ | ||
//! Checks that functions from different modules are accessible via their fully-qualified paths. | ||
|
||
//@ run-pass | ||
|
||
mod foo { | ||
pub fn x() -> isize { | ||
return 1; | ||
} | ||
} | ||
|
||
mod bar { | ||
pub fn y() -> isize { | ||
return 1; | ||
} | ||
} | ||
|
||
pub fn main() { | ||
foo::x(); | ||
bar::y(); | ||
} |
2 changes: 2 additions & 0 deletions
2
tests/ui/use-nested-groups.rs → tests/ui/modules/module-use-nested-groups.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 @@ | ||
//! Checks complex `use` syntax and availability of types across nested modules. | ||
|
||
//@ run-pass | ||
|
||
mod a { | ||
|
13 changes: 13 additions & 0 deletions
13
tests/ui/modules/primitive-type-module-deprecated-paths.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,13 @@ | ||
//! Make sure the module level constants are still there and accessible even after | ||
//! the corresponding associated constants have been added, and later stabilized. | ||
|
||
//@ run-pass | ||
|
||
#![allow(deprecated, deprecated_in_future)] | ||
use std::{f32, u16}; | ||
|
||
fn main() { | ||
let _ = u16::MAX; | ||
let _ = f32::EPSILON; | ||
let _ = std::f64::MANTISSA_DIGITS; | ||
} |
10 changes: 6 additions & 4 deletions
10
tests/ui/use-keyword-2.rs → ...odules/use-keyword-reexport-type-alias.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: 2 additions & 0 deletions
2
tests/ui/unsigned-literal-negation.rs → .../unary-negation-unsigned-integer-error.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
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.
weird-exprs.rs has been referenced a fair bit in blogs and casual conversations. This move breaks all those references and is a lot harder to remember IMO..
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, it's pretty iconic test, can't argue with that, I guess I can revert the name, is that sounds fine?
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.
I completely overlooked this rename, yes please do!