-
-
Notifications
You must be signed in to change notification settings - Fork 15k
Migrate 11 tests from tests/ui/issues to specific directories #152966
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| extern crate extern_crate_indirect_fn_ptr_aux_1 as crate1; | ||
|
|
||
| pub static FOO2: crate1::Foo = crate1::FOO; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| extern crate extern_crate_no_prefer_dynamic_aux_1; | ||
|
|
||
| pub fn bar() {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| // issue: rust-lang/rust#14422 | ||
| // Test that we can call an inherently implemented method via aliasing from an extern crate. | ||
| //@ run-pass | ||
| #![allow(non_snake_case)] | ||
|
|
||
| //@ aux-build:extern-crate-alias-impl-method-aux.rs | ||
|
|
||
| extern crate extern_crate_alias_impl_method_aux as bug_lib; | ||
|
|
||
| use bug_lib::B; | ||
| use bug_lib::make; | ||
|
|
||
| pub fn main() { | ||
| let mut an_A: B = make(); | ||
| an_A.foo(); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| // issue: rust-lang/rust#13620 | ||
| // Test cross crate resolution of an indirect function pointer | ||
| //@ run-pass | ||
| //@ aux-build:extern-crate-indirect-fn-ptr-aux-1.rs | ||
| //@ aux-build:extern-crate-indirect-fn-ptr-aux-2.rs | ||
|
|
||
| extern crate extern_crate_indirect_fn_ptr_aux_2 as crate2; | ||
|
|
||
| fn main() { | ||
| (crate2::FOO2.foo)(); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| // issue: rust-lang/rust#14344 | ||
| // Test that we can depend on an `no-prefer-dynamic` crate. | ||
| //@ run-pass | ||
| //@ aux-build:extern-crate-no-prefer-dynamic-aux-1.rs | ||
| //@ aux-build:extern-crate-no-prefer-dynamic-aux-2.rs | ||
|
|
||
| extern crate extern_crate_no_prefer_dynamic_aux_1; | ||
| extern crate extern_crate_no_prefer_dynamic_aux_2; | ||
|
|
||
| fn main() { | ||
| extern_crate_no_prefer_dynamic_aux_1::foo(); | ||
| extern_crate_no_prefer_dynamic_aux_2::bar(); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| // issue: rust-lang/rust#12612 | ||
| // Test that unused `use` declarations involving multiple external crates are handled properly. | ||
| //@ run-pass | ||
| #![allow(unused_imports)] | ||
| //@ aux-build:unused-cross-crate-import-aux-1.rs | ||
| //@ aux-build:unused-cross-crate-import-aux-2.rs | ||
|
|
||
| extern crate unused_cross_crate_import_aux_1 as foo; | ||
| extern crate unused_cross_crate_import_aux_2 as bar; | ||
|
|
||
| mod test { | ||
| use bar::baz; | ||
| } | ||
|
|
||
| fn main() {} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| // issue: rust-lang/rust#11224 | ||
| // Test that an unused `extern crate` declaration does not crash the compiler. | ||
| //@ run-pass | ||
| //@ aux-build:unused-extern-crate-aux.rs | ||
|
|
||
| extern crate unused_extern_crate_aux as unused; | ||
|
|
||
| pub fn main() {} |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| // issue: rust-lang/rust#11592 | ||
| // Test that the `missing_docs` lint does not trigger for a private trait. | ||
| //@ check-pass | ||
| //! Ensure the private trait Bar isn't complained about. | ||
|
|
||
| #![deny(missing_docs)] | ||
|
|
||
| mod foo { | ||
| trait Bar { | ||
| fn bar(&self) {} | ||
| } | ||
| impl Bar for i8 { | ||
| fn bar(&self) {} | ||
| } | ||
| } | ||
|
|
||
| fn main() {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| // issue: rust-lang/rust#11552 | ||
| // Test nested box pattern matching inside a larger `match` statement. | ||
| //@ run-pass | ||
| #![feature(box_patterns)] | ||
|
|
||
| #[derive(Clone)] | ||
| enum Noun { | ||
| Atom(isize), | ||
| Cell(Box<Noun>, Box<Noun>), | ||
| } | ||
|
|
||
| fn fas(n: &Noun) -> Noun { | ||
| match n { | ||
| &Noun::Cell(box Noun::Atom(2), box Noun::Cell(ref a, _)) => (**a).clone(), | ||
| _ => panic!("Invalid fas pattern"), | ||
| } | ||
| } | ||
|
|
||
| pub fn main() { | ||
| fas(&Noun::Cell( | ||
| Box::new(Noun::Atom(2)), | ||
| Box::new(Noun::Cell(Box::new(Noun::Atom(2)), Box::new(Noun::Atom(3)))), | ||
| )); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| // issue: rust-lang/rust#11508 | ||
| // Test pattern matching on a tuple struct defined in an external crate. | ||
| //@ run-pass | ||
| //@ aux-build:tuple-struct-cross-crate-aux.rs | ||
|
|
||
| extern crate tuple_struct_cross_crate_aux as rand; | ||
|
|
||
| use rand::{Closed01, random}; | ||
|
|
||
| fn main() { | ||
| let Closed01(val) = random::<Closed01<f32>>(); | ||
| println!("{}", val); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| // issue: rust-lang/rust#11677 | ||
| // Test that type inference works correctly for struct fields containing trait objects. | ||
| //@ run-pass | ||
| #![allow(unused_imports)] | ||
| #![allow(dead_code)] | ||
|
|
||
| // this code used to cause an ICE | ||
|
|
||
| use std::marker; | ||
|
|
||
| trait X<T> { | ||
| fn dummy(&self) -> T { | ||
| panic!() | ||
| } | ||
| } | ||
|
|
||
| struct S<T> { | ||
| f: Box<dyn X<T> + 'static>, | ||
| g: Box<dyn X<T> + 'static>, | ||
| } | ||
|
|
||
| struct F; | ||
| impl X<isize> for F {} | ||
|
|
||
| fn main() { | ||
| S { f: Box::new(F), g: Box::new(F) }; | ||
| } |
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.
but what I'll ask to fix is links. Can you replace all of this with actual links to issues
< https://github.com/rust-lang/rust/issues/number >
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.
done