Skip to content
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

Merged
merged 7 commits into from
Sep 25, 2020
Merged

Conversation

vandenheuvel
Copy link
Contributor

No description provided.

@rust-highfive
Copy link
Collaborator

r? @lcnr

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 24, 2020
@lcnr
Copy link
Contributor

lcnr commented Sep 24, 2020

r? @jackh726

@bors delegate=jackh726

@bors
Copy link
Contributor

bors commented Sep 24, 2020

✌️ @jackh726 can now approve this pull request

@rust-highfive rust-highfive assigned jackh726 and unassigned lcnr Sep 24, 2020
@vandenheuvel vandenheuvel marked this pull request as ready for review September 24, 2020 15:56
@vandenheuvel vandenheuvel changed the title Update chalk to 0.27.0 Update chalk to 0.28.0 Sep 24, 2020
Comment on lines 250 to 257
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(),
Copy link
Member

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.

Copy link
Member

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.

Copy link
Contributor Author

@vandenheuvel vandenheuvel Sep 24, 2020

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)?

Copy link
Member

@jackh726 jackh726 Sep 24, 2020

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),
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you elaborate?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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.

compiler/rustc_traits/src/chalk/db.rs Show resolved Hide resolved
compiler/rustc_traits/src/chalk/db.rs Outdated Show resolved Hide resolved
compiler/rustc_traits/src/chalk/db.rs Outdated Show resolved Hide resolved
Copy link
Member

@jackh726 jackh726 left a 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.

Comment on lines +377 to +382
(&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,
},
Copy link
Member

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).

Copy link
Contributor Author

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.

Comment on lines 250 to 257
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(),
Copy link
Member

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.

@vandenheuvel
Copy link
Contributor Author

@jackh726 if you could check #77152 (comment) I think that this is ready.

@jackh726
Copy link
Member

@bors r+ rollup=never

(just going by what @Mark-Simulacrum did for rollup)

@bors
Copy link
Contributor

bors commented Sep 24, 2020

📌 Commit 51c781f has been approved by jackh726

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 24, 2020
@bors
Copy link
Contributor

bors commented Sep 25, 2020

⌛ Testing commit 51c781f with merge b984ef6...

@bors
Copy link
Contributor

bors commented Sep 25, 2020

☀️ Test successful - checks-actions, checks-azure
Approved by: jackh726
Pushing b984ef6 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 25, 2020
@bors bors merged commit b984ef6 into rust-lang:master Sep 25, 2020
@rustbot rustbot added this to the 1.48.0 milestone Sep 25, 2020
@vandenheuvel vandenheuvel deleted the update_chalk_further branch September 25, 2020 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants