-
Notifications
You must be signed in to change notification settings - Fork 13.3k
transmutability: Support char, NonZeroXxx #140215
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
Conversation
a6671a7
to
b4af1e4
Compare
This comment has been minimized.
This comment has been minimized.
b4af1e4
to
5924db8
Compare
This comment has been minimized.
This comment has been minimized.
5924db8
to
1a22b85
Compare
This comment has been minimized.
This comment has been minimized.
1a22b85
to
3df7f06
Compare
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #140168) made this pull request unmergeable. Please resolve the merge conflicts. |
3df7f06
to
b70553b
Compare
@tmiasko Since you've expressed an interest in this, maybe you have a few cycles to poke at a bug that's been stumping me? Running the UI test |
This comment has been minimized.
This comment has been minimized.
@joshlf I recommend doing an |
b70553b
to
fd62d29
Compare
@jswrenn I'll work on that in parallel. In the meantime, this is ready for review (without wiring up |
fd62d29
to
700899a
Compare
This comment has been minimized.
This comment has been minimized.
700899a
to
c11c064
Compare
There is an infinite recursion in |
Self::from_struct((ty, layout), *adt_def, cx) | ||
} | ||
(AdtKind::Struct, Included(1), Included(_hi)) if is_transparent => { | ||
// FIXME: Uncomment the code below and get it |
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.
Do you want to tackle this in this PR, or a follow up?
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.
In a follow-up. I've removed the commented-out code for now.
@@ -268,6 +384,10 @@ pub(crate) mod rustc { | |||
})) | |||
} | |||
|
|||
ty::Char => Ok(Self::char(cx.tcx().data_layout.endian.into())), | |||
|
|||
ty::Alias(_kind, ty) => Self::from_ty(ty.to_ty(cx.tcx()), cx), |
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.
ty::Alias(_kind, ty) => Self::from_ty(ty.to_ty(cx.tcx()), cx), | |
ty::Alias(_kind, ty) => Self::from_ty(/* normalize ty */), |
@tmiasko / @compiler-errors, what's the current way to normalize a type when we do care about regions?
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.
If we're punting on normalization, can you remove this branch so we don't regress projections to an infinite loop?
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.
If we're punting on normalization, can you remove this branch so we don't regress projections to an infinite loop?
Done.
@tmiasko / @compiler-errors, what's the current way to normalize a type when we do care about regions?
Maybe, for the time being (but in a separate PR), we could at least support 'static
types by normalizing without caring about regions and returning an error when the type is non-'static
? That would at least cover the NonZero
case.
c11c064
to
b482af6
Compare
@joshlf Happy for us to punt |
b482af6
to
56df2e4
Compare
Note that `NonZero` support is not wired up, as the author encountered bugs while attempting this. A future commit will wire up `NonZero` support.
56df2e4
to
ae0c2fe
Compare
Done. |
Thanks! I'll follow up with a normalization fix as soon as I unbork my devbox... @bors r+ |
…o, r=jswrenn transmutability: Support char, NonZeroXxx Note that `NonZero` support is not wired up, as the author encountered bugs while attempting this. A future commit will wire up `NonZero` support. r? `@jswrenn`
…o, r=jswrenn transmutability: Support char, NonZeroXxx Note that `NonZero` support is not wired up, as the author encountered bugs while attempting this. A future commit will wire up `NonZero` support. r? ``@jswrenn``
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#123239 (Implement a lint for implicit autoref of raw pointer dereference - take 2) - rust-lang#140215 (transmutability: Support char, NonZeroXxx) - rust-lang#140226 (Update wasm-component-ld to 0.5.13) - rust-lang#140302 (Move inline asm check to typeck, properly handle aliases) - rust-lang#140317 (Remove redundant check) - rust-lang#140318 (Simply try to unpeel AsyncFnKindHelper goal in `emit_specialized_closure_kind_error`) - rust-lang#140325 (Grammar fixes for BufRead::has_data_left docs) r? `@ghost` `@rustbot` modify labels: rollup
…o, r=jswrenn transmutability: Support char, NonZeroXxx Note that `NonZero` support is not wired up, as the author encountered bugs while attempting this. A future commit will wire up `NonZero` support. r? ```@jswrenn```
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#123239 (Implement a lint for implicit autoref of raw pointer dereference - take 2) - rust-lang#140215 (transmutability: Support char, NonZeroXxx) - rust-lang#140226 (Update wasm-component-ld to 0.5.13) - rust-lang#140317 (Remove redundant check) - rust-lang#140318 (Simply try to unpeel AsyncFnKindHelper goal in `emit_specialized_closure_kind_error`) - rust-lang#140325 (Grammar fixes for BufRead::has_data_left docs) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#140215 (transmutability: Support char, NonZeroXxx) - rust-lang#140226 (Update wasm-component-ld to 0.5.13) - rust-lang#140317 (Remove redundant check) - rust-lang#140318 (Simply try to unpeel AsyncFnKindHelper goal in `emit_specialized_closure_kind_error`) - rust-lang#140320 (replace `GenericArg` with `Term` where applicable) - rust-lang#140325 (Grammar fixes for BufRead::has_data_left docs) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#140215 - joshlf:transmutability-char-nonzero, r=jswrenn transmutability: Support char, NonZeroXxx Note that `NonZero` support is not wired up, as the author encountered bugs while attempting this. A future commit will wire up `NonZero` support. r? ````@jswrenn````
Note that
NonZero
support is not wired up, as the author encounteredbugs while attempting this. A future commit will wire up
NonZero
support.
r? @jswrenn