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

Move std::test into core or change the way coretest works #2912

Closed
brson opened this issue Jul 13, 2012 · 8 comments
Closed

Move std::test into core or change the way coretest works #2912

brson opened this issue Jul 13, 2012 · 8 comments
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc

Comments

@brson
Copy link
Contributor

brson commented Jul 13, 2012

Running tests requires linking to std, where the test runner lives. core has a huge hack in it to allow it to link to std when building with --test.

When building core tests (an executable), core links to std, which then links to the actual core shared library. As a result coretest actually includes two entire copies of core at runtime. The tests are exercising the core code compiled into the executable, and std is exercising the core library.

This caused a confusing problem with the TLS tests which use function addresses as keys, because std and coretest were using two different functions.

Two solutions

  • move std::test to core
  • move core tests to their own crate
@bblum
Copy link
Contributor

bblum commented Jul 13, 2012

This can be worked around for TLS; it just means that any user of TLS within core has to completely cheat.

@z0w0
Copy link
Contributor

z0w0 commented Jul 13, 2012

I think it's a good idea to have it in core. Really, any functionality that is in the compiler should be supported by core.

@brson
Copy link
Contributor Author

brson commented Nov 7, 2012

This is also a problem for build times, since we compile core twice to test it.

@catamorphism
Copy link
Contributor

Not really a backwards-compatibility bug. Just a bug, maybe?

@brson
Copy link
Contributor Author

brson commented Jul 19, 2013

extra::test has several dependencies from extra that I'm not interested in moving into std, sadly. maybe some of them could be code-duplicated in std or sneakily exported from std::unstable and then reexported from extra. it uses at least term and sort. probably workcache someday too. the status quo seems to be working out ok for us right now so I'm not too worried about it atm.

@huonw
Copy link
Member

huonw commented Nov 24, 2013

Triage: we're still using the weird work-arounds since extra::test is still extra::test.

@emberian
Copy link
Member

I think what we have today is fine, we should close this.

@brson
Copy link
Contributor Author

brson commented Jun 18, 2014

Agree, there's no going back now.

@brson brson closed this as completed Jun 18, 2014
bors added a commit that referenced this issue Sep 4, 2018
Update RLS and Rustfmt

RLS
* Allow project model to download crates ([#1020](rust-lang/rls#1020))
* Support simple external builds ([#988](rust-lang/rls#988))
* Support using external Rustfmt ([#990](rust-lang/rls#990))

Rustfmt (0.99.4)
* Format chains with comment ([#2899](https://github.com/rust-lang-nursery/rls/pull/2899))
* Do not show wildcard pattern in slice pattern ([#2912](https://github.com/rust-lang-nursery/rls/pull/2912))
* Impl only use ([#2951](https://github.com/rust-lang-nursery/rls/pull/2951))
* ... and [more](rust-lang/rustfmt@5c9a2b6...1c40881)

Bumped in tandem to pull a single version of `rustc-ap-*` libs.

r? @nrc
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
Last time we stabilized
model-checking/kani#2882, this continues the
trend and stabilizes `find_debug_info` as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc
Projects
None yet
Development

No branches or pull requests

6 participants