-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Struct and variant constructors are not generic over lifetimes like regular functions. #30904
Comments
It's not as simple as making all regions late-bound; we'd have to use similar logic to what we use for fns I guess, where we distinguish the early-vs-late based on whether they are in use by where clauses. I imagine we don't do so because, when the struct or enum is used as a type, all the regions are always early bound. |
@nikomatsakis I wouldn't expect anything less (than having the same logic for both constructors and free functions). |
Submitted ICE separately as #30906. |
Triage: The ICE has been fixed, and the error message is now:
|
Add some tests for fixed ICEs Closes rust-lang#30904 (fixed between nightly-2019-07-14 and nightly-2019-07-31) Closes rust-lang#40231 (example 1 is fixed in 1.32.0, example 2 is fixed in 1.38.0) Closes rust-lang#52432 (fixed in rustc 1.40.0-beta.1 (76b4053 2019-11-05)) Closes rust-lang#63279 (fixed in rustc 1.40.0-nightly (246be7e 2019-10-25)) r? @Centril
Add some tests for fixed ICEs Closes rust-lang#30904 (fixed between nightly-2019-07-14 and nightly-2019-07-31) Closes rust-lang#40231 (example 1 is fixed in 1.32.0, example 2 is fixed in 1.38.0) Closes rust-lang#52432 (fixed in rustc 1.40.0-beta.1 (76b4053 2019-11-05)) Closes rust-lang#63279 (fixed in rustc 1.40.0-nightly (246be7e 2019-10-25)) r? @Centril
@steveklabnik Oops, I missed your comment - the ICE is #30906, not this issue. |
Add more tests for fixed ICEs Closes rust-lang#36122 (fixed in 1.20.0) Closes rust-lang#58094 (fixed in rust-lang#66054) Also, fix mistaken test case, from rust-lang#30904 to rust-lang#30906 (cc @eddyb) r? @Centril
Add more tests for fixed ICEs Closes rust-lang#36122 (fixed in 1.20.0) Closes rust-lang#58094 (fixed in rust-lang#66054) Also, fix mistaken test case, from rust-lang#30904 to rust-lang#30906 (cc @eddyb) r? @Centril
Add more tests for fixed ICEs Closes rust-lang#36122 (fixed in 1.20.0) Closes rust-lang#58094 (fixed in rust-lang#66054) Also, fix mistaken test case, from rust-lang#30904 to rust-lang#30906 (cc @eddyb) r? @Centril
The following testcase produces the errors noted in comments and the last one is an ICE (run on playpen):
The same errors occur if an
enum Foo<'a> { Str(&'a str) }
is used.Usage of
FnOnce<(T,)>
is to avoid proving an explicit type parameter for theOutput
associated type, as an workaround for #30867.Originally found in @asajeffrey's wasm repo (see my comment on asajeffrey/wasm#1).
cc @nikomatsakis @arielb1
The text was updated successfully, but these errors were encountered: