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 --- .../function-pointer-comparison-issue-54685.rs | 30 ------------ src/test/ui/function-pointer/issue-102289.rs | 54 ---------------------- .../ui/function-pointer/sized-ret-with-binder.rs | 15 ------ src/test/ui/function-pointer/unsized-ret.rs | 15 ------ src/test/ui/function-pointer/unsized-ret.stderr | 35 -------------- 5 files changed, 149 deletions(-) delete mode 100644 src/test/ui/function-pointer/function-pointer-comparison-issue-54685.rs delete mode 100644 src/test/ui/function-pointer/issue-102289.rs delete mode 100644 src/test/ui/function-pointer/sized-ret-with-binder.rs delete mode 100644 src/test/ui/function-pointer/unsized-ret.rs delete mode 100644 src/test/ui/function-pointer/unsized-ret.stderr (limited to 'src/test/ui/function-pointer') diff --git a/src/test/ui/function-pointer/function-pointer-comparison-issue-54685.rs b/src/test/ui/function-pointer/function-pointer-comparison-issue-54685.rs deleted file mode 100644 index 855749c14..000000000 --- a/src/test/ui/function-pointer/function-pointer-comparison-issue-54685.rs +++ /dev/null @@ -1,30 +0,0 @@ -// compile-flags: -C opt-level=3 -// run-pass - -fn foo(_i: i32) -> i32 { - 1 -} -fn bar(_i: i32) -> i32 { - 1 -} - -fn main() { - let x: fn(i32) -> i32 = foo; - let y: fn(i32) -> i32 = bar; - - let s1; - if x == y { - s1 = "same".to_string(); - } else { - s1 = format!("{:?}, {:?}", x, y); - } - - let s2; - if x == y { - s2 = "same".to_string(); - } else { - s2 = format!("{:?}, {:?}", x, y); - } - - assert_eq!(s1, s2); -} diff --git a/src/test/ui/function-pointer/issue-102289.rs b/src/test/ui/function-pointer/issue-102289.rs deleted file mode 100644 index de394ca9a..000000000 --- a/src/test/ui/function-pointer/issue-102289.rs +++ /dev/null @@ -1,54 +0,0 @@ -// check-pass - -pub(crate) trait Parser: Sized { - type Output; - fn parse(&mut self, _input: &str) -> Result<(), ()> { - loop {} - } - fn map(self, _f: F) -> Map - where - F: FnMut(Self::Output) -> B, - { - todo!() - } -} - -pub(crate) struct Chainl1(P, Op); -impl Parser for Chainl1 -where - P: Parser, - Op: Parser, - Op::Output: FnOnce(P::Output, P::Output) -> P::Output, -{ - type Output = P::Output; -} -pub(crate) fn chainl1(_parser: P, _op: Op) -> Chainl1 -where - P: Parser, - Op: Parser, - Op::Output: FnOnce(P::Output, P::Output) -> P::Output, -{ - loop {} -} - -pub(crate) struct Map(P, F); -impl Parser for Map -where - P: Parser, - F: FnMut(A) -> B, -{ - type Output = B; -} - -impl Parser for u32 { - type Output = (); -} - -pub fn chainl1_error_consume() { - fn first(t: T, _: U) -> T { - t - } - let _ = chainl1(1, 1.map(|_| first)).parse(""); -} - -fn main() {} diff --git a/src/test/ui/function-pointer/sized-ret-with-binder.rs b/src/test/ui/function-pointer/sized-ret-with-binder.rs deleted file mode 100644 index 104ac4d22..000000000 --- a/src/test/ui/function-pointer/sized-ret-with-binder.rs +++ /dev/null @@ -1,15 +0,0 @@ -// check-pass - -#![feature(unboxed_closures)] - -fn is_fn Fn<(&'a (),)>>() {} -fn is_fn2 Fn<(&'a &'b (),)>>() {} - -struct Outlives<'a, 'b>(std::marker::PhantomData<&'a &'b ()>); - -fn main() { - is_fn:: fn(&'a ()) -> &'a ()>(); - is_fn:: fn(&'a ()) -> &'a dyn std::fmt::Debug>(); - is_fn2:: fn(&'a &'b ()) -> Outlives<'a, 'b>>(); - is_fn2:: fn(&'a &'b ()) -> (&'a (), &'a ())>(); -} diff --git a/src/test/ui/function-pointer/unsized-ret.rs b/src/test/ui/function-pointer/unsized-ret.rs deleted file mode 100644 index 79009c5cb..000000000 --- a/src/test/ui/function-pointer/unsized-ret.rs +++ /dev/null @@ -1,15 +0,0 @@ -#![feature(fn_traits)] -#![feature(unboxed_closures)] -#![feature(tuple_trait)] - -fn foo, T:std::marker::Tuple>(f: Option, t: T) { - let y = (f.unwrap()).call(t); -} - -fn main() { - foo:: str, _>(None, ()); - //~^ ERROR the size for values of type `str` cannot be known at compilation time - - foo:: fn(&'a ()) -> (dyn std::fmt::Display + 'a), _>(None, (&(),)); - //~^ ERROR the size for values of type `(dyn std::fmt::Display + 'a)` cannot be known at compilation time -} diff --git a/src/test/ui/function-pointer/unsized-ret.stderr b/src/test/ui/function-pointer/unsized-ret.stderr deleted file mode 100644 index 40bf7a389..000000000 --- a/src/test/ui/function-pointer/unsized-ret.stderr +++ /dev/null @@ -1,35 +0,0 @@ -error[E0277]: the size for values of type `str` cannot be known at compilation time - --> $DIR/unsized-ret.rs:10:27 - | -LL | foo:: str, _>(None, ()); - | --------------------- ^^^^ doesn't have a size known at compile-time - | | - | required by a bound introduced by this call - | - = help: within `fn() -> str`, the trait `Sized` is not implemented for `str` - = note: required because it appears within the type `fn() -> str` -note: required by a bound in `foo` - --> $DIR/unsized-ret.rs:5:11 - | -LL | fn foo, T:std::marker::Tuple>(f: Option, t: T) { - | ^^^^^ required by this bound in `foo` - -error[E0277]: the size for values of type `(dyn std::fmt::Display + 'a)` cannot be known at compilation time - --> $DIR/unsized-ret.rs:13:66 - | -LL | foo:: fn(&'a ()) -> (dyn std::fmt::Display + 'a), _>(None, (&(),)); - | ------------------------------------------------------------ ^^^^ doesn't have a size known at compile-time - | | - | required by a bound introduced by this call - | - = help: within `for<'a> fn(&'a ()) -> (dyn std::fmt::Display + 'a)`, the trait `for<'a> Sized` is not implemented for `(dyn std::fmt::Display + 'a)` - = note: required because it appears within the type `for<'a> fn(&'a ()) -> (dyn std::fmt::Display + 'a)` -note: required by a bound in `foo` - --> $DIR/unsized-ret.rs:5:11 - | -LL | fn foo, T:std::marker::Tuple>(f: Option, t: T) { - | ^^^^^ required by this bound in `foo` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0277`. -- cgit v1.2.3