Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upLifetime bound error when using the indexing operator with an associated type containing a lifetime #32382
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
also @rust-lang/compiler |
alexcrichton
added
the
regression-from-stable-to-stable
label
Mar 21, 2016
brson
added
T-compiler
T-lang
I-nominated
labels
Jun 23, 2016
pnkfelix
self-assigned this
Jun 23, 2016
This comment has been minimized.
This comment has been minimized.
|
I will look at this. |
This comment has been minimized.
This comment has been minimized.
|
marking as P-medium nonetheless, since I am not convinced this needs to high priority... |
pnkfelix
added
P-medium
and removed
I-nominated
labels
Jun 23, 2016
brson
added
A-typesystem
A-borrow-checker
and removed
A-borrow-checker
labels
Sep 13, 2016
nikomatsakis
added
the
A-lifetimes
label
Sep 13, 2016
This comment has been minimized.
This comment has been minimized.
|
OK, so, I think this is related to the implied bounds that we compute. We must be somehow failing to add the implied |
This comment has been minimized.
This comment has been minimized.
|
Well, that doesn't quite explain why the manual call to |
This comment has been minimized.
This comment has been minimized.
|
@pnkfelix You are currently assigned to this, are you still investigating? |
This comment has been minimized.
This comment has been minimized.
|
cc @nikomatsakis as well |
Mark-Simulacrum
added
the
C-bug
label
Jul 24, 2017
This comment has been minimized.
This comment has been minimized.
|
I'm running into this issue as well when trying to convert It indeed works fine when manually calling |
pnkfelix
added
the
NLL-fixed-by-NLL
label
Oct 4, 2018
This comment has been minimized.
This comment has been minimized.
|
I just tried this out with the 2018 edition and it works there. Or on the nightly compiler, one can add We should add a regression test before closing though. |
pnkfelix
added
the
E-needstest
label
Oct 4, 2018
pnkfelix
added a commit
to pnkfelix/rust
that referenced
this issue
Oct 4, 2018
pietroalbini
added a commit
to pietroalbini/rust
that referenced
this issue
Oct 5, 2018
bors
added a commit
that referenced
this issue
Oct 6, 2018
This comment has been minimized.
This comment has been minimized.
|
#54812 added the test. |
koute commentedMar 20, 2016
Please consider the following code:
which fails with the following error:
So if I use
.index()and use an associated type it compiles fine. If I use[]and replace the associated type with the underlying type it also compiles fine. Logic would have it that if I use[]and I'll leave the associated type as-is it should also compile fine, but alas, I get an error, which doesn't really make any sense.Rust version: rustc 1.9.0-nightly (b12b4e4 2016-03-17)
This is a regression; this code used to compile on at least 1.4, 1.5 and 1.6; it broke at 1.7.