-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Update chalk to 0.28.0 #77152
Update chalk to 0.28.0 #77152
Conversation
r? @lcnr (rust_highfive has picked a reviewer for you, use r? to override) |
793f1e8
to
e45ab67
Compare
✌️ @jackh726 can now approve this pull request |
e45ab67
to
fb9de9a
Compare
sig: chalk_ir::FnSig { | ||
abi: sig.abi(), | ||
safety: match sig.unsafety() { | ||
Unsafety::Normal => chalk_ir::Safety::Safe, | ||
Unsafety::Unsafe => chalk_ir::Safety::Unsafe, | ||
}, | ||
variadic: sig.c_variadic(), |
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.
We could add this lowering
impl<'tcx> LowerInto<chalk_ir::FngSig> for ty::FnSig<'tcx>
. Then this wouldn't be duplicated between here and below.
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.
Let me know if you want to do this. I'm fine either way.
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.
I implemented it on ty::Binder<ty::FnSig<'tcx>>
, or should I implement on ty::FnSig<'tcx>
and call sig.skip_binder().lower_into(interner)
?
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.
It's fine as-is. Can always be changed in the future if things get moved around.
@@ -480,6 +482,7 @@ impl<'tcx> LowerInto<'tcx, Ty<'tcx>> for &chalk_ir::Ty<RustInterner<'tcx>> { | |||
substs: application_ty.substitution.lower_into(interner), | |||
item_def_id: assoc_ty.0, | |||
}), | |||
chalk_ir::TypeName::Foreign(def_id) => ty::Foreign(def_id.0), |
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.
Will want to add the other way around too.
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.
Could you elaborate?
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.
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.
I see, I gave that a try.
fb9de9a
to
2238571
Compare
2238571
to
eedf641
Compare
eedf641
to
0f181c5
Compare
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.
This LGTM. r=me with FIXME
added for auto semantics or issue filed somewhere.
(&ty::RawPtr(type_and_mut), Raw(mutability)) => { | ||
match (type_and_mut.mutbl, mutability) { | ||
(ast::Mutability::Mut, chalk_ir::Mutability::Mut) => true, | ||
(ast::Mutability::Mut, chalk_ir::Mutability::Not) => false, | ||
(ast::Mutability::Not, chalk_ir::Mutability::Mut) => false, | ||
(ast::Mutability::Not, chalk_ir::Mutability::Not) => true, | ||
} | ||
} | ||
_ => {} | ||
(&ty::Ref(.., mutability1), Ref(mutability2)) => match (mutability1, mutability2) { | ||
(ast::Mutability::Mut, chalk_ir::Mutability::Mut) => true, | ||
(ast::Mutability::Mut, chalk_ir::Mutability::Not) => false, | ||
(ast::Mutability::Not, chalk_ir::Mutability::Mut) => false, | ||
(ast::Mutability::Not, chalk_ir::Mutability::Not) => true, | ||
}, |
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.
So...this is definitely an underspecified bit of the language right now. Consider the following program.
auto trait Marker {}
struct A;
struct B;
impl !Marker for &A {}
This would mean that (&B): Marker
doesn't hold. Do we want it to? Idk. In std, impls for builtin types are defined for all T
, so this won't be a visible change currently. For that reason, I think it's not worth trying to think about different behavior here.
But, I would like a FIXME
; or, better, an issue filed somewhere (suprisingly, maybe wg-traits repo is the best place) to make sure we better define these semantics (or at least consider it again when it's better defined).
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.
I'll file an issue.
sig: chalk_ir::FnSig { | ||
abi: sig.abi(), | ||
safety: match sig.unsafety() { | ||
Unsafety::Normal => chalk_ir::Safety::Safe, | ||
Unsafety::Unsafe => chalk_ir::Safety::Unsafe, | ||
}, | ||
variadic: sig.c_variadic(), |
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.
Let me know if you want to do this. I'm fine either way.
0f181c5
to
51c781f
Compare
@jackh726 if you could check #77152 (comment) I think that this is ready. |
@bors r+ rollup=never (just going by what @Mark-Simulacrum did for rollup) |
📌 Commit 51c781f has been approved by |
☀️ Test successful - checks-actions, checks-azure |
No description provided.