-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Don't look for non-type-level assoc consts when checking trait object types #153738
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've manually looked through a bunch of test directories (like |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| // Demonstrate that we don't check the definition site of (eager) type aliases for well-formedness. | ||
| // | ||
| // Listed below are ill-formed type system entities which we don't reject since they appear inside | ||
| // the definition of (eager) type aliases. These type aliases are intentionally not referenced from | ||
| // anywhere to prevent the eagerly expanded / instantiated aliased types from getting wfchecked | ||
| // since that's not what we're testing here. | ||
|
|
||
| //@ check-pass | ||
|
|
||
| type UnsatTraitBound0 = [str]; // `str: Sized` unsatisfied | ||
| type UnsatTraitBound1<T = Vec<str>> = T; // `str: Sized` unsatisfied | ||
| type UnsatOutlivesBound<'a> = &'static &'a (); // `'a: 'static` unsatisfied | ||
|
|
||
| type Diverging = [(); panic!()]; // `panic!()` diverging | ||
|
|
||
| type DynIncompat0 = dyn Sized; // `Sized` axiomatically dyn incompatible | ||
| // issue: <https://github.com/rust-lang/rust/issues/153731> | ||
| type DynIncompat1 = dyn HasAssocConst; // dyn incompatible due to (non-type-level) assoc const | ||
|
|
||
| // * dyn incompatible due to GAT | ||
| // * `'a: 'static`, `String: Copy` and `[u8]: Sized` unsatisfied, `loop {}` diverging | ||
| type Several<'a> = dyn HasGenericAssocType<Type<'a, String, { loop {} }> = [u8]>; | ||
|
|
||
| trait HasAssocConst { const N: usize; } | ||
| trait HasGenericAssocType { type Type<'a: 'static, T: Copy, const N: usize>; } | ||
|
|
||
| fn main() {} |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes in the preexisting tests simply revert some of the changes from PR #150843's first commit (8d524f0).