From a63e16cf5bb10a6fd87afe6b6c1f26612ed0f7f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Fri, 25 Mar 2022 19:09:06 +0100 Subject: [PATCH] add 6 ices --- ices/95271.sh | 15 +++++ ices/95303.sh | 21 +++++++ ices/95307.rs | 8 +++ ices/95310.sh | 28 +++++++++ ices/95311.rs | 15 +++++ ices/95327.rs | 156 ++++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 243 insertions(+) create mode 100755 ices/95271.sh create mode 100755 ices/95303.sh create mode 100644 ices/95307.rs create mode 100755 ices/95310.sh create mode 100644 ices/95311.rs create mode 100644 ices/95327.rs diff --git a/ices/95271.sh b/ices/95271.sh new file mode 100755 index 00000000..c5b51052 --- /dev/null +++ b/ices/95271.sh @@ -0,0 +1,15 @@ +rustc --crate-type lib --edition=2021 - 2>&1 << EOF + +enum Foo { + Foo(i32), +} + +fn bar(foo: Foo) { + || { + // `let foo = foo;` makes the ICE disappear + let Foo::Foo(baz) = foo; + }; +} +pub fn main() {} + +EOF diff --git a/ices/95303.sh b/ices/95303.sh new file mode 100755 index 00000000..5233912d --- /dev/null +++ b/ices/95303.sh @@ -0,0 +1,21 @@ +rustc --crate-type lib - 2>&1 << EOF + + +#![feature(no_core)] +#![feature(lang_items)] + +#![no_core] + +#[no_mangle] +pub fn add(a: u32) -> u32 { + a +} + +#[lang = "sized"] +pub trait Sized {} + +#[lang = "copy"] +pub trait Copy {} + + +EOF diff --git a/ices/95307.rs b/ices/95307.rs new file mode 100644 index 00000000..43654fd2 --- /dev/null +++ b/ices/95307.rs @@ -0,0 +1,8 @@ +pub trait C{async fn new(val: T) -> [u8; _]; + as Trait<&'a u32> Collate for () = [0u8; 4]; + use std::mem; + +fn foo() -> usize { + macro ice(){} + +fn main(){} diff --git a/ices/95310.sh b/ices/95310.sh new file mode 100755 index 00000000..9c4ed4ad --- /dev/null +++ b/ices/95310.sh @@ -0,0 +1,28 @@ +rustc --crate-type lib --edition=2021 - 2>&1 << EOF + +#![feature(generators)] +#![feature(generic_associated_types)] +#![feature(type_alias_impl_trait)] + +trait Service { + type Future<'f>: std::future::Future + 'f + where + Self: 'f; + + fn spawn<'f>(&'f mut self) -> Self::Future<'f>; +} + +struct Blah; + +impl Service for Blah { + type Future<'f> = impl std::future::Future + 'f; + + fn spawn<'f>(&'f mut self) -> Self::Future<'f> { + async move { + yield &1; + } + } +} + + +EOF diff --git a/ices/95311.rs b/ices/95311.rs new file mode 100644 index 00000000..eeb71713 --- /dev/null +++ b/ices/95311.rs @@ -0,0 +1,15 @@ +#![feature(ptr_metadata)] + +trait Bar: Sized + 'static { } + +struct Foo { + marker: std::marker::PhantomData, +} + +impl Foo { + fn foo(value: &T) { + std::ptr::metadata(value); + } +} + +pub fn main() {} diff --git a/ices/95327.rs b/ices/95327.rs new file mode 100644 index 00000000..9c43e91d --- /dev/null +++ b/ices/95327.rs @@ -0,0 +1,156 @@ +fn reflow_list_node_with_rule(node: &CompoundNode, rule: &Rule, args: &[Arg], shape: &Shape) +where + T: FOo, + U: Bar, +{ + let mut effects = HashMap::new(); +} + +fn reflow_list_node_with_rule(node: &CompoundNode, rule: &Rule, args: &[Arg], shape: &Shape) +where + T: FOo, +{ + let mut effects = HashMap::new(); +} + +fn reflow_list_node_with_rule( + node: &CompoundNode, + rule: &Rule, + args: &[Arg], + shape: &Shape, + shape: &Shape, +) where + T: FOo, + U: Bar, +{ + let mut effects = HashMap::new(); +} + +fn reflow_list_node_with_rule( + node: &CompoundNode, + rule: &Rule, + args: &[Arg], + shape: &Shape, + shape: &Shape, +) where + T: FOo, +{ + let mut effects = HashMap::new(); +} + +fn reflow_list_node_with_rule( + node: &CompoundNode, + rule: &Rule, + args: &[Arg], + shape: &Shape, +) -> Option +where + T: FOo, + U: Bar, +{ + let mut effects = HashMap::new(); +} + +fn reflow_list_node_with_rule( + node: &CompoundNode, + rule: &Rule, + args: &[Arg], + shape: &Shape, +) -> Option +where + T: FOo, +{ + let mut effects = HashMap::new(); +} + +pub trait Test { + fn very_long_method_name(self, f: F) -> MyVeryLongReturnType + where + F: FnMut(Self::Item) -> bool; + + fn exactly_100_chars1(self, f: F) -> MyVeryLongReturnType + where + F: FnMut(Self::Item) -> bool; +} + +fn very_long_function_name(very_long_argument: F) -> MyVeryLongReturnType +where + F: FnMut(Self::Item) -> bool, +{ +} + +struct VeryLongTupleStructName(LongLongTypename, LongLongTypename, i32, i32) +where + A: LongTrait; + +struct Exactly100CharsToSemicolon(LongLongTypename, i32, i32) +where + A: LongTrait1234; + +struct AlwaysOnNextLine +where + A: LongTrait, +{ + x: i32, +} + +pub trait SomeTrait +where + T: Something + + Sync + + Send + + Display + + Debug + + Copy + + Hash + + Debug + + Display + + Write + + Read + + FromStr, +{ +} + +// #2020 +impl<'a, 'gcx, 'tcx> ProbeContext<'a, 'gcx, 'tcx> { + fn elaborate_bounds(&mut self, bounds: &[ty::PolyTraitRef<'tcx>], mut mk_cand: F) + where + F: for<'b> FnMut( + &mut ProbeContext<'b, 'gcx, 'tcx>, + ty::PolyTraitRef<'tcx>, + ty::AssociatedItem, + ), + { + // ... + } +} + +// #2497 +fn handle_update<'a, Tab, Conn, R, C>( + executor: &Executor>>, + change_set: &'a C, +) -> ExecutionResult +where + &'a C: Identifiable + AsChangeset + HasTable, + <&'a C as AsChangeset>::Changeset: QueryFragment, + Tab: Table + HasTable
, + Tab::PrimaryKey: EqAll<<&'a C as Identifiable>::Id>, + Tab::FromClause: QueryFragment, + Tab: FindDsl<<&'a C as Identifiable>::Id>, + Find::Id>: IntoUpdateTarget
, + ::Id> as IntoUpdateTarget>::WhereClause: + QueryFragment, + Tab::Query: FilterDsl<::Id>>::Output>, + Filter::Id>>::Output>: LimitDsl, + Limit::Id>>::Output>>: + QueryDsl + + BoxedDsl< + 'a, + Conn::Backend, + Output = BoxedSelectStatement<'a, R::SqlType, Tab, Conn::Backend>, + >, + R: LoadingHandler + + GraphQLType, +{ + unimplemented!() +}