Skip to content

librustc_typeck: use diag item instead of string compare #74471

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

Merged
merged 2 commits into from
Jul 28, 2020

Conversation

da-x
Copy link
Member

@da-x da-x commented Jul 18, 2020

No description provided.

@rust-highfive
Copy link
Contributor

r? @matthewjasper

(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 Jul 18, 2020
@da-x
Copy link
Member Author

da-x commented Jul 18, 2020

r? @eddyb

@rust-highfive rust-highfive assigned eddyb and unassigned matthewjasper Jul 18, 2020
@da-x da-x force-pushed the string-type-diagnostic-item branch from fe1e6f5 to 0c86bbc Compare July 18, 2020 07:10
@da-x da-x force-pushed the string-type-diagnostic-item branch from 0c86bbc to 28e2756 Compare July 18, 2020 09:11
@da-x
Copy link
Member Author

da-x commented Jul 28, 2020

r? @petrochenkov

@rust-highfive rust-highfive assigned petrochenkov and unassigned eddyb Jul 28, 2020
@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Collaborator

bors commented Jul 28, 2020

📌 Commit d077767 has been approved by petrochenkov

@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 Jul 28, 2020
let is_std_string = |ty: Ty<'tcx>| match ty.ty_adt_def() {
Some(ty_def) => Some(ty_def.did) == string_type,
None => false,
};
Copy link
Contributor

Choose a reason for hiding this comment

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

You could also use map_or here though.

ty.ty_adt_def().map_or(false, |adt_def| Some(adt_def.did) == string_type)

@bors
Copy link
Collaborator

bors commented Jul 28, 2020

⌛ Testing commit d077767 with merge 2caf854...

@bors
Copy link
Collaborator

bors commented Jul 28, 2020

☀️ Test successful - checks-actions, checks-azure
Approved by: petrochenkov
Pushing 2caf854 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 28, 2020
@bors bors merged commit 2caf854 into rust-lang:master Jul 28, 2020
@cuviper cuviper added this to the 1.47.0 milestone May 2, 2024
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.

8 participants