Skip to content

Commit

Permalink
Fix invalid compiletest directives in tests
Browse files Browse the repository at this point in the history
- Fix invalid directive in `normalize-hidden-types`
- Update legacy directive in `two-phase-reservation-sharing-interference`
  • Loading branch information
jieyouxu committed Mar 10, 2024
1 parent 5877e7e commit 64dda8c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// The nll_beyond revision is disabled due to missing support from two-phase beyond autorefs
//@[nll_beyond]compile-flags: -Z two-phase-beyond-autoref
//[nll_beyond]should-fail
//@[nll_beyond]should-fail

// This is a corner case that the current implementation is (probably)
// treating more conservatively than is necessary. But it also does
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@ LL | fn define() -> Opaque {
| ^^^^^^ expected `*const (dyn FnOnce(()) + 'static)`, got `*const dyn for<'a> FnOnce(<u8 as Trait>::Gat<'a>)`
|
note: previous use here
--> $DIR/normalize-hidden-types.rs:27:9
--> $DIR/normalize-hidden-types.rs:26:9
|
LL | dyn_hoops::<_>(0)
| ^^^^^^^^^^^^^^^^^

error: concrete type differs from previous defining opaque type use
--> $DIR/normalize-hidden-types.rs:34:22
--> $DIR/normalize-hidden-types.rs:33:22
|
LL | fn define_1() -> Opaque { dyn_hoops::<_>(0) }
| ^^^^^^ expected `*const (dyn FnOnce(()) + 'static)`, got `*const dyn for<'a> FnOnce(<u8 as Trait>::Gat<'a>)`
|
note: previous use here
--> $DIR/normalize-hidden-types.rs:34:31
--> $DIR/normalize-hidden-types.rs:33:31
|
LL | fn define_1() -> Opaque { dyn_hoops::<_>(0) }
| ^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
--> $DIR/normalize-hidden-types.rs:44:25
--> $DIR/normalize-hidden-types.rs:42:25
|
LL | type Opaque = impl Sized;
| ---------- the expected opaque type
Expand All @@ -39,13 +39,13 @@ LL | let _: Opaque = dyn_hoops::<u8>(0);
= note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html

error: concrete type differs from previous defining opaque type use
--> $DIR/normalize-hidden-types.rs:54:25
--> $DIR/normalize-hidden-types.rs:51:25
|
LL | let _: Opaque = dyn_hoops::<_>(0);
| ^^^^^^^^^^^^^^^^^ expected `*const (dyn FnOnce(()) + 'static)`, got `*const dyn for<'a> FnOnce(<u8 as Trait>::Gat<'a>)`
|
note: previous use here
--> $DIR/normalize-hidden-types.rs:56:9
--> $DIR/normalize-hidden-types.rs:52:9
|
LL | None
| ^^^^
Expand Down
6 changes: 1 addition & 5 deletions tests/ui/type-alias-impl-trait/normalize-hidden-types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//@ revisions: current next
//@ [next] compile-flags: -Znext-solver
//@ [next] check-pass
//@ [current]: known-bug: #112691
//@ [current] known-bug: #112691

#![feature(type_alias_impl_trait)]

Expand All @@ -23,7 +23,6 @@ mod typeof_1 {
use super::*;
type Opaque = impl Sized;
fn define() -> Opaque {
//[current]~^ ERROR concrete type differs
dyn_hoops::<_>(0)
}
}
Expand All @@ -32,7 +31,6 @@ mod typeof_2 {
use super::*;
type Opaque = impl Sized;
fn define_1() -> Opaque { dyn_hoops::<_>(0) }
//[current]~^ ERROR concrete type differs
fn define_2() -> Opaque { dyn_hoops::<u8>(0) }
}

Expand All @@ -42,7 +40,6 @@ mod typeck {
fn define() -> Option<Opaque> {
let _: Opaque = dyn_hoops::<_>(0);
let _: Opaque = dyn_hoops::<u8>(0);
//[current]~^ ERROR mismatched types
None
}
}
Expand All @@ -52,7 +49,6 @@ mod borrowck {
type Opaque = impl Sized;
fn define() -> Option<Opaque> {
let _: Opaque = dyn_hoops::<_>(0);
//[current]~^ ERROR concrete type differs
None
}
}
Expand Down

0 comments on commit 64dda8c

Please sign in to comment.