Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tests/ui/higher-ranked/trait-bounds/future.classic.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
error: the compiler unexpectedly panicked. this is a bug.

query stack during panic:
#0 [evaluate_obligation] evaluating trait selection obligation `for<'a> [async fn body@$DIR/future.rs:32:35: 34:2]: core::future::future::Future`
#1 [codegen_select_candidate] computing candidate for `<strlen as Trait>`
end of query stack
38 changes: 38 additions & 0 deletions tests/ui/higher-ranked/trait-bounds/future.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// ignore-tidy-linelength
// edition:2021
// revisions: classic next
//[next] compile-flags: -Ztrait-solver=next
//[next] check-pass
Copy link
Member

@compiler-errors compiler-errors Jun 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to add something like:

//[classic] known-bug: .....
//[classic] build-fail
//[classic] failure-status: 101
//[classic] normalize-stderr-test "note: .*\n\n" -> ""
//[classic] normalize-stderr-test "thread 'rustc' panicked.*\n" -> ""
//[classic] normalize-stderr-test "(error: internal compiler error: [^:]+):\d+:\d+: " -> "$1:LL:CC: "
//[classic] rustc-env:RUST_BACKTRACE=0

where known_bug: ..... is filled with an issue number.

Also, there is probably a stderr file that's missing from this PR.

//[classic] known-bug: #112347
//[classic] build-fail
//[classic] failure-status: 101
//[classic] normalize-stderr-test "note: .*\n\n" -> ""
//[classic] normalize-stderr-test "thread 'rustc' panicked.*\n" -> ""
//[classic] normalize-stderr-test "(error: internal compiler error: [^:]+):\d+:\d+: " -> "$1:LL:CC: "
//[classic] rustc-env:RUST_BACKTRACE=0

#![feature(unboxed_closures)]

use std::future::Future;

trait Trait {
fn func(&self, _: &str);
}

impl<T> Trait for T
where
for<'a> T: Fn<(&'a str,)> + Send + Sync,
for<'a> <T as FnOnce<(&'a str,)>>::Output: Future<Output = usize> + Send,
{
fn func(&self, _: &str) {
println!("hello!");
}
}

async fn strlen(x: &str) -> usize {
x.len()
}

fn main() {
strlen.func("hi");
}