Normalize test output more thoroughly

This prevents differences in local environments, which may (for example)
end up with a longer backtrace with more digits in the backtrace prefix,
as happened to me. While we're at it, clean more of the output up,
including the exact location of the error in the compiler.
This commit is contained in:
Mark Rousskov 2023-01-12 21:28:20 -05:00
parent 61a415be59
commit 95ef76b8aa
2 changed files with 52 additions and 25 deletions

View File

@ -2,12 +2,21 @@
// known-bug
// unset-rustc-env:RUST_BACKTRACE
// compile-flags:-Z trait-solver=chalk --edition=2021
// error-pattern:stack backtrace:
// error-pattern:internal compiler error
// failure-status:101
// normalize-stderr-test "note: .*" -> ""
// normalize-stderr-test "thread 'rustc' .*" -> ""
// normalize-stderr-test " .*\n" -> ""
// normalize-stderr-test "DefId([^)]*)" -> "..."
// normalize-stderr-test "\nerror: internal compiler error.*\n\n" -> ""
// normalize-stderr-test "note:.*unexpectedly panicked.*\n\n" -> ""
// normalize-stderr-test "note: we would appreciate a bug report.*\n\n" -> ""
// normalize-stderr-test "note: compiler flags.*\n\n" -> ""
// normalize-stderr-test "note: rustc.*running on.*\n\n" -> ""
// normalize-stderr-test "thread.*panicked.*\n" -> ""
// normalize-stderr-test "stack backtrace:\n" -> ""
// normalize-stderr-test "\s\d{1,}: .*\n" -> ""
// normalize-stderr-test "\s at .*\n" -> ""
// normalize-stderr-test ".*note: Some details.*\n" -> ""
// normalize-stderr-test "\n\n[ ]*\n" -> ""
// normalize-stderr-test "compiler/.*: projection" -> "projection"
fn main() -> () {}

View File

@ -1,29 +1,47 @@
error[E0277]: `[async fn body@$DIR/async.rs:14:29: 16:2]` is not a future
LL |LL | |LL | | }
error[E0277]: `[async fn body@$DIR/async.rs:23:29: 25:2]` is not a future
--> $DIR/async.rs:23:29
|
LL | async fn foo(x: u32) -> u32 {
| _____________________________-
LL | | x
LL | | }
| | ^
| | |
| |_`[async fn body@$DIR/async.rs:23:29: 25:2]` is not a future
| required by a bound introduced by this call
|
= help: the trait `Future` is not implemented for `[async fn body@$DIR/async.rs:23:29: 25:2]`
= note: [async fn body@$DIR/async.rs:23:29: 25:2] must be a future or must implement `IntoFuture` to be awaited
note: required by a bound in `identity_future`
--> $SRC_DIR/core/src/future/mod.rs:LL:COL
error[E0277]: the size for values of type `<[async fn body@$DIR/async.rs:23:29: 25:2] as Future>::Output` cannot be known at compilation time
--> $DIR/async.rs:23:29
|
LL | async fn foo(x: u32) -> u32 {
| _____________________________^
LL | | x
LL | | }
| |_^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `<[async fn body@$DIR/async.rs:23:29: 25:2] as Future>::Output`
note: required by a bound in `identity_future`
--> $SRC_DIR/core/src/future/mod.rs:LL:COL
error[E0277]: the size for values of type `<[async fn body@$DIR/async.rs:14:29: 16:2] as Future>::Output` cannot be known at compilation time
LL |LL | |LL | | }
error[E0277]: `[async fn body@$DIR/async.rs:14:29: 16:2]` is not a future
error[E0277]: `[async fn body@$DIR/async.rs:23:29: 25:2]` is not a future
--> $DIR/async.rs:23:25
|
LL | async fn foo(x: u32) -> u32 {
| ^^^ `[async fn body@$DIR/async.rs:23:29: 25:2]` is not a future
|
= help: the trait `Future` is not implemented for `[async fn body@$DIR/async.rs:23:29: 25:2]`
= note: [async fn body@$DIR/async.rs:23:29: 25:2] must be a future or must implement `IntoFuture` to be awaited
error: internal compiler error: compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs:1114:25: projection clauses should be implied from elsewhere. obligation: `Obligation(predicate=Binder(ProjectionPredicate(AliasTy { substs: [[async fn body@$DIR/async.rs:14:29: 16:2]], def_id: ...), _use_mk_alias_ty_instead: () }, Term::Ty(u32)), []), depth=0)`
error: internal compiler error: projection clauses should be implied from elsewhere. obligation: `Obligation(predicate=Binder(ProjectionPredicate(AliasTy { substs: [[async fn body@$DIR/async.rs:23:29: 25:2]], def_id: ...), _use_mk_alias_ty_instead: () }, Term::Ty(u32)), []), depth=0)`
--> $DIR/async.rs:23:25
|
LL | async fn foo(x: u32) -> u32 {
stack backtrace:
query stack during panic:
| ^^^query stack during panic:
#0 [typeck] type-checking `foo`
#1 [thir_body] building THIR for `foo`
#2 [mir_built] building MIR for `foo`