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

typeck: check for infer before type impls trait #73965

Merged

Conversation

davidtwco
Copy link
Member

Fixes #73886.

This PR checks that the target type of the cast (an error related to which is being reported) does not have types to be inferred before checking if it implements the From trait.

r? @estebank

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 2, 2020
src/test/ui/issues/issue-73886.rs Show resolved Hide resolved
This commit checks that the target type of the cast (an error related
to which is being reported) does not have types to be inferred before
checking if it implements the `From` trait.

Signed-off-by: David Wood <[email protected]>
@davidtwco davidtwco force-pushed the issue-73886-non-primitive-slice-cast branch from 2786525 to bddb266 Compare July 2, 2020 15:24
@davidtwco
Copy link
Member Author

@estebank this is waiting on your review 🙂

@estebank
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Jul 11, 2020

📌 Commit bddb266 has been approved by estebank

@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 11, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Jul 14, 2020
…-slice-cast, r=estebank

typeck: check for infer before type impls trait

Fixes rust-lang#73886.

This PR checks that the target type of the cast (an error related to which is being reported) does not have types to be inferred before checking if it implements the `From` trait.

r? @estebank
Manishearth added a commit to Manishearth/rust that referenced this pull request Jul 14, 2020
…-slice-cast, r=estebank

typeck: check for infer before type impls trait

Fixes rust-lang#73886.

This PR checks that the target type of the cast (an error related to which is being reported) does not have types to be inferred before checking if it implements the `From` trait.

r? @estebank
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 14, 2020
…arth

Rollup of 15 pull requests

Successful merges:

 - rust-lang#71237 (Add Ayu theme to rustdoc)
 - rust-lang#73720 (Clean up E0704 error explanation)
 - rust-lang#73866 (Obviate #[allow(improper_ctypes_definitions)])
 - rust-lang#73965 (typeck: check for infer before type impls trait)
 - rust-lang#73986 (add (unchecked) indexing methods to raw (and NonNull) slices)
 - rust-lang#74173 (Detect tuple struct incorrectly used as struct pat)
 - rust-lang#74220 (Refactor Windows `parse_prefix`)
 - rust-lang#74227 (Remove an unwrap in layout computation)
 - rust-lang#74239 (Update llvm-project to latest origin/rustc/10.0-2020-05-05 commit )
 - rust-lang#74257 (don't mark linux kernel module targets as a unix environment)
 - rust-lang#74270 (typeck: report placeholder type error w/out span)
 - rust-lang#74296 (Clarify the description for rfind)
 - rust-lang#74310 (Use `ArrayVec` in `SparseBitSet`.)
 - rust-lang#74316 (Remove unnecessary type hints from Wake internals)
 - rust-lang#74324 (Update Clippy)

Failed merges:

r? @ghost
@bors bors merged commit 6a4faa2 into rust-lang:master Jul 14, 2020
@davidtwco davidtwco deleted the issue-73886-non-primitive-slice-cast branch July 14, 2020 20:19
@JohnTitor JohnTitor added beta-nominated Nominated for backporting to the compiler in the beta channel. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 2, 2020
@JohnTitor
Copy link
Member

JohnTitor commented Aug 2, 2020

Beta-nominating in favor of #74734 (comment).

@spastorino
Copy link
Member

Discussed in T-compiler meeting.

@rustbot modify labels: beta-accepted

@rustbot rustbot added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Aug 6, 2020
@Mark-Simulacrum Mark-Simulacrum removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Aug 7, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 7, 2020
…ulacrum

[beta] backports

* Forbid non-derefable types explicitly in unsizing casts rust-lang#75136
* forbid `#[track_caller]` on main rust-lang#75130
* Fix #[track_caller] shims for trait objects. rust-lang#74784
* rustc_target: Add a target spec option for disabling `--eh-frame-hdr` rust-lang#74631
* Disable Azure Pipelines except for macOS rust-lang#74620
* Upload builds from GHA instead of Azure Pipelines rust-lang#74565
* Add the aarch64-apple-darwin target rust-lang#74541
* Use `ReEmpty(U0)` as the implicit region bound in typeck rust-lang#74509
* rustbuild: drop tool::should_install rust-lang#74457
* lint: use `transparent_newtype_field` to avoid ICE rust-lang#74340
* Don't panic if the lhs of a div by zero is not statically known rust-lang#74221
* improper_ctypes_definitions: allow `Box` rust-lang#74448
* typeck: check for infer before type impls trait rust-lang#73965
@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
beta-accepted Accepted for backporting to the compiler in the beta channel. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE caused by non-primitive cast of slices
10 participants