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

impl From<Infallible> for TryFromSliceError #60318

Merged
merged 1 commit into from
May 11, 2019

Conversation

jethrogb
Copy link
Contributor

I believe this was missed when TryFrom was stabilized. I think TryFromSliceError and TryFromIntError are the only two TryFrom error types that appear in std. I think trait implementations have to be insta-stable, but I'm not sure.

@rust-highfive
Copy link
Collaborator

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 Apr 26, 2019
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:26d0edb4:start=1556308197659287217,finish=1556308198435658759,duration=776371542
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---
[00:03:54]    Compiling unwind v0.0.0 (/checkout/src/libunwind)
[00:03:58] error[E0412]: cannot find type `Infallible` in this scope
[00:03:58]   --> src/libcore/array.rs:76:11
[00:03:58]    |
[00:03:58] 76 | impl From<Infallible> for TryFromSliceError {
[00:03:58] help: possible candidate is found in another module, you can import it into scope
[00:03:58]    |
[00:03:58] 12 | use crate::convert::Infallible;
[00:03:58]    |
[00:03:58]    |
[00:03:58] 
[00:03:58] error[E0412]: cannot find type `Infallible` in this scope
[00:03:58]   --> src/libcore/array.rs:77:16
[00:03:58]    |
[00:03:58] 77 |     fn from(x: Infallible) -> TryFromSliceError {
[00:03:58] help: possible candidate is found in another module, you can import it into scope
[00:03:58]    |
[00:03:58] 12 | use crate::convert::Infallible;
[00:03:58]    |
---
travis_time:end:02a98280:start=1556308463490887061,finish=1556308463495250691,duration=4363630
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:16cfd913
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:05b91784
travis_time:start:05b91784
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:0d6f5f9e
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@jethrogb jethrogb force-pushed the jb/try-from-slice-to-infallible branch from 09183c0 to 48b3f3d Compare April 26, 2019 19:55
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:35499234:start=1556308605357371460,finish=1556308606099424323,duration=742052863
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---
[00:04:08]    Compiling rustc_asan v0.0.0 (/checkout/src/librustc_asan)
[00:04:24] error[E0711]: feature `try_from` is declared stable since 1.36.0, but was previously declared stable since 1.34.0
[00:04:24]   --> src/libcore/array.rs:75:1
[00:04:24]    |
[00:04:24] 75 | #[stable(feature = "try_from", since = "1.36.0")]
[00:04:24] 
[00:04:24] error: aborting due to previous error
[00:04:24] 
[00:04:24] For more information about this error, try `rustc --explain E0711`.
---
travis_time:end:0d96e1d0:start=1556308882904880792,finish=1556308882910133810,duration=5253018
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0434e5d6
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:13db7300
travis_time:start:13db7300
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:1e6afcfc
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@jethrogb
Copy link
Contributor Author

Should I change the stability attribute to say 1.34 or add a new feature that's stable at 1.36?

@cramertj
Copy link
Member

r? @SimonSapin

@rust-highfive rust-highfive assigned SimonSapin and unassigned cramertj Apr 26, 2019
@Centril Centril added this to the 1.36 milestone Apr 27, 2019
@Centril Centril added relnotes Marks issues that should be documented in the release notes of the next release. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Apr 27, 2019
@SimonSapin
Copy link
Contributor

1.36 is correct, as it is the current version in Nightly.

@bors r+

@bors
Copy link
Contributor

bors commented Apr 27, 2019

📌 Commit 48b3f3d4ce010d9d9039908cfaba4ede00accbf0 has been approved by SimonSapin

@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 Apr 27, 2019
@bors
Copy link
Contributor

bors commented Apr 28, 2019

⌛ Testing commit 48b3f3d4ce010d9d9039908cfaba4ede00accbf0 with merge 65631a3665ff5bd4ae39a468c94b081d781dd428...

@bors
Copy link
Contributor

bors commented Apr 28, 2019

💔 Test failed - checks-travis

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[00:05:01]    Compiling rustc_lsan v0.0.0 (/checkout/src/librustc_lsan)
[00:05:16] error[E0711]: feature `try_from` is declared stable since 1.36.0, but was previously declared stable since 1.34.0
[00:05:16]   --> src/libcore/array.rs:75:1
[00:05:16]    |
[00:05:16] 75 | #[stable(feature = "try_from", since = "1.36.0")]
[00:05:16] 
[00:05:16] error: aborting due to previous error
[00:05:16] 
[00:05:16] For more information about this error, try `rustc --explain E0711`.
---
travis_time:end:11e37dfe:start=1556415923161285422,finish=1556415923168176238,duration=6890816
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:04bf50d2
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:01b327d2
travis_time:start:01b327d2
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:039561f2
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

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

@SimonSapin, nope see CI error.

@SimonSapin
Copy link
Contributor

@jethrogb You need to pick a different feature name. (The name doesn’t matter to much, IIRC think it doesn’t show up anywhere.)

@jethrogb jethrogb force-pushed the jb/try-from-slice-to-infallible branch from 48b3f3d to 24d89e5 Compare April 29, 2019 16:16
@jethrogb
Copy link
Contributor Author

Updated

@Centril
Copy link
Contributor

Centril commented May 11, 2019

r? @sfackler

@rust-highfive rust-highfive assigned sfackler and unassigned SimonSapin May 11, 2019
@sfackler
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented May 11, 2019

📌 Commit 24d89e5 has been approved by sfackler

@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 May 11, 2019
@bors
Copy link
Contributor

bors commented May 11, 2019

⌛ Testing commit 24d89e5 with merge af98304...

bors added a commit that referenced this pull request May 11, 2019
…ackler

impl From<Infallible> for TryFromSliceError

I believe this was missed when TryFrom was stabilized. I think `TryFromSliceError` and `TryFromIntError` are the only two `TryFrom` error types that appear in `std`. I think trait implementations have to be insta-stable, but I'm not sure.
@bors
Copy link
Contributor

bors commented May 11, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: sfackler
Pushing af98304 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 11, 2019
@bors bors merged commit 24d89e5 into rust-lang:master May 11, 2019
@briansmith
Copy link
Contributor

Note: Every time I've received the error "TryFromSliceError does not implement From<Infallible>" it was because I was calling try_into() on a non-slice object and it was a bug in my code. I wonder if these will cause buggy code to start compiling? Maybe that's why they weren't originally added?

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Jul 5, 2019
Pkgsrc changes:
 * NetBSD/sparc64 disabling of "packed" removed ("packed" removed upstream)
 * Adapt src_libstd_build.rs patch, update sed'ing of .cargo-checksum.json

Build verified on NetBSD 8.0/amd64.

Upstream changes:

Version 1.36.0 (2019-07-04)
==========================

Language
--------
- [Non-Lexical Lifetimes are now enabled on the 2015 edition.][59114]
- [The order of traits in trait objects no longer affects the semantics of that
  object.][59445] e.g. `dyn Send + fmt::Debug` is now equivalent to
  `dyn fmt::Debug + Send`, where this was previously not the case.

Libraries
---------
- [`HashMap`'s implementation has been replaced with `hashbrown::HashMap` implem
entation.][58623]
- [`TryFromSliceError` now implements `From<Infallible>`.][60318]
- [`mem::needs_drop` is now available as a const fn.][60364]
- [`alloc::Layout::from_size_align_unchecked` is now available as a const fn.][6
0370]
- [`String` now implements `BorrowMut<str>`.][60404]
- [`io::Cursor` now implements `Default`.][60234]
- [Both `NonNull::{dangling, cast}` are now const fns.][60244]
- [The `alloc` crate is now stable.][59675] `alloc` allows you to use a subset
  of `std` (e.g. `Vec`, `Box`, `Arc`) in `#![no_std]` environments if the
  environment has access to heap memory allocation.
- [`String` now implements `From<&String>`.][59825]
- [You can now pass multiple arguments to the `dbg!` macro.][59826] `dbg!` will
  return a tuple of each argument when there is multiple arguments.
- [`Result::{is_err, is_ok}` are now `#[must_use]` and will produce a warning if
  not used.][59648]

Stabilized APIs
---------------
- [`VecDeque::rotate_left`]
- [`VecDeque::rotate_right`]
- [`Iterator::copied`]
- [`io::IoSlice`]
- [`io::IoSliceMut`]
- [`Read::read_vectored`]
- [`Write::write_vectored`]
- [`str::as_mut_ptr`]
- [`mem::MaybeUninit`]
- [`pointer::align_offset`]
- [`future::Future`]
- [`task::Context`]
- [`task::RawWaker`]
- [`task::RawWakerVTable`]
- [`task::Waker`]
- [`task::Poll`]

Cargo
-----
- [Cargo will now produce an error if you attempt to use the name of a required
dependency as a feature.][cargo/6860]
- [You can now pass the `--offline` flag to run cargo without accessing the netw
ork.][cargo/6934]

You can find further change's in [Cargo's 1.36.0 release notes][cargo-1-36-0].

Clippy
------
There have been numerous additions and fixes to clippy, see [Clippy's 1.36.0 rel
ease notes][clippy-1-36-0] for more details.

Misc
----

Compatibility Notes
-------------------
- [`std::arch::x86::_rdtsc` returns `u64` instead of `i64`][stdsimd/559]
- [`std::arch::x86_64::_mm_shuffle_ps` takes an `i32` instead of `u32` for `mask
`][stdsimd/522]
- With the stabilisation of `mem::MaybeUninit`, `mem::uninitialized` use is no
  longer recommended, and will be deprecated in 1.38.0.

[60318]: rust-lang/rust#60318
[60364]: rust-lang/rust#60364
[60370]: rust-lang/rust#60370
[60404]: rust-lang/rust#60404
[60234]: rust-lang/rust#60234
[60244]: rust-lang/rust#60244
[58623]: rust-lang/rust#58623
[59648]: rust-lang/rust#59648
[59675]: rust-lang/rust#59675
[59825]: rust-lang/rust#59825
[59826]: rust-lang/rust#59826
[59445]: rust-lang/rust#59445
[59114]: rust-lang/rust#59114
[cargo/6860]: rust-lang/cargo#6860
[cargo/6934]: rust-lang/cargo#6934
[`VecDeque::rotate_left`]: https://doc.rust-lang.org/std/collections/struct.VecDeque.html#method.rotate_left
[`VecDeque::rotate_right`]: https://doc.rust-lang.org/std/collections/struct.VecDeque.html#method.rotate_right
[`Iterator::copied`]: https://doc.rust-lang.org/std/iter/trait.Iterator.html#tymethod.copied
[`io::IoSlice`]: https://doc.rust-lang.org/std/io/struct.IoSlice.html
[`io::IoSliceMut`]: https://doc.rust-lang.org/std/io/struct.IoSliceMut.html
[`Read::read_vectored`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_vectored
[`Write::write_vectored`]: https://doc.rust-lang.org/std/io/trait.Write.html#method.write_vectored
[`str::as_mut_ptr`]: https://doc.rust-lang.org/std/primitive.str.html#method.as_mut_ptr
[`mem::MaybeUninit`]: https://doc.rust-lang.org/std/mem/union.MaybeUninit.html
[`pointer::align_offset`]: https://doc.rust-lang.org/std/primitive.pointer.html#method.align_offset
[`future::Future`]: https://doc.rust-lang.org/std/future/trait.Future.html
[`task::Context`]: https://doc.rust-lang.org/beta/std/task/struct.Context.html
[`task::RawWaker`]: https://doc.rust-lang.org/beta/std/task/struct.RawWaker.html
[`task::RawWakerVTable`]: https://doc.rust-lang.org/beta/std/task/struct.RawWakerVTable.html
[`task::Waker`]: https://doc.rust-lang.org/beta/std/task/struct.Waker.html
[`task::Poll`]: https://doc.rust-lang.org/beta/std/task/enum.Poll.html
[clippy-1-36-0]: https://github.com/rust-lang/rust-clippy/blob/master/CHANGELOG.md#rust-136
[cargo-1-36-0]: https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md#cargo-136-2019-07-04
[stdsimd/522]: rust-lang/stdarch#522
[stdsimd/559]: rust-lang/stdarch#559
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. relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants