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

Inject std when --test. #1127, #3241 #4309

Closed
wants to merge 1 commit into from
Closed

Conversation

brson
Copy link
Contributor

@brson brson commented Dec 28, 2012

r? @pcwalton

This solves some long standing issues with --test, automatically linking to std. It may also help with the resolution changes you are working on.

When building a test runner it does something like this

mod __test {
    extern mod std(vers = "0.6");

    fn main() {
        ...
    }
}

Then, whenever it builds paths to std it uses self::std::test to reference the injected std. When building a test runner for std it instead uses paths like ::test.

As a side-effect, core no longer needs to declare a magic std module.

This isn't fully tested yet because of some breakage with stdtest on incoming.

@catamorphism
Copy link
Contributor

Since this has been sitting for a while, I took the liberty of reviewing it. r+

@brson brson closed this Jan 9, 2013
matthiaskrgr pushed a commit to matthiaskrgr/rust that referenced this pull request Oct 11, 2022
…Veykril

feat: type inference for generators

This PR implements basic type inference for generator and yield expressions.

Things not included in this PR:
- Generator upvars and generator witnesses are not implemented. They are only used to determine auto trait impls, so basic type inference should be fine without them, but method resolutions with auto trait bounds may not be resolved correctly.

Open questions:
- I haven't (yet) implemented `HirDisplay` for `TyKind::Generator`, so generator types are just shown as "{{generator}}" (in tests, inlay hints, hovers, etc.), which is not really nice. How should we show them?
- I added moderate amount of stuffs to minicore. I especially didn't want to add `impl<T> Deref for &T` and `impl<T> Deref for &mut T` exclusively for tests for generators; should I move them into the test fixtures or can they be placed in minicore?

cc rust-lang#4309
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants