-
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
rustbuild: Allow quick testing of libstd and libcore at stage0 #50466
Changes from 7 commits
1733f5e
be9d669
3ddd67b
10ab98d
13e07a4
f24915b
02f6a03
169f58b
05af55b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,7 @@ | |
|
||
// Since libcore defines many fundamental lang items, all tests live in a | ||
// separate crate, libcoretest, to avoid bizarre issues. | ||
#![cfg(not(test))] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This feels odd; presumably independent of whether we are running tests we would expect core to exist and define everything -- or am I misreading what this does? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem is when we are testing the library, we will build an executable and link to libtest. Now, this executable defines some lang items, and at the same time libtest imports the non-testing libcore which also defines some lang items. This will cause the E0152 "duplicate lang item found" error. I'm not sure why this is not discovered before, maybe no one tried to Reduced test case: #![cfg(not(test))] // <-- comment out to cause E0152 when `cargo test`.
#![feature(no_core, lang_items)]
#![no_core]
/// ```
///
/// ```
#[lang = "sized"]
pub trait Sized {} In I've updated this comment to explain the attribute. |
||
|
||
#![stable(feature = "core", since = "1.6.0")] | ||
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we rename this to
DocTests
? I think it might have uses outside just being passed on the command line...