Skip to content

Do not suggest try_into for base types inside of macro expansions #63612

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Aug 16, 2019

Conversation

estebank
Copy link
Contributor

No description provided.

@rust-highfive
Copy link
Contributor

r? @cramertj

(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 Aug 15, 2019
@estebank
Copy link
Contributor Author

r? @Centril

@rust-highfive rust-highfive assigned Centril and unassigned cramertj Aug 15, 2019
@estebank
Copy link
Contributor Author

Removes the suggestion. Current output:

error[E0308]: mismatched types
 --> src/test/ui/suggestions/dont-suggest-try_into-in-macros.rs:2:5
  |
2 |     assert_eq!(10u64, 10usize); //~ ERROR mismatched types
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u64, found usize
  |
  = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
help: you can convert an `usize` to `u64` and panic if the converted value wouldn't fit
  |
7 |              if ! (* left_val == (* right_val).try_into().unwrap())
  |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

@Centril
Copy link
Contributor

Centril commented Aug 15, 2019

@bors r+

@bors
Copy link
Collaborator

bors commented Aug 15, 2019

📌 Commit fbf1efb has been approved by Centril

@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 Aug 15, 2019
Centril added a commit to Centril/rust that referenced this pull request Aug 15, 2019
…tril

Do not suggest `try_into` for base types inside of macro expansions
Centril added a commit to Centril/rust that referenced this pull request Aug 16, 2019
…tril

Do not suggest `try_into` for base types inside of macro expansions
bors added a commit that referenced this pull request Aug 16, 2019
Rollup of 7 pull requests

Successful merges:

 - #62593 (Group all ABI tests.)
 - #63173 (Use libunwind from llvm-project submodule for musl targets)
 - #63535 (Continue refactoring resolve and hygiene)
 - #63539 (Suggest Rust 2018 on `<expr>.await` with no such field)
 - #63584 (libcore: more cleanups using `#![feature(associated_type_bounds)]`)
 - #63612 (Do not suggest `try_into` for base types inside of macro expansions)
 - #63615 (Fix typo in DoubleEndedIterator::nth_back doc)

Failed merges:

r? @ghost
@bors bors merged commit fbf1efb into rust-lang:master Aug 16, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
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.

5 participants