From b6e13e35911d1aabc7164fc069b09c4e8c91981e Mon Sep 17 00:00:00 2001 From: Kivooeo Date: Thu, 24 Jul 2025 17:52:22 +0500 Subject: comments --- tests/ui/cast/array-field-ptr-cast-14845.rs | 2 + tests/ui/cast/array-field-ptr-cast-14845.stderr | 15 ++++ tests/ui/cast/trait-object-size-error-14366.rs | 2 + tests/ui/cast/trait-object-size-error-14366.stderr | 16 ++++ tests/ui/closures/boxed-closure-lifetime-13808.rs | 2 + .../coercion/method-return-trait-object-14399.rs | 2 + .../method-return-trait-object-14399.stderr | 12 +++ tests/ui/consts/module-const-array-size-13763.rs | 2 + tests/ui/drop/panic-during-drop-14875.rs | 2 + tests/ui/extern/macro-use-extern-std-14330.rs | 6 -- tests/ui/fn_traits/closure-trait-impl-14959.rs | 2 + tests/ui/generics/box-missing-generics-14092.rs | 2 + .../ui/generics/box-missing-generics-14092.stderr | 14 ++++ .../inference/matcher-lifetime-inference-14919.rs | 56 +++++++++++++ tests/ui/issues/issue-13482-2.stderr | 9 --- tests/ui/issues/issue-13482.stderr | 9 --- tests/ui/issues/issue-13497-2.stderr | 14 ---- tests/ui/issues/issue-13497.stderr | 20 ----- tests/ui/issues/issue-13847.stderr | 9 --- tests/ui/issues/issue-14091-2.stderr | 17 ---- tests/ui/issues/issue-14091.stderr | 9 --- tests/ui/issues/issue-14092.stderr | 14 ---- tests/ui/issues/issue-14285.stderr | 15 ---- tests/ui/issues/issue-14366.stderr | 16 ---- tests/ui/issues/issue-14399.stderr | 12 --- tests/ui/issues/issue-14541.stderr | 11 --- tests/ui/issues/issue-14721.stderr | 9 --- tests/ui/issues/issue-14845.stderr | 15 ---- tests/ui/issues/issue-14853.stderr | 12 --- tests/ui/issues/issue-14915.stderr | 17 ---- .../lifetimes/explicit-lifetime-required-14285.rs | 2 + .../explicit-lifetime-required-14285.stderr | 15 ++++ .../lifetimes/lifetime-bound-whitespace-13703.rs | 2 + .../lifetimes/missing-lifetime-specifier-13497.rs | 2 + .../missing-lifetime-specifier-13497.stderr | 20 +++++ tests/ui/lifetimes/reader-wrapper-trait-14901.rs | 20 +++++ .../ref-pattern-lifetime-annotation-13665.rs | 2 + .../return-reference-local-variable-13497-2.rs | 7 -- .../return-reference-local-variable-13497.rs | 11 +++ .../return-reference-local-variable-13497.stderr | 16 ++++ .../ui/lifetimes/trait-object-constructor-14821.rs | 2 + tests/ui/macros/assert-mismatched-types-14091.rs | 4 - tests/ui/macros/assert-unary-operator-14091-2.rs | 17 ---- tests/ui/match/guard-pattern-ordering-14865.rs | 2 + .../ui/match/multiple-refutable-patterns-13867.rs | 2 + tests/ui/match/tuple-usize-pattern-14393.rs | 2 + tests/ui/modules/use-shadowing-14082.rs | 19 ----- .../ui/never_type/field-access-never-type-13847.rs | 2 + .../field-access-never-type-13847.stderr | 9 +++ tests/ui/operator-recovery/box-arithmetic-14915.rs | 2 + .../operator-recovery/box-arithmetic-14915.stderr | 17 ++++ tests/ui/pattern/array-length-mismatch-13482.rs | 2 + .../ui/pattern/array-length-mismatch-13482.stderr | 9 +++ .../array-length-mismatch-verbose-13482-2.rs | 9 --- .../pattern/array-length-mismatch-verbose-13482.rs | 9 +++ .../array-length-mismatch-verbose-13482.stderr | 9 +++ .../pattern/struct-mismatch-destructure-14541.rs | 2 + .../struct-mismatch-destructure-14541.stderr | 11 +++ tests/ui/pattern/struct-wildcard-pattern-14308.rs | 2 + tests/ui/resolve/pointer-type-impls-14254.rs | 94 ++++++++++++++++++++++ tests/ui/resolve/use-shadowing-14082.rs | 21 +++++ .../ui/trait-bounds/anonymous-parameters-13775.rs | 2 + tests/ui/traits/impl-trait-chain-14229.rs | 2 + .../ui/traits/matcher-lifetime-inference-14919.rs | 54 ------------- tests/ui/traits/pointer-type-impls-14254.rs | 92 --------------------- tests/ui/traits/reader-wrapper-trait-14901.rs | 18 ----- tests/ui/traits/trait-bound-mismatch-14853.rs | 2 + tests/ui/traits/trait-bound-mismatch-14853.stderr | 12 +++ .../float-type-inference-unification-14382.rs | 4 +- tests/ui/typeck/str-no-field-desc-14721.rs | 2 + tests/ui/typeck/str-no-field-desc-14721.stderr | 9 +++ 71 files changed, 447 insertions(+), 436 deletions(-) create mode 100644 tests/ui/cast/array-field-ptr-cast-14845.stderr create mode 100644 tests/ui/cast/trait-object-size-error-14366.stderr create mode 100644 tests/ui/coercion/method-return-trait-object-14399.stderr delete mode 100644 tests/ui/extern/macro-use-extern-std-14330.rs create mode 100644 tests/ui/generics/box-missing-generics-14092.stderr create mode 100644 tests/ui/inference/matcher-lifetime-inference-14919.rs delete mode 100644 tests/ui/issues/issue-13482-2.stderr delete mode 100644 tests/ui/issues/issue-13482.stderr delete mode 100644 tests/ui/issues/issue-13497-2.stderr delete mode 100644 tests/ui/issues/issue-13497.stderr delete mode 100644 tests/ui/issues/issue-13847.stderr delete mode 100644 tests/ui/issues/issue-14091-2.stderr delete mode 100644 tests/ui/issues/issue-14091.stderr delete mode 100644 tests/ui/issues/issue-14092.stderr delete mode 100644 tests/ui/issues/issue-14285.stderr delete mode 100644 tests/ui/issues/issue-14366.stderr delete mode 100644 tests/ui/issues/issue-14399.stderr delete mode 100644 tests/ui/issues/issue-14541.stderr delete mode 100644 tests/ui/issues/issue-14721.stderr delete mode 100644 tests/ui/issues/issue-14845.stderr delete mode 100644 tests/ui/issues/issue-14853.stderr delete mode 100644 tests/ui/issues/issue-14915.stderr create mode 100644 tests/ui/lifetimes/explicit-lifetime-required-14285.stderr create mode 100644 tests/ui/lifetimes/missing-lifetime-specifier-13497.stderr create mode 100644 tests/ui/lifetimes/reader-wrapper-trait-14901.rs delete mode 100644 tests/ui/lifetimes/return-reference-local-variable-13497-2.rs create mode 100644 tests/ui/lifetimes/return-reference-local-variable-13497.rs create mode 100644 tests/ui/lifetimes/return-reference-local-variable-13497.stderr delete mode 100644 tests/ui/macros/assert-mismatched-types-14091.rs delete mode 100644 tests/ui/macros/assert-unary-operator-14091-2.rs delete mode 100644 tests/ui/modules/use-shadowing-14082.rs create mode 100644 tests/ui/never_type/field-access-never-type-13847.stderr create mode 100644 tests/ui/operator-recovery/box-arithmetic-14915.stderr create mode 100644 tests/ui/pattern/array-length-mismatch-13482.stderr delete mode 100644 tests/ui/pattern/array-length-mismatch-verbose-13482-2.rs create mode 100644 tests/ui/pattern/array-length-mismatch-verbose-13482.rs create mode 100644 tests/ui/pattern/array-length-mismatch-verbose-13482.stderr create mode 100644 tests/ui/pattern/struct-mismatch-destructure-14541.stderr create mode 100644 tests/ui/resolve/pointer-type-impls-14254.rs create mode 100644 tests/ui/resolve/use-shadowing-14082.rs delete mode 100644 tests/ui/traits/matcher-lifetime-inference-14919.rs delete mode 100644 tests/ui/traits/pointer-type-impls-14254.rs delete mode 100644 tests/ui/traits/reader-wrapper-trait-14901.rs create mode 100644 tests/ui/traits/trait-bound-mismatch-14853.stderr create mode 100644 tests/ui/typeck/str-no-field-desc-14721.stderr diff --git a/tests/ui/cast/array-field-ptr-cast-14845.rs b/tests/ui/cast/array-field-ptr-cast-14845.rs index d9b20e1f688..9d2da0c8932 100644 --- a/tests/ui/cast/array-field-ptr-cast-14845.rs +++ b/tests/ui/cast/array-field-ptr-cast-14845.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/14845 + struct X { a: [u8; 1] } diff --git a/tests/ui/cast/array-field-ptr-cast-14845.stderr b/tests/ui/cast/array-field-ptr-cast-14845.stderr new file mode 100644 index 00000000000..4edde443fc3 --- /dev/null +++ b/tests/ui/cast/array-field-ptr-cast-14845.stderr @@ -0,0 +1,15 @@ +error[E0606]: casting `&[u8; 1]` as `*mut u8` is invalid + --> $DIR/array-field-ptr-cast-14845.rs:9:14 + | +LL | let _f = &x.a as *mut u8; + | ^^^^^^^^^^^^^^^ + +error[E0606]: casting `&[u8; 1]` as `*mut u8` is invalid + --> $DIR/array-field-ptr-cast-14845.rs:12:14 + | +LL | let _v = &local as *mut u8; + | ^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0606`. diff --git a/tests/ui/cast/trait-object-size-error-14366.rs b/tests/ui/cast/trait-object-size-error-14366.rs index bb338860d8b..2b66df04600 100644 --- a/tests/ui/cast/trait-object-size-error-14366.rs +++ b/tests/ui/cast/trait-object-size-error-14366.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/14366 + fn main() { let _x = "test" as &dyn (::std::any::Any); //~^ ERROR the size for values of type diff --git a/tests/ui/cast/trait-object-size-error-14366.stderr b/tests/ui/cast/trait-object-size-error-14366.stderr new file mode 100644 index 00000000000..2451584e951 --- /dev/null +++ b/tests/ui/cast/trait-object-size-error-14366.stderr @@ -0,0 +1,16 @@ +error[E0277]: the size for values of type `str` cannot be known at compilation time + --> $DIR/trait-object-size-error-14366.rs:4:14 + | +LL | let _x = "test" as &dyn (::std::any::Any); + | ^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `str` + = note: required for the cast from `&'static str` to `&(dyn Any + 'static)` +help: consider borrowing the value, since `&&'static str` can be coerced into `&(dyn Any + 'static)` + | +LL | let _x = &"test" as &dyn (::std::any::Any); + | + + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/closures/boxed-closure-lifetime-13808.rs b/tests/ui/closures/boxed-closure-lifetime-13808.rs index d2961b35f2e..e8324796b5f 100644 --- a/tests/ui/closures/boxed-closure-lifetime-13808.rs +++ b/tests/ui/closures/boxed-closure-lifetime-13808.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/13808 + //@ run-pass #![allow(dead_code)] #![allow(unused_variables)] diff --git a/tests/ui/coercion/method-return-trait-object-14399.rs b/tests/ui/coercion/method-return-trait-object-14399.rs index a539e270fb0..49eee152d88 100644 --- a/tests/ui/coercion/method-return-trait-object-14399.rs +++ b/tests/ui/coercion/method-return-trait-object-14399.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/14399 + //@ run-pass // #14399 // We'd previously ICE if we had a method call whose return diff --git a/tests/ui/coercion/method-return-trait-object-14399.stderr b/tests/ui/coercion/method-return-trait-object-14399.stderr new file mode 100644 index 00000000000..1aa87f53ff8 --- /dev/null +++ b/tests/ui/coercion/method-return-trait-object-14399.stderr @@ -0,0 +1,12 @@ +warning: method `foo` is never used + --> $DIR/method-return-trait-object-14399.rs:13:14 + | +LL | trait A { fn foo(&self) {} } + | - ^^^ + | | + | method in this trait + | + = note: `#[warn(dead_code)]` on by default + +warning: 1 warning emitted + diff --git a/tests/ui/consts/module-const-array-size-13763.rs b/tests/ui/consts/module-const-array-size-13763.rs index 67b9bdc5f03..b1c6879ffd2 100644 --- a/tests/ui/consts/module-const-array-size-13763.rs +++ b/tests/ui/consts/module-const-array-size-13763.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/13763 + //@ run-pass #![allow(dead_code)] diff --git a/tests/ui/drop/panic-during-drop-14875.rs b/tests/ui/drop/panic-during-drop-14875.rs index e330c64a335..5a6f8f42775 100644 --- a/tests/ui/drop/panic-during-drop-14875.rs +++ b/tests/ui/drop/panic-during-drop-14875.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/14875 + //@ run-pass //@ needs-unwind //@ ignore-backends: gcc diff --git a/tests/ui/extern/macro-use-extern-std-14330.rs b/tests/ui/extern/macro-use-extern-std-14330.rs deleted file mode 100644 index 11199db5901..00000000000 --- a/tests/ui/extern/macro-use-extern-std-14330.rs +++ /dev/null @@ -1,6 +0,0 @@ -//@ check-pass -#![allow(unused_imports)] - -#[macro_use] extern crate std as std2; - -fn main() {} diff --git a/tests/ui/fn_traits/closure-trait-impl-14959.rs b/tests/ui/fn_traits/closure-trait-impl-14959.rs index 57af1207ff9..94d43055e64 100644 --- a/tests/ui/fn_traits/closure-trait-impl-14959.rs +++ b/tests/ui/fn_traits/closure-trait-impl-14959.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/14959 + //@ check-pass #![feature(fn_traits, unboxed_closures)] diff --git a/tests/ui/generics/box-missing-generics-14092.rs b/tests/ui/generics/box-missing-generics-14092.rs index 67c2a42eafb..3570d5f675f 100644 --- a/tests/ui/generics/box-missing-generics-14092.rs +++ b/tests/ui/generics/box-missing-generics-14092.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/14092 + fn fn1(0: Box) {} //~^ ERROR missing generics for struct `Box` diff --git a/tests/ui/generics/box-missing-generics-14092.stderr b/tests/ui/generics/box-missing-generics-14092.stderr new file mode 100644 index 00000000000..0822d781ac7 --- /dev/null +++ b/tests/ui/generics/box-missing-generics-14092.stderr @@ -0,0 +1,14 @@ +error[E0107]: missing generics for struct `Box` + --> $DIR/box-missing-generics-14092.rs:3:11 + | +LL | fn fn1(0: Box) {} + | ^^^ expected at least 1 generic argument + | +help: add missing generic argument + | +LL | fn fn1(0: Box) {} + | +++ + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0107`. diff --git a/tests/ui/inference/matcher-lifetime-inference-14919.rs b/tests/ui/inference/matcher-lifetime-inference-14919.rs new file mode 100644 index 00000000000..742d43f3efe --- /dev/null +++ b/tests/ui/inference/matcher-lifetime-inference-14919.rs @@ -0,0 +1,56 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/14919 + +//@ run-pass +#![allow(unused_must_use)] +#![allow(dead_code)] + +trait Matcher { + fn next_match(&mut self) -> Option<(usize, usize)>; +} + +struct CharPredMatcher<'a, 'b> { + str: &'a str, + pred: Box bool + 'b>, +} + +impl<'a, 'b> Matcher for CharPredMatcher<'a, 'b> { + fn next_match(&mut self) -> Option<(usize, usize)> { + None + } +} + +trait IntoMatcher<'a, T> { + fn into_matcher(self, _: &'a str) -> T; +} + +impl<'a, 'b, F> IntoMatcher<'a, CharPredMatcher<'a, 'b>> for F where F: FnMut(char) -> bool + 'b { + fn into_matcher(self, s: &'a str) -> CharPredMatcher<'a, 'b> { + CharPredMatcher { + str: s, + pred: Box::new(self), + } + } +} + +struct MatchIndices { + matcher: M +} + +impl Iterator for MatchIndices { + type Item = (usize, usize); + + fn next(&mut self) -> Option<(usize, usize)> { + self.matcher.next_match() + } +} + +fn match_indices<'a, M, T: IntoMatcher<'a, M>>(s: &'a str, from: T) -> MatchIndices { + let string_matcher = from.into_matcher(s); + MatchIndices { matcher: string_matcher } +} + +fn main() { + let s = "abcbdef"; + match_indices(s, |c: char| c == 'b') + .collect::>(); +} diff --git a/tests/ui/issues/issue-13482-2.stderr b/tests/ui/issues/issue-13482-2.stderr deleted file mode 100644 index 87a6782a5e6..00000000000 --- a/tests/ui/issues/issue-13482-2.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0527]: pattern requires 0 elements but array has 2 - --> $DIR/issue-13482-2.rs:6:9 - | -LL | [] => None, - | ^^ expected 2 elements - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0527`. diff --git a/tests/ui/issues/issue-13482.stderr b/tests/ui/issues/issue-13482.stderr deleted file mode 100644 index 6226c580811..00000000000 --- a/tests/ui/issues/issue-13482.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0527]: pattern requires 0 elements but array has 2 - --> $DIR/issue-13482.rs:4:5 - | -LL | [] => None, - | ^^ expected 2 elements - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0527`. diff --git a/tests/ui/issues/issue-13497-2.stderr b/tests/ui/issues/issue-13497-2.stderr deleted file mode 100644 index e2ba1150d07..00000000000 --- a/tests/ui/issues/issue-13497-2.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0515]: cannot return value referencing local variable `rawLines` - --> $DIR/issue-13497-2.rs:3:5 - | -LL | rawLines - | ^------- - | | - | _____`rawLines` is borrowed here - | | -LL | | .iter().map(|l| l.trim()).collect() - | |___________________________________________^ returns a value referencing data owned by the current function - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0515`. diff --git a/tests/ui/issues/issue-13497.stderr b/tests/ui/issues/issue-13497.stderr deleted file mode 100644 index ee111f1d262..00000000000 --- a/tests/ui/issues/issue-13497.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error[E0106]: missing lifetime specifier - --> $DIR/issue-13497.rs:2:5 - | -LL | &str - | ^ expected named lifetime parameter - | - = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from -help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static` - | -LL | &'static str - | +++++++ -help: instead, you are more likely to want to return an owned value - | -LL - &str -LL + String - | - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0106`. diff --git a/tests/ui/issues/issue-13847.stderr b/tests/ui/issues/issue-13847.stderr deleted file mode 100644 index 1c1855ce94d..00000000000 --- a/tests/ui/issues/issue-13847.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0609]: no field `is_failure` on type `!` - --> $DIR/issue-13847.rs:2:12 - | -LL | return.is_failure - | ^^^^^^^^^^ unknown field - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0609`. diff --git a/tests/ui/issues/issue-14091-2.stderr b/tests/ui/issues/issue-14091-2.stderr deleted file mode 100644 index d573a0917be..00000000000 --- a/tests/ui/issues/issue-14091-2.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error[E0600]: cannot apply unary operator `!` to type `BytePos` - --> $DIR/issue-14091-2.rs:15:5 - | -LL | assert!(x, x); - | ^^^^^^^^^^^^^ cannot apply unary operator `!` - | -note: an implementation of `Not` might be missing for `BytePos` - --> $DIR/issue-14091-2.rs:6:1 - | -LL | pub struct BytePos(pub u32); - | ^^^^^^^^^^^^^^^^^^ must implement `Not` -note: the trait `Not` must be implemented - --> $SRC_DIR/core/src/ops/bit.rs:LL:COL - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0600`. diff --git a/tests/ui/issues/issue-14091.stderr b/tests/ui/issues/issue-14091.stderr deleted file mode 100644 index 83879583b1f..00000000000 --- a/tests/ui/issues/issue-14091.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/issue-14091.rs:2:5 - | -LL | assert!(1,1); - | ^^^^^^^^^^^^ expected `bool`, found integer - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/issues/issue-14092.stderr b/tests/ui/issues/issue-14092.stderr deleted file mode 100644 index 0de7b902fe0..00000000000 --- a/tests/ui/issues/issue-14092.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0107]: missing generics for struct `Box` - --> $DIR/issue-14092.rs:1:11 - | -LL | fn fn1(0: Box) {} - | ^^^ expected at least 1 generic argument - | -help: add missing generic argument - | -LL | fn fn1(0: Box) {} - | +++ - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0107`. diff --git a/tests/ui/issues/issue-14285.stderr b/tests/ui/issues/issue-14285.stderr deleted file mode 100644 index edd139eecba..00000000000 --- a/tests/ui/issues/issue-14285.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0621]: explicit lifetime required in the type of `a` - --> $DIR/issue-14285.rs:12:5 - | -LL | B(a) - | ^^^^ lifetime `'a` required - | -help: add explicit lifetime `'a` to the type of `a` - | -LL - fn foo<'a>(a: &dyn Foo) -> B<'a> { -LL + fn foo<'a>(a: &'a (dyn Foo + 'a)) -> B<'a> { - | - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0621`. diff --git a/tests/ui/issues/issue-14366.stderr b/tests/ui/issues/issue-14366.stderr deleted file mode 100644 index e7bf555c1b7..00000000000 --- a/tests/ui/issues/issue-14366.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error[E0277]: the size for values of type `str` cannot be known at compilation time - --> $DIR/issue-14366.rs:2:14 - | -LL | let _x = "test" as &dyn (::std::any::Any); - | ^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `str` - = note: required for the cast from `&'static str` to `&(dyn Any + 'static)` -help: consider borrowing the value, since `&&'static str` can be coerced into `&(dyn Any + 'static)` - | -LL | let _x = &"test" as &dyn (::std::any::Any); - | + - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/issues/issue-14399.stderr b/tests/ui/issues/issue-14399.stderr deleted file mode 100644 index 5821c3cc389..00000000000 --- a/tests/ui/issues/issue-14399.stderr +++ /dev/null @@ -1,12 +0,0 @@ -warning: method `foo` is never used - --> $DIR/issue-14399.rs:11:14 - | -LL | trait A { fn foo(&self) {} } - | - ^^^ - | | - | method in this trait - | - = note: `#[warn(dead_code)]` on by default - -warning: 1 warning emitted - diff --git a/tests/ui/issues/issue-14541.stderr b/tests/ui/issues/issue-14541.stderr deleted file mode 100644 index 370e6477901..00000000000 --- a/tests/ui/issues/issue-14541.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/issue-14541.rs:5:9 - | -LL | let Vec3 { y: _, z: _ } = v; - | ^^^^^^^^^^^^^^^^^^^ - this expression has type `Vec2` - | | - | expected `Vec2`, found `Vec3` - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/issues/issue-14721.stderr b/tests/ui/issues/issue-14721.stderr deleted file mode 100644 index c71b0363eef..00000000000 --- a/tests/ui/issues/issue-14721.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0609]: no field `desc` on type `&str` - --> $DIR/issue-14721.rs:3:24 - | -LL | println!("{}", foo.desc); - | ^^^^ unknown field - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0609`. diff --git a/tests/ui/issues/issue-14845.stderr b/tests/ui/issues/issue-14845.stderr deleted file mode 100644 index 2fa9fbaa887..00000000000 --- a/tests/ui/issues/issue-14845.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0606]: casting `&[u8; 1]` as `*mut u8` is invalid - --> $DIR/issue-14845.rs:7:14 - | -LL | let _f = &x.a as *mut u8; - | ^^^^^^^^^^^^^^^ - -error[E0606]: casting `&[u8; 1]` as `*mut u8` is invalid - --> $DIR/issue-14845.rs:10:14 - | -LL | let _v = &local as *mut u8; - | ^^^^^^^^^^^^^^^^^ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0606`. diff --git a/tests/ui/issues/issue-14853.stderr b/tests/ui/issues/issue-14853.stderr deleted file mode 100644 index 25dd1e3374d..00000000000 --- a/tests/ui/issues/issue-14853.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0276]: impl has stricter requirements than trait - --> $DIR/issue-14853.rs:12:15 - | -LL | fn yay(_: Option, thing: &[T]); - | ----------------------------------------------- definition of `yay` from trait -... -LL | fn yay(_:Option, thing: &[T]) { - | ^^^ impl has extra requirement `T: Str` - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0276`. diff --git a/tests/ui/issues/issue-14915.stderr b/tests/ui/issues/issue-14915.stderr deleted file mode 100644 index 3558bd651c6..00000000000 --- a/tests/ui/issues/issue-14915.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error[E0369]: cannot add `{integer}` to `Box` - --> $DIR/issue-14915.rs:4:22 - | -LL | println!("{}", x + 1); - | - ^ - {integer} - | | - | Box - | -note: the foreign item type `Box` doesn't implement `Add<{integer}>` - --> $SRC_DIR/alloc/src/boxed.rs:LL:COL - ::: $SRC_DIR/alloc/src/boxed.rs:LL:COL - | - = note: not implement `Add<{integer}>` - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0369`. diff --git a/tests/ui/lifetimes/explicit-lifetime-required-14285.rs b/tests/ui/lifetimes/explicit-lifetime-required-14285.rs index 2ba9ff71773..3f43dcf8366 100644 --- a/tests/ui/lifetimes/explicit-lifetime-required-14285.rs +++ b/tests/ui/lifetimes/explicit-lifetime-required-14285.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/14285 + trait Foo { fn dummy(&self) { } } diff --git a/tests/ui/lifetimes/explicit-lifetime-required-14285.stderr b/tests/ui/lifetimes/explicit-lifetime-required-14285.stderr new file mode 100644 index 00000000000..576de45f94f --- /dev/null +++ b/tests/ui/lifetimes/explicit-lifetime-required-14285.stderr @@ -0,0 +1,15 @@ +error[E0621]: explicit lifetime required in the type of `a` + --> $DIR/explicit-lifetime-required-14285.rs:14:5 + | +LL | B(a) + | ^^^^ lifetime `'a` required + | +help: add explicit lifetime `'a` to the type of `a` + | +LL - fn foo<'a>(a: &dyn Foo) -> B<'a> { +LL + fn foo<'a>(a: &'a (dyn Foo + 'a)) -> B<'a> { + | + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0621`. diff --git a/tests/ui/lifetimes/lifetime-bound-whitespace-13703.rs b/tests/ui/lifetimes/lifetime-bound-whitespace-13703.rs index b385e6b9d2e..79b85e4c132 100644 --- a/tests/ui/lifetimes/lifetime-bound-whitespace-13703.rs +++ b/tests/ui/lifetimes/lifetime-bound-whitespace-13703.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/13703 + //@ check-pass pub struct Foo<'a, 'b: 'a> { foo: &'a &'b isize } diff --git a/tests/ui/lifetimes/missing-lifetime-specifier-13497.rs b/tests/ui/lifetimes/missing-lifetime-specifier-13497.rs index 4b2795aa841..6f4ef0b5620 100644 --- a/tests/ui/lifetimes/missing-lifetime-specifier-13497.rs +++ b/tests/ui/lifetimes/missing-lifetime-specifier-13497.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/13497 + fn read_lines_borrowed1() -> Vec< &str //~ ERROR missing lifetime specifier > { diff --git a/tests/ui/lifetimes/missing-lifetime-specifier-13497.stderr b/tests/ui/lifetimes/missing-lifetime-specifier-13497.stderr new file mode 100644 index 00000000000..99f4fa04f12 --- /dev/null +++ b/tests/ui/lifetimes/missing-lifetime-specifier-13497.stderr @@ -0,0 +1,20 @@ +error[E0106]: missing lifetime specifier + --> $DIR/missing-lifetime-specifier-13497.rs:4:5 + | +LL | &str + | ^ expected named lifetime parameter + | + = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from +help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static` + | +LL | &'static str + | +++++++ +help: instead, you are more likely to want to return an owned value + | +LL - &str +LL + String + | + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0106`. diff --git a/tests/ui/lifetimes/reader-wrapper-trait-14901.rs b/tests/ui/lifetimes/reader-wrapper-trait-14901.rs new file mode 100644 index 00000000000..672872af03a --- /dev/null +++ b/tests/ui/lifetimes/reader-wrapper-trait-14901.rs @@ -0,0 +1,20 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/14901 + +//@ check-pass +pub trait Reader {} + +enum Wrapper<'a> { + WrapReader(&'a (dyn Reader + 'a)) +} + +trait Wrap<'a> { + fn wrap(self) -> Wrapper<'a>; +} + +impl<'a, R: Reader> Wrap<'a> for &'a mut R { + fn wrap(self) -> Wrapper<'a> { + Wrapper::WrapReader(self as &'a mut dyn Reader) + } +} + +pub fn main() {} diff --git a/tests/ui/lifetimes/ref-pattern-lifetime-annotation-13665.rs b/tests/ui/lifetimes/ref-pattern-lifetime-annotation-13665.rs index e1d8be16f45..bae2f73baa3 100644 --- a/tests/ui/lifetimes/ref-pattern-lifetime-annotation-13665.rs +++ b/tests/ui/lifetimes/ref-pattern-lifetime-annotation-13665.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/13665 + //@ run-pass fn foo<'r>() { diff --git a/tests/ui/lifetimes/return-reference-local-variable-13497-2.rs b/tests/ui/lifetimes/return-reference-local-variable-13497-2.rs deleted file mode 100644 index c82da0f0096..00000000000 --- a/tests/ui/lifetimes/return-reference-local-variable-13497-2.rs +++ /dev/null @@ -1,7 +0,0 @@ -fn read_lines_borrowed<'a>() -> Vec<&'a str> { - let rawLines: Vec = vec!["foo ".to_string(), " bar".to_string()]; - rawLines //~ ERROR cannot return value referencing local variable `rawLines` - .iter().map(|l| l.trim()).collect() -} - -fn main() {} diff --git a/tests/ui/lifetimes/return-reference-local-variable-13497.rs b/tests/ui/lifetimes/return-reference-local-variable-13497.rs new file mode 100644 index 00000000000..1ca8074164b --- /dev/null +++ b/tests/ui/lifetimes/return-reference-local-variable-13497.rs @@ -0,0 +1,11 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/13497 + +fn read_lines_borrowed<'a>() -> Vec<&'a str> { + let rawLines: Vec = vec!["foo ".to_string(), " bar".to_string()]; + rawLines //~ ERROR cannot return value referencing local variable `rawLines` + .iter() + .map(|l| l.trim()) + .collect() +} + +fn main() {} diff --git a/tests/ui/lifetimes/return-reference-local-variable-13497.stderr b/tests/ui/lifetimes/return-reference-local-variable-13497.stderr new file mode 100644 index 00000000000..f5419f114ca --- /dev/null +++ b/tests/ui/lifetimes/return-reference-local-variable-13497.stderr @@ -0,0 +1,16 @@ +error[E0515]: cannot return value referencing local variable `rawLines` + --> $DIR/return-reference-local-variable-13497.rs:5:5 + | +LL | rawLines + | ^------- + | | + | _____`rawLines` is borrowed here + | | +LL | | .iter() +LL | | .map(|l| l.trim()) +LL | | .collect() + | |__________________^ returns a value referencing data owned by the current function + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0515`. diff --git a/tests/ui/lifetimes/trait-object-constructor-14821.rs b/tests/ui/lifetimes/trait-object-constructor-14821.rs index b11a885b3a0..76f0c7514bc 100644 --- a/tests/ui/lifetimes/trait-object-constructor-14821.rs +++ b/tests/ui/lifetimes/trait-object-constructor-14821.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/14821 + //@ run-pass #![allow(dead_code)] #![allow(unused_variables)] diff --git a/tests/ui/macros/assert-mismatched-types-14091.rs b/tests/ui/macros/assert-mismatched-types-14091.rs deleted file mode 100644 index 0ee20de9053..00000000000 --- a/tests/ui/macros/assert-mismatched-types-14091.rs +++ /dev/null @@ -1,4 +0,0 @@ -fn main(){ - assert!(1,1); - //~^ ERROR mismatched types -} diff --git a/tests/ui/macros/assert-unary-operator-14091-2.rs b/tests/ui/macros/assert-unary-operator-14091-2.rs deleted file mode 100644 index e2f6b183372..00000000000 --- a/tests/ui/macros/assert-unary-operator-14091-2.rs +++ /dev/null @@ -1,17 +0,0 @@ -// - -// Very - -// sensitive -pub struct BytePos(pub u32); - -// to particular - -// line numberings / offsets - -fn main() { - let x = BytePos(1); - - assert!(x, x); - //~^ ERROR cannot apply unary operator `!` to type `BytePos` -} diff --git a/tests/ui/match/guard-pattern-ordering-14865.rs b/tests/ui/match/guard-pattern-ordering-14865.rs index e0f8bfe9428..a789599c566 100644 --- a/tests/ui/match/guard-pattern-ordering-14865.rs +++ b/tests/ui/match/guard-pattern-ordering-14865.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/14865 + //@ run-pass #![allow(dead_code)] diff --git a/tests/ui/match/multiple-refutable-patterns-13867.rs b/tests/ui/match/multiple-refutable-patterns-13867.rs index ad7d6d66393..a308219a9b2 100644 --- a/tests/ui/match/multiple-refutable-patterns-13867.rs +++ b/tests/ui/match/multiple-refutable-patterns-13867.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/13867 + //@ run-pass // Test that codegen works correctly when there are multiple refutable // patterns in match expression. diff --git a/tests/ui/match/tuple-usize-pattern-14393.rs b/tests/ui/match/tuple-usize-pattern-14393.rs index 69c3fc15d31..12d58d4c059 100644 --- a/tests/ui/match/tuple-usize-pattern-14393.rs +++ b/tests/ui/match/tuple-usize-pattern-14393.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/14393 + //@ run-pass fn main() { diff --git a/tests/ui/modules/use-shadowing-14082.rs b/tests/ui/modules/use-shadowing-14082.rs deleted file mode 100644 index 16556e1d260..00000000000 --- a/tests/ui/modules/use-shadowing-14082.rs +++ /dev/null @@ -1,19 +0,0 @@ -//@ check-pass - -#![allow(unused_imports, dead_code)] - -use foo::Foo; - -mod foo { - pub use m::Foo; // this should shadow d::Foo -} - -mod m { - pub struct Foo; -} - -mod d { - pub struct Foo; -} - -fn main() {} diff --git a/tests/ui/never_type/field-access-never-type-13847.rs b/tests/ui/never_type/field-access-never-type-13847.rs index 06a0304ae49..ff2a1c67b8c 100644 --- a/tests/ui/never_type/field-access-never-type-13847.rs +++ b/tests/ui/never_type/field-access-never-type-13847.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/13847 + fn main() { return.is_failure //~ ERROR no field `is_failure` on type `!` } diff --git a/tests/ui/never_type/field-access-never-type-13847.stderr b/tests/ui/never_type/field-access-never-type-13847.stderr new file mode 100644 index 00000000000..1db6b310f0a --- /dev/null +++ b/tests/ui/never_type/field-access-never-type-13847.stderr @@ -0,0 +1,9 @@ +error[E0609]: no field `is_failure` on type `!` + --> $DIR/field-access-never-type-13847.rs:4:12 + | +LL | return.is_failure + | ^^^^^^^^^^ unknown field + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0609`. diff --git a/tests/ui/operator-recovery/box-arithmetic-14915.rs b/tests/ui/operator-recovery/box-arithmetic-14915.rs index 127b909dd63..0e6f0762998 100644 --- a/tests/ui/operator-recovery/box-arithmetic-14915.rs +++ b/tests/ui/operator-recovery/box-arithmetic-14915.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/14915 + fn main() { let x: Box = Box::new(0); diff --git a/tests/ui/operator-recovery/box-arithmetic-14915.stderr b/tests/ui/operator-recovery/box-arithmetic-14915.stderr new file mode 100644 index 00000000000..1dd80472bb8 --- /dev/null +++ b/tests/ui/operator-recovery/box-arithmetic-14915.stderr @@ -0,0 +1,17 @@ +error[E0369]: cannot add `{integer}` to `Box` + --> $DIR/box-arithmetic-14915.rs:6:22 + | +LL | println!("{}", x + 1); + | - ^ - {integer} + | | + | Box + | +note: the foreign item type `Box` doesn't implement `Add<{integer}>` + --> $SRC_DIR/alloc/src/boxed.rs:LL:COL + ::: $SRC_DIR/alloc/src/boxed.rs:LL:COL + | + = note: not implement `Add<{integer}>` + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0369`. diff --git a/tests/ui/pattern/array-length-mismatch-13482.rs b/tests/ui/pattern/array-length-mismatch-13482.rs index 244b3237e02..78d024e5227 100644 --- a/tests/ui/pattern/array-length-mismatch-13482.rs +++ b/tests/ui/pattern/array-length-mismatch-13482.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/13482 + fn main() { let x = [1,2]; let y = match x { diff --git a/tests/ui/pattern/array-length-mismatch-13482.stderr b/tests/ui/pattern/array-length-mismatch-13482.stderr new file mode 100644 index 00000000000..d366e010927 --- /dev/null +++ b/tests/ui/pattern/array-length-mismatch-13482.stderr @@ -0,0 +1,9 @@ +error[E0527]: pattern requires 0 elements but array has 2 + --> $DIR/array-length-mismatch-13482.rs:6:5 + | +LL | [] => None, + | ^^ expected 2 elements + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0527`. diff --git a/tests/ui/pattern/array-length-mismatch-verbose-13482-2.rs b/tests/ui/pattern/array-length-mismatch-verbose-13482-2.rs deleted file mode 100644 index 619e9d748ef..00000000000 --- a/tests/ui/pattern/array-length-mismatch-verbose-13482-2.rs +++ /dev/null @@ -1,9 +0,0 @@ -//@ compile-flags:-Z verbose-internals - -fn main() { - let x = [1,2]; - let y = match x { - [] => None, //~ ERROR pattern requires 0 elements but array has 2 - [a,_] => Some(a) - }; -} diff --git a/tests/ui/pattern/array-length-mismatch-verbose-13482.rs b/tests/ui/pattern/array-length-mismatch-verbose-13482.rs new file mode 100644 index 00000000000..619e9d748ef --- /dev/null +++ b/tests/ui/pattern/array-length-mismatch-verbose-13482.rs @@ -0,0 +1,9 @@ +//@ compile-flags:-Z verbose-internals + +fn main() { + let x = [1,2]; + let y = match x { + [] => None, //~ ERROR pattern requires 0 elements but array has 2 + [a,_] => Some(a) + }; +} diff --git a/tests/ui/pattern/array-length-mismatch-verbose-13482.stderr b/tests/ui/pattern/array-length-mismatch-verbose-13482.stderr new file mode 100644 index 00000000000..5b533b30afa --- /dev/null +++ b/tests/ui/pattern/array-length-mismatch-verbose-13482.stderr @@ -0,0 +1,9 @@ +error[E0527]: pattern requires 0 elements but array has 2 + --> $DIR/array-length-mismatch-verbose-13482.rs:6:9 + | +LL | [] => None, + | ^^ expected 2 elements + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0527`. diff --git a/tests/ui/pattern/struct-mismatch-destructure-14541.rs b/tests/ui/pattern/struct-mismatch-destructure-14541.rs index 358d29419f9..04e85237cab 100644 --- a/tests/ui/pattern/struct-mismatch-destructure-14541.rs +++ b/tests/ui/pattern/struct-mismatch-destructure-14541.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/14541 + struct Vec2 { y: f32 } struct Vec3 { y: f32, z: f32 } diff --git a/tests/ui/pattern/struct-mismatch-destructure-14541.stderr b/tests/ui/pattern/struct-mismatch-destructure-14541.stderr new file mode 100644 index 00000000000..024d77df2cb --- /dev/null +++ b/tests/ui/pattern/struct-mismatch-destructure-14541.stderr @@ -0,0 +1,11 @@ +error[E0308]: mismatched types + --> $DIR/struct-mismatch-destructure-14541.rs:7:9 + | +LL | let Vec3 { y: _, z: _ } = v; + | ^^^^^^^^^^^^^^^^^^^ - this expression has type `Vec2` + | | + | expected `Vec2`, found `Vec3` + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/pattern/struct-wildcard-pattern-14308.rs b/tests/ui/pattern/struct-wildcard-pattern-14308.rs index 724be160d06..c1fdf424b8c 100644 --- a/tests/ui/pattern/struct-wildcard-pattern-14308.rs +++ b/tests/ui/pattern/struct-wildcard-pattern-14308.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/14308 + //@ run-pass struct A(isize); diff --git a/tests/ui/resolve/pointer-type-impls-14254.rs b/tests/ui/resolve/pointer-type-impls-14254.rs new file mode 100644 index 00000000000..ea8fb6aa167 --- /dev/null +++ b/tests/ui/resolve/pointer-type-impls-14254.rs @@ -0,0 +1,94 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/14254 + +//@ check-pass + +trait Foo: Sized { + fn bar(&self); + fn baz(&self) { } + fn bah(_: Option) { } +} + +struct BarTy { + x : isize, + y : f64, +} + +impl BarTy { + fn a() {} + fn b(&self) {} +} + +// If these fail, it's necessary to update rustc_resolve and the cfail tests. +impl Foo for *const BarTy { + fn bar(&self) { + self.baz(); + BarTy::a(); + Foo::bah(None::<*const BarTy>); + } +} + +// If these fail, it's necessary to update rustc_resolve and the cfail tests. +impl<'a> Foo for &'a BarTy { + fn bar(&self) { + self.baz(); + self.x; + self.y; + BarTy::a(); + Foo::bah(None::<&BarTy>); + self.b(); + } +} + +// If these fail, it's necessary to update rustc_resolve and the cfail tests. +impl<'a> Foo for &'a mut BarTy { + fn bar(&self) { + self.baz(); + self.x; + self.y; + BarTy::a(); + Foo::bah(None::<&mut BarTy>); + self.b(); + } +} + +// If these fail, it's necessary to update rustc_resolve and the cfail tests. +impl Foo for Box { + fn bar(&self) { + self.baz(); + Foo::bah(None::>); + } +} + +// If these fail, it's necessary to update rustc_resolve and the cfail tests. +impl Foo for *const isize { + fn bar(&self) { + self.baz(); + Foo::bah(None::<*const isize>); + } +} + +// If these fail, it's necessary to update rustc_resolve and the cfail tests. +impl<'a> Foo for &'a isize { + fn bar(&self) { + self.baz(); + Foo::bah(None::<&isize>); + } +} + +// If these fail, it's necessary to update rustc_resolve and the cfail tests. +impl<'a> Foo for &'a mut isize { + fn bar(&self) { + self.baz(); + Foo::bah(None::<&mut isize>); + } +} + +// If these fail, it's necessary to update rustc_resolve and the cfail tests. +impl Foo for Box { + fn bar(&self) { + self.baz(); + Foo::bah(None::>); + } +} + +fn main() {} diff --git a/tests/ui/resolve/use-shadowing-14082.rs b/tests/ui/resolve/use-shadowing-14082.rs new file mode 100644 index 00000000000..9d7df5ed1c6 --- /dev/null +++ b/tests/ui/resolve/use-shadowing-14082.rs @@ -0,0 +1,21 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/14082 + +//@ check-pass + +#![allow(unused_imports, dead_code)] + +use foo::Foo; + +mod foo { + pub use m::Foo; // this should shadow d::Foo +} + +mod m { + pub struct Foo; +} + +mod d { + pub struct Foo; +} + +fn main() {} diff --git a/tests/ui/trait-bounds/anonymous-parameters-13775.rs b/tests/ui/trait-bounds/anonymous-parameters-13775.rs index 1477dab9e21..297d4b59587 100644 --- a/tests/ui/trait-bounds/anonymous-parameters-13775.rs +++ b/tests/ui/trait-bounds/anonymous-parameters-13775.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/13775 + //@ edition: 2015 //@ check-pass diff --git a/tests/ui/traits/impl-trait-chain-14229.rs b/tests/ui/traits/impl-trait-chain-14229.rs index eb6324da3b6..4a234f3a681 100644 --- a/tests/ui/traits/impl-trait-chain-14229.rs +++ b/tests/ui/traits/impl-trait-chain-14229.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/14229 + //@ run-pass trait Foo: Sized { fn foo(self) {} diff --git a/tests/ui/traits/matcher-lifetime-inference-14919.rs b/tests/ui/traits/matcher-lifetime-inference-14919.rs deleted file mode 100644 index 3a834b13d07..00000000000 --- a/tests/ui/traits/matcher-lifetime-inference-14919.rs +++ /dev/null @@ -1,54 +0,0 @@ -//@ run-pass -#![allow(unused_must_use)] -#![allow(dead_code)] - -trait Matcher { - fn next_match(&mut self) -> Option<(usize, usize)>; -} - -struct CharPredMatcher<'a, 'b> { - str: &'a str, - pred: Box bool + 'b>, -} - -impl<'a, 'b> Matcher for CharPredMatcher<'a, 'b> { - fn next_match(&mut self) -> Option<(usize, usize)> { - None - } -} - -trait IntoMatcher<'a, T> { - fn into_matcher(self, _: &'a str) -> T; -} - -impl<'a, 'b, F> IntoMatcher<'a, CharPredMatcher<'a, 'b>> for F where F: FnMut(char) -> bool + 'b { - fn into_matcher(self, s: &'a str) -> CharPredMatcher<'a, 'b> { - CharPredMatcher { - str: s, - pred: Box::new(self), - } - } -} - -struct MatchIndices { - matcher: M -} - -impl Iterator for MatchIndices { - type Item = (usize, usize); - - fn next(&mut self) -> Option<(usize, usize)> { - self.matcher.next_match() - } -} - -fn match_indices<'a, M, T: IntoMatcher<'a, M>>(s: &'a str, from: T) -> MatchIndices { - let string_matcher = from.into_matcher(s); - MatchIndices { matcher: string_matcher } -} - -fn main() { - let s = "abcbdef"; - match_indices(s, |c: char| c == 'b') - .collect::>(); -} diff --git a/tests/ui/traits/pointer-type-impls-14254.rs b/tests/ui/traits/pointer-type-impls-14254.rs deleted file mode 100644 index 90ad375c262..00000000000 --- a/tests/ui/traits/pointer-type-impls-14254.rs +++ /dev/null @@ -1,92 +0,0 @@ -//@ check-pass - -trait Foo: Sized { - fn bar(&self); - fn baz(&self) { } - fn bah(_: Option) { } -} - -struct BarTy { - x : isize, - y : f64, -} - -impl BarTy { - fn a() {} - fn b(&self) {} -} - -// If these fail, it's necessary to update rustc_resolve and the cfail tests. -impl Foo for *const BarTy { - fn bar(&self) { - self.baz(); - BarTy::a(); - Foo::bah(None::<*const BarTy>); - } -} - -// If these fail, it's necessary to update rustc_resolve and the cfail tests. -impl<'a> Foo for &'a BarTy { - fn bar(&self) { - self.baz(); - self.x; - self.y; - BarTy::a(); - Foo::bah(None::<&BarTy>); - self.b(); - } -} - -// If these fail, it's necessary to update rustc_resolve and the cfail tests. -impl<'a> Foo for &'a mut BarTy { - fn bar(&self) { - self.baz(); - self.x; - self.y; - BarTy::a(); - Foo::bah(None::<&mut BarTy>); - self.b(); - } -} - -// If these fail, it's necessary to update rustc_resolve and the cfail tests. -impl Foo for Box { - fn bar(&self) { - self.baz(); - Foo::bah(None::>); - } -} - -// If these fail, it's necessary to update rustc_resolve and the cfail tests. -impl Foo for *const isize { - fn bar(&self) { - self.baz(); - Foo::bah(None::<*const isize>); - } -} - -// If these fail, it's necessary to update rustc_resolve and the cfail tests. -impl<'a> Foo for &'a isize { - fn bar(&self) { - self.baz(); - Foo::bah(None::<&isize>); - } -} - -// If these fail, it's necessary to update rustc_resolve and the cfail tests. -impl<'a> Foo for &'a mut isize { - fn bar(&self) { - self.baz(); - Foo::bah(None::<&mut isize>); - } -} - -// If these fail, it's necessary to update rustc_resolve and the cfail tests. -impl Foo for Box { - fn bar(&self) { - self.baz(); - Foo::bah(None::>); - } -} - -fn main() {} diff --git a/tests/ui/traits/reader-wrapper-trait-14901.rs b/tests/ui/traits/reader-wrapper-trait-14901.rs deleted file mode 100644 index ddc12b9ef3c..00000000000 --- a/tests/ui/traits/reader-wrapper-trait-14901.rs +++ /dev/null @@ -1,18 +0,0 @@ -//@ check-pass -pub trait Reader {} - -enum Wrapper<'a> { - WrapReader(&'a (dyn Reader + 'a)) -} - -trait Wrap<'a> { - fn wrap(self) -> Wrapper<'a>; -} - -impl<'a, R: Reader> Wrap<'a> for &'a mut R { - fn wrap(self) -> Wrapper<'a> { - Wrapper::WrapReader(self as &'a mut dyn Reader) - } -} - -pub fn main() {} diff --git a/tests/ui/traits/trait-bound-mismatch-14853.rs b/tests/ui/traits/trait-bound-mismatch-14853.rs index 4ce6e3174d0..3f2a1408a13 100644 --- a/tests/ui/traits/trait-bound-mismatch-14853.rs +++ b/tests/ui/traits/trait-bound-mismatch-14853.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/14853 + use std::fmt::Debug; trait Str {} diff --git a/tests/ui/traits/trait-bound-mismatch-14853.stderr b/tests/ui/traits/trait-bound-mismatch-14853.stderr new file mode 100644 index 00000000000..8ee8f51a135 --- /dev/null +++ b/tests/ui/traits/trait-bound-mismatch-14853.stderr @@ -0,0 +1,12 @@ +error[E0276]: impl has stricter requirements than trait + --> $DIR/trait-bound-mismatch-14853.rs:14:15 + | +LL | fn yay(_: Option, thing: &[T]); + | ----------------------------------------------- definition of `yay` from trait +... +LL | fn yay(_:Option, thing: &[T]) { + | ^^^ impl has extra requirement `T: Str` + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0276`. diff --git a/tests/ui/type-inference/float-type-inference-unification-14382.rs b/tests/ui/type-inference/float-type-inference-unification-14382.rs index 5bf497d2eab..a78dbe9d09c 100644 --- a/tests/ui/type-inference/float-type-inference-unification-14382.rs +++ b/tests/ui/type-inference/float-type-inference-unification-14382.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/14382 + //@ run-pass #[derive(Debug)] struct Matrix4(#[allow(dead_code)] S); @@ -13,5 +15,3 @@ fn main() { let m : Matrix4 = translate(x); println!("m: {:?}", m); } - -// https://github.com/rust-lang/rust/issues/14382 diff --git a/tests/ui/typeck/str-no-field-desc-14721.rs b/tests/ui/typeck/str-no-field-desc-14721.rs index c015a6bab08..605807ac04f 100644 --- a/tests/ui/typeck/str-no-field-desc-14721.rs +++ b/tests/ui/typeck/str-no-field-desc-14721.rs @@ -1,3 +1,5 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/14721 + fn main() { let foo = "str"; println!("{}", foo.desc); //~ ERROR no field `desc` on type `&str` diff --git a/tests/ui/typeck/str-no-field-desc-14721.stderr b/tests/ui/typeck/str-no-field-desc-14721.stderr new file mode 100644 index 00000000000..fc1ec7179d7 --- /dev/null +++ b/tests/ui/typeck/str-no-field-desc-14721.stderr @@ -0,0 +1,9 @@ +error[E0609]: no field `desc` on type `&str` + --> $DIR/str-no-field-desc-14721.rs:5:24 + | +LL | println!("{}", foo.desc); + | ^^^^ unknown field + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0609`. -- cgit 1.4.1-3-g733a5