From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- .../ui/const-generics/infer/cannot-infer-const-args.rs | 7 ------- .../const-generics/infer/cannot-infer-const-args.stderr | 14 -------------- src/test/ui/const-generics/infer/issue-77092.rs | 14 -------------- src/test/ui/const-generics/infer/issue-77092.stderr | 14 -------------- src/test/ui/const-generics/infer/method-chain.rs | 16 ---------------- src/test/ui/const-generics/infer/method-chain.stderr | 14 -------------- src/test/ui/const-generics/infer/one-param-uninferred.rs | 11 ----------- .../ui/const-generics/infer/one-param-uninferred.stderr | 14 -------------- src/test/ui/const-generics/infer/uninferred-consts.rs | 11 ----------- .../ui/const-generics/infer/uninferred-consts.stderr | 14 -------------- 10 files changed, 129 deletions(-) delete mode 100644 src/test/ui/const-generics/infer/cannot-infer-const-args.rs delete mode 100644 src/test/ui/const-generics/infer/cannot-infer-const-args.stderr delete mode 100644 src/test/ui/const-generics/infer/issue-77092.rs delete mode 100644 src/test/ui/const-generics/infer/issue-77092.stderr delete mode 100644 src/test/ui/const-generics/infer/method-chain.rs delete mode 100644 src/test/ui/const-generics/infer/method-chain.stderr delete mode 100644 src/test/ui/const-generics/infer/one-param-uninferred.rs delete mode 100644 src/test/ui/const-generics/infer/one-param-uninferred.stderr delete mode 100644 src/test/ui/const-generics/infer/uninferred-consts.rs delete mode 100644 src/test/ui/const-generics/infer/uninferred-consts.stderr (limited to 'src/test/ui/const-generics/infer') diff --git a/src/test/ui/const-generics/infer/cannot-infer-const-args.rs b/src/test/ui/const-generics/infer/cannot-infer-const-args.rs deleted file mode 100644 index f85a72910..000000000 --- a/src/test/ui/const-generics/infer/cannot-infer-const-args.rs +++ /dev/null @@ -1,7 +0,0 @@ -fn foo() -> usize { - 0 -} - -fn main() { - foo(); //~ ERROR type annotations needed -} diff --git a/src/test/ui/const-generics/infer/cannot-infer-const-args.stderr b/src/test/ui/const-generics/infer/cannot-infer-const-args.stderr deleted file mode 100644 index 93e45a88a..000000000 --- a/src/test/ui/const-generics/infer/cannot-infer-const-args.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0282]: type annotations needed - --> $DIR/cannot-infer-const-args.rs:6:5 - | -LL | foo(); - | ^^^ cannot infer the value of the const parameter `X` declared on the function `foo` - | -help: consider specifying the generic argument - | -LL | foo::(); - | +++++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0282`. diff --git a/src/test/ui/const-generics/infer/issue-77092.rs b/src/test/ui/const-generics/infer/issue-77092.rs deleted file mode 100644 index fcf7d3282..000000000 --- a/src/test/ui/const-generics/infer/issue-77092.rs +++ /dev/null @@ -1,14 +0,0 @@ -use std::convert::TryInto; - -fn take_array_from_mut(data: &mut [T], start: usize) -> &mut [T; N] { - (&mut data[start .. start + N]).try_into().unwrap() -} - -fn main() { - let mut arr = [0, 1, 2, 3, 4, 5, 6, 7, 8]; - - for i in 1 .. 4 { - println!("{:?}", take_array_from_mut(&mut arr, i)); - //~^ ERROR type annotations needed - } -} diff --git a/src/test/ui/const-generics/infer/issue-77092.stderr b/src/test/ui/const-generics/infer/issue-77092.stderr deleted file mode 100644 index 1682b26ac..000000000 --- a/src/test/ui/const-generics/infer/issue-77092.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0282]: type annotations needed - --> $DIR/issue-77092.rs:11:26 - | -LL | println!("{:?}", take_array_from_mut(&mut arr, i)); - | ^^^^^^^^^^^^^^^^^^^ cannot infer the value of the const parameter `N` declared on the function `take_array_from_mut` - | -help: consider specifying the generic arguments - | -LL | println!("{:?}", take_array_from_mut::(&mut arr, i)); - | ++++++++++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0282`. diff --git a/src/test/ui/const-generics/infer/method-chain.rs b/src/test/ui/const-generics/infer/method-chain.rs deleted file mode 100644 index 0c5eed489..000000000 --- a/src/test/ui/const-generics/infer/method-chain.rs +++ /dev/null @@ -1,16 +0,0 @@ -struct Foo; - -impl Foo { - fn bar(self) -> Foo { - Foo - } - - fn baz(self) -> Foo { - println!("baz: {}", N); - Foo - } -} - -fn main() { - Foo.bar().bar().bar().bar().baz(); //~ ERROR type annotations needed -} diff --git a/src/test/ui/const-generics/infer/method-chain.stderr b/src/test/ui/const-generics/infer/method-chain.stderr deleted file mode 100644 index ff6da535b..000000000 --- a/src/test/ui/const-generics/infer/method-chain.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0282]: type annotations needed - --> $DIR/method-chain.rs:15:33 - | -LL | Foo.bar().bar().bar().bar().baz(); - | ^^^ cannot infer the value of the const parameter `N` declared on the associated function `baz` - | -help: consider specifying the generic argument - | -LL | Foo.bar().bar().bar().bar().baz::(); - | +++++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0282`. diff --git a/src/test/ui/const-generics/infer/one-param-uninferred.rs b/src/test/ui/const-generics/infer/one-param-uninferred.rs deleted file mode 100644 index d6018650f..000000000 --- a/src/test/ui/const-generics/infer/one-param-uninferred.rs +++ /dev/null @@ -1,11 +0,0 @@ -// Test that we emit an error if we cannot properly infer a constant. -fn foo() -> [u8; N] { - todo!() -} - -fn main() { - // FIXME(const_generics): Currently this only suggests one const parameter, - // but instead it should suggest to provide all parameters. - let _: [u8; 17] = foo(); - //~^ ERROR type annotations needed -} diff --git a/src/test/ui/const-generics/infer/one-param-uninferred.stderr b/src/test/ui/const-generics/infer/one-param-uninferred.stderr deleted file mode 100644 index cf70c2181..000000000 --- a/src/test/ui/const-generics/infer/one-param-uninferred.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0282]: type annotations needed - --> $DIR/one-param-uninferred.rs:9:23 - | -LL | let _: [u8; 17] = foo(); - | ^^^ cannot infer the value of the const parameter `M` declared on the function `foo` - | -help: consider specifying the generic arguments - | -LL | let _: [u8; 17] = foo::<17, M>(); - | +++++++++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0282`. diff --git a/src/test/ui/const-generics/infer/uninferred-consts.rs b/src/test/ui/const-generics/infer/uninferred-consts.rs deleted file mode 100644 index 657f4b513..000000000 --- a/src/test/ui/const-generics/infer/uninferred-consts.rs +++ /dev/null @@ -1,11 +0,0 @@ -// Test that we emit an error if we cannot properly infer a constant. - -// taken from https://github.com/rust-lang/rust/issues/70507#issuecomment-615268893 -struct Foo; -impl Foo { - fn foo(self) {} -} -fn main() { - Foo.foo(); - //~^ ERROR type annotations needed -} diff --git a/src/test/ui/const-generics/infer/uninferred-consts.stderr b/src/test/ui/const-generics/infer/uninferred-consts.stderr deleted file mode 100644 index 3980ecea8..000000000 --- a/src/test/ui/const-generics/infer/uninferred-consts.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0282]: type annotations needed - --> $DIR/uninferred-consts.rs:9:9 - | -LL | Foo.foo(); - | ^^^ cannot infer the value of the const parameter `A` declared on the associated function `foo` - | -help: consider specifying the generic arguments - | -LL | Foo.foo::(); - | ++++++++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0282`. -- cgit v1.2.3