-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #119420 - cjgillot:issue-119295, r=compiler-errors
Handle ForeignItem as TAIT scope. Fixes #119295
- Loading branch information
Showing
3 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Regression test for issue #119295. | ||
|
||
#![feature(type_alias_impl_trait)] | ||
|
||
type Bar<T> = T; | ||
type S<const A: usize> = [i32; A]; | ||
|
||
extern "C" { | ||
pub fn lint_me( | ||
x: Bar< | ||
S< | ||
{ //~ ERROR mismatched types | ||
type B<Z> = impl Sized; | ||
//~^ ERROR unconstrained opaque type | ||
}, | ||
>, | ||
>, | ||
); | ||
} | ||
|
||
fn main() {} |
20 changes: 20 additions & 0 deletions
20
tests/ui/type-alias-impl-trait/nested-in-anon-const.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
error: unconstrained opaque type | ||
--> $DIR/nested-in-anon-const.rs:13:33 | ||
| | ||
LL | type B<Z> = impl Sized; | ||
| ^^^^^^^^^^ | ||
| | ||
= note: `B` must be used in combination with a concrete type within the same item | ||
|
||
error[E0308]: mismatched types | ||
--> $DIR/nested-in-anon-const.rs:12:17 | ||
| | ||
LL | / { | ||
LL | | type B<Z> = impl Sized; | ||
LL | | | ||
LL | | }, | ||
| |_________________^ expected `usize`, found `()` | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0308`. |