-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Lifetime bound error when using the indexing operator with an associated type containing a lifetime #32382
Comments
also @rust-lang/compiler |
I will look at this. |
marking as P-medium nonetheless, since I am not convinced this needs to high priority... |
OK, so, I think this is related to the implied bounds that we compute. We must be somehow failing to add the implied |
Well, that doesn't quite explain why the manual call to |
@pnkfelix You are currently assigned to this, are you still investigating? |
cc @nikomatsakis as well |
I'm running into this issue as well when trying to convert It indeed works fine when manually calling |
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. |
…pe-with-lifetime, r=nikomatsakis Regression test for rust-lang#32382.
Rollup of 11 pull requests Successful merges: - #54078 (Expand the documentation for the `std::sync` module) - #54717 (Cleanup rustc/ty part 1) - #54781 (Add examples to `TyKind::FnDef` and `TyKind::FnPtr` docs) - #54787 (Only warn about unused `mut` in user-written code) - #54804 (add suggestion for inverted function parameters) - #54812 (Regression test for #32382.) - #54833 (make `Parser::parse_foreign_item()` return a foreign item or error) - #54834 (rustdoc: overflow:auto doesn't work nicely on small screens) - #54838 (Fix typo in src/libsyntax/parse/parser.rs) - #54851 (Fix a regression in 1.30 by reverting #53564) - #54853 (Remove unneccessary error from test, revealing NLL error.) Failed merges: r? @ghost
#54812 added the test. |
NLL (migrate mode) is enabled in all editions as of PR #59114. Verified that test case compiled in Nightly 2015 edition; closing as fixed. |
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.
The text was updated successfully, but these errors were encountered: