Repository navigation
traits: Fix dead match arm for String type suggestions. - #166506
Conversation
|
r? @nnethercote rustbot has assigned @nnethercote. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
|
Basically looks good. Two suggestions:
Thanks! @rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
Oh sure I'll keep that in mind from future. |
0bb98db to
73dbc12
Compare
|
@rustbot ready |
You made the code changes in the first commit and the test changes in the second commit, which is not what I requested. The point is that the tests should pass for each commit, rather than "the first commit breaks tests, the second commit fixes tests". |
Sorry, I didn't read that properly the first time :< |
The existing arm was trying to match with a diagnostic named "String", which doesn't exist and was dead code that never actually matched any case. Replace and fix the match condition by matching the definition id with the `String` `LangItem` instead as `String` exists as a LangItem and not a diagnostic item. Update tests that were affecting by this change.
73dbc12 to
eb8fa57
Compare
|
It's nice, right? You can see the code change and the effect on the tests all in the second commit. @bors r+ |
Yeaa it does look much better. Thankss! :) |
…thercote traits: Fix dead match arm for String type suggestions. The existing arm was trying to match with a diagnostic named "String", which doesn't exist and was dead code that never actually matched any case. Replace and fix the match condition by matching the definition id with the `String` `LangItem` instead as `String` exists as a LangItem and not a diagnostic item. closes rust-lang#166392
…uwer Rollup of 7 pull requests Successful merges: - #164252 (Share retain implementation between Vec and VecDeque) - #166171 (borrowck: Fix Reborrow ICE on types with several lifetimes) - #166506 (traits: Fix dead match arm for String type suggestions.) - #164542 (Add regression test for #151312) - #165651 (compiletest: Further clean up directive parsing) - #166196 (autodiff: don't ICE on invalid macro arguments) - #166556 (remove `Box::into_boxed_slice`)
…uwer Rollup of 10 pull requests Successful merges: - #164252 (Share retain implementation between Vec and VecDeque) - #166008 (fix inconsistent precedence of -Ctarget-feature wrt -Zllvm-target-feature) - #166156 (tests: cover proc-macro metadata path remapping) - #166171 (borrowck: Fix Reborrow ICE on types with several lifetimes) - #166506 (traits: Fix dead match arm for String type suggestions.) - #164542 (Add regression test for #151312) - #165651 (compiletest: Further clean up directive parsing) - #166196 (autodiff: don't ICE on invalid macro arguments) - #166556 (remove `Box::into_boxed_slice`) - #166562 (docs: add backticks around `!` in primitive docs )
…uwer Rollup of 10 pull requests Successful merges: - #164252 (Share retain implementation between Vec and VecDeque) - #166008 (fix inconsistent precedence of -Ctarget-feature wrt -Zllvm-target-feature) - #166156 (tests: cover proc-macro metadata path remapping) - #166171 (borrowck: Fix Reborrow ICE on types with several lifetimes) - #166506 (traits: Fix dead match arm for String type suggestions.) - #164542 (Add regression test for #151312) - #165651 (compiletest: Further clean up directive parsing) - #166196 (autodiff: don't ICE on invalid macro arguments) - #166556 (remove `Box::into_boxed_slice`) - #166562 (docs: add backticks around `!` in primitive docs )
Rollup merge of #166506 - hardikxk:rtc/suggest-string, r=nnethercote traits: Fix dead match arm for String type suggestions. The existing arm was trying to match with a diagnostic named "String", which doesn't exist and was dead code that never actually matched any case. Replace and fix the match condition by matching the definition id with the `String` `LangItem` instead as `String` exists as a LangItem and not a diagnostic item. closes #166392
…uwer Rollup of 10 pull requests Successful merges: - rust-lang/rust#164252 (Share retain implementation between Vec and VecDeque) - rust-lang/rust#166008 (fix inconsistent precedence of -Ctarget-feature wrt -Zllvm-target-feature) - rust-lang/rust#166156 (tests: cover proc-macro metadata path remapping) - rust-lang/rust#166171 (borrowck: Fix Reborrow ICE on types with several lifetimes) - rust-lang/rust#166506 (traits: Fix dead match arm for String type suggestions.) - rust-lang/rust#164542 (Add regression test for rust-lang/rust#151312) - rust-lang/rust#165651 (compiletest: Further clean up directive parsing) - rust-lang/rust#166196 (autodiff: don't ICE on invalid macro arguments) - rust-lang/rust#166556 (remove `Box::into_boxed_slice`) - rust-lang/rust#166562 (docs: add backticks around `!` in primitive docs )
The existing arm was trying to match with a diagnostic named "String", which doesn't exist and was dead code that never actually matched any case.
Replace and fix the match condition by matching the definition id with the
StringLangIteminstead asStringexists as a LangItem and not a diagnostic item.closes #166392