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

Fix type-parameterized object methods. #91

Closed
froystig opened this issue Jun 29, 2010 · 2 comments
Closed

Fix type-parameterized object methods. #91

froystig opened this issue Jun 29, 2010 · 2 comments
Labels
A-typesystem Area: The type system

Comments

@froystig
Copy link
Contributor

See (XFAILed) run-pass/generic-obj.rs for sample testcase. A method that takes an argument whose type is a type-parameter of its enclosing object, e.g.

obj fooer[T]() { fn foo(T t) {} }

causes rustboot to get-element-pointer on something dynamically-sized during translation. Methods returning T to work fine, on the other hand.

@froystig
Copy link
Contributor Author

Issue #92 was fixed with 25a38ee, which means that the above test now compiles. But now it segfaults at runtime instead. This appears to happen when the fooer.foo()'s arguments are dropped (can be made to happen earlier if a copy on a T occurs inside of fooer.foo()). This might be a bug in calling drop/copy glue, drop/copy glue itself, in the size calculations that take place right before either one of those), or in none of the above. Needs further investigation.

@froystig
Copy link
Contributor Author

Adjust testcase to cover issue #91, which was actually fixed back in commit f02f9cb. Closed by 1a61fb8.

mbrubeck pushed a commit to mbrubeck/rust that referenced this issue Oct 17, 2011
oli-obk pushed a commit to oli-obk/rust that referenced this issue Jul 19, 2017
keeperofdakeys pushed a commit to keeperofdakeys/rust that referenced this issue Dec 12, 2017
dlrobertson pushed a commit to dlrobertson/rust that referenced this issue Nov 29, 2018
Items chapter cleanup and improvements
eddyb pushed a commit to eddyb/rust that referenced this issue Jun 30, 2020
We now support `--features`, `--all-features` in addition to
`--no-default-features`. This closes rust-lang#91.
antoyo added a commit to antoyo/rust that referenced this issue Sep 28, 2021
* Make define_global() return a RValue directly
* Return LValue in functions declaring a global variable
* Remove useless cast
* Fix bytes_in_context to use an array rvalue
* Remove global_names which is unused
* Make const_struct create a constant struct
* Correctly initialize global in static_addr_of_mut
* Fix global variable initialization
* Remove workaround for ARGV
vadorovsky pushed a commit to vadorovsky/rust that referenced this issue May 15, 2024
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
* Update README.md
* Split off a separate DEVELOPER-GUIDE
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-typesystem Area: The type system
Projects
None yet
Development

No branches or pull requests

1 participant