about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2020-07-27Add tests for the new behaviorJoshua Nelson-3/+92
- Only set stage 2 in dist tests - Add test for `x.py doc` without args - Add test for `x.py build` without args - Add test for `x.py build --stage 0`
2020-07-27Move tests into a submoduleJoshua Nelson-461/+470
2020-07-27Fix most bootstrap testsJoshua Nelson-2/+3
Uses --stage 2 for all the existing tests
2020-07-27Change debuginfo to default to 1 if `debug = true` is setJoshua Nelson-2/+5
From [a conversation in discord](https://discordapp.com/channels/442252698964721669/443151243398086667/719200989269327882): > Linking seems to consume all available RAM, leading to the OS to swap memory to disk and slowing down everything in the process Compiling itself doesn't seem to take up as much RAM, and I'm only looking to check whether a minimal testcase can be compiled by rustc, where the runtime performance isn't much of an issue > do you have debug = true or debuginfo-level = 2 in config.toml? > if so I think that results in over 2GB of debuginfo nowadays and is likely the culprit > which might mean we're giving out bad advice :( Anecdotally, this sped up my stage 1 build from 15 to 10 minutes. This still adds line numbers, it only removes variable and type information. - Improve wording for debuginfo description Co-authored-by: Teymour Aldridge <42674621+teymour-aldridge@users.noreply.github.com>
2020-07-27Don't build rustc without stdJoshua Nelson-2/+2
- Set rustc to build only when explicitly asked for This allows building the stage2 rustc artifacts, which nothing depends on. Previously the behavior was as follows (where stageN <-> stage(N-1) artifacts, except for stage0 libstd): - `x.py build --stage 0`: - stage0 libstd - stage1 rustc (but without putting rustc in stage0/) This leaves you without any rustc at all except for the beta compiler (https://github.com/rust-lang/rust/issues/73519). This is never what you want. - `x.py build --stage 1`: - stage0 libstd - stage1 rustc - stage1 libstd - stage1 rustdoc - stage2 rustc This leaves you with a broken stage2 rustc which doesn't even have libcore and is effectively useless. Additionally, it compiles rustc twice, which is not normally what you want. - `x.py build --stage 2`: - stage0 libstd - stage1 rustc - stage1 libstd - stage2 rustc - stage2 rustdoc and tools This builds all tools in release mode. This is the correct usage for CI, but takes far to long for development. Now the behavior is as follows: - `x.py build --stage 0`: - stage0 libstd This is suitable for contributors only working on the standard library, as it means rustc never has to be compiled. - `x.py build --stage 1`: - stage0 libstd - stage1 rustc - stage1 libstd - stage1 rustdoc This is suitable for contributors working on the compiler. It ensures that you have a working rustc and libstd without having to pass `src/libstd` in addition. - `x.py build --stage 2`: - stage0 libstd - stage1 rustc - stage1 libstd - stage2 rustc - stage2 libstd - stage2 rustdoc This is suitable for debugging errors which only appear with the stage2 compiler. - `x.py build --stage 2 src/libstd src/rustc` - stage0 libstd - stage1 rustc - stage1 libstd - stage2 rustc - stage2 libstd - stage2 rustdoc, tools, etc. - stage2 rustc artifacts ('stage3') This is suitable for CI, which wants all tools in release mode. However, most of the use cases for this should use `x.py dist` instead, which builds all the tools without each having to be named individually.
2020-07-27Make the default stage dependent on the subcommandJoshua Nelson-1/+14
### x.py build/test: stage 1 I've seen very few people who actually use full stage 2 builds on purpose. These compile rustc and libstd twice and don't give you much more information than a stage 1 build (except in rare cases like https://github.com/rust-lang/rust/pull/68692#discussion_r376392145). For new contributors, this makes the build process even more daunting than it already is. As long as CI is changed to use `--stage 2` I see no downside here. ### x.py bench/dist/install: stage 2 These commands have to do with a finished, optimized version of rustc. It seems very rare to want to use these with a stage 1 build. ### x.py doc: stage 0 Normally when you document things you're just fixing a typo. In this case there is no need to build the whole rust compiler, since the documentation will usually be the same when generated with the beta compiler or with stage 1. Note that for this release cycle only there will be a significant different between stage0 and stage1 docs: https://github.com/rust-lang/rust/pull/73101. However most of the time this will not be the case.
2020-07-27Don't duplicate builder codeJoshua Nelson-19/+14
- Add Builder::new_internal
2020-07-28Auto merge of #73265 - mark-i-m:mv-std, r=Mark-Simulacrum,mark-i-mbors-1222/+1254
mv std libs to library/ This is the first step in refactoring the directory layout of this repository, with further followup steps planned (but not done yet). Background: currently, all crates are under src/, without nested src directories and with the unconventional `lib*` prefixes (e.g., `src/libcore/lib.rs`). This directory structures is not idiomatic and makes the `src/` directory rather overwhelming. To improve contributor experience and make things a bit more approachable, we are reorganizing the repo a bit. In this PR, we move the standard libs (basically anything that is "runtime", as opposed to part of the compiler, build system, or one of the tools, etc). The new layout moves these libraries to a new `library/` directory in the root of the repo. Additionally, we remove the `lib*` prefixes and add nested `src/` directories. The other crates/tools in this repo are not touched. So in summary: ``` library/<crate>/src/*.rs src/<all the rest> // unchanged ``` where `<crate>` is: - core - alloc - std - test - proc_macro - panic_abort - panic_unwind - profiler_builtins - term - unwind - rtstartup - backtrace - rustc-std-workspace-* There was a lot of discussion about this and a few rounds of compiler team approvals, FCPs, MCPs, and nominations. The original MCP is https://github.com/rust-lang/compiler-team/issues/298. The final approval of the compiler team was given here: https://github.com/rust-lang/rust/pull/73265#issuecomment-659498446. The name `library` was chosen to complement a later move of the compiler crates to a `compiler/` directory. There was a lot of discussion around adding the nested `src/` directories. Note that this does increase the nesting depth (plausibly important for manual traversal of the tree, e.g., through GitHub's UI or `cd`), but this is deemed to be better as it fits the standard layout of Rust crates throughout most of the ecosystem, though there is some debate about how much this should apply to multi-crate projects. Overall, there seem to be more people in favor of nested `src/` than against. After this PR, there are no dependencies out of the `library/` directory except on the `build_helper` (or crates.io crates).
2020-07-27mv std libs to library/mark-1222/+1254
2020-07-27Auto merge of #73583 - anp:location-eq, r=dtolnaybors-1/+23
Derive common traits for panic::Location. Now that `#[track_caller]` is on track to stabilize, one of the roughest edges of working with it is the fact that you can't do much with `Location` except turn it back into a `(&str, u32, u32)`. Which makes sense because the type was defined around the panic machinery originally passing around that tuple (it has the same layout as Location even). This PR derives common traits for the type in accordance with the [API guidelines](https://rust-lang.github.io/api-guidelines/interoperability.html#types-eagerly-implement-common-traits-c-common-traits) (those apply to core, right?). There's a risk here, e.g. if we ever change the representation of `Location` in a way that makes it harder to implement `Ord`, we might not be able to make that change in a backwards-compatible way. I don't think there's any other compatibility hazard here, as the only changes we currently imagine for the type are to add end fields. cc @rust-lang/libs
2020-07-27Auto merge of #73503 - lcnr:forall-predicate-what-and-why-2, r=nikomatsakisbors-1150/+1268
convert higher ranked `Predicate`s to `PredicateKind::ForAll` implements step 2 of https://github.com/rust-lang/compiler-team/issues/285 r? @nikomatsakis
2020-07-27clippyBastian Kauschke-5/+5
2020-07-27cleanupBastian Kauschke-59/+35
2020-07-27fix rustdocBastian Kauschke-24/+14
2020-07-27it works again :tada:Bastian Kauschke-42/+47
2020-07-27fix rebaseBastian Kauschke-29/+29
2020-07-27directly contain `PredicateAtom` in `PredicateKind::ForAll`Bastian Kauschke-180/+163
2020-07-27introduce PredicateAtomBastian Kauschke-842/+795
2020-07-27add reuse_or_mk_predicateBastian Kauschke-12/+20
2020-07-27refactor query_outlives_constraints_into_obligationsBastian Kauschke-13/+6
2020-07-27this might be unqualified, but at least it's now quantifiedBastian Kauschke-83/+87
2020-07-27fix rustdocBastian Kauschke-12/+20
2020-07-27split ignore_qualifiersBastian Kauschke-181/+196
2020-07-27reviewBastian Kauschke-75/+45
2020-07-27fix elaborate for predicates with unbound variablesBastian Kauschke-10/+6
2020-07-27clippyBastian Kauschke-22/+22
2020-07-27rustdocBastian Kauschke-31/+36
2020-07-27`PredicateKint` -> `PredicateKind`, the beginning of the endBastian Kauschke-740/+742
2020-07-27progressBastian Kauschke-46/+54
2020-07-27elaborateBastian Kauschke-19/+23
2020-07-27subst_supertraitBastian Kauschke-31/+14
2020-07-27somewhat related cleanupBastian Kauschke-11/+4
2020-07-27wfBastian Kauschke-18/+20
2020-07-27convert trivial predicatesBastian Kauschke-28/+26
2020-07-27query_outlives_constraints_into_obligationsBastian Kauschke-20/+24
2020-07-27anonymize_predicateBastian Kauschke-22/+15
2020-07-27Handle trait/projection predicates with bound regions correctlyMatthew Jasper-70/+132
2020-07-27minimalBastian Kauschke-78/+44
2020-07-27add `PredicateKint`, because who doesn't like bodgingBastian Kauschke-3/+200
2020-07-27Auto merge of #74831 - Manishearth:rollup-ugw4pt4, r=Manishearthbors-94/+209
Rollup of 4 pull requests Successful merges: - #73858 (Make more primitive integer methods const) - #74487 (Forbid generic parameters in anon consts inside of type defaults) - #74803 (rustbuild: fix bad usage of UNIX exec() in rustc wrapper) - #74822 (More ensure stack to avoid segfault with increased `recursion_limit`) Failed merges: r? @ghost
2020-07-27Rollup merge of #74822 - JohnTitor:no-sigsegv, r=oli-obkManish Goregaokar-18/+28
More ensure stack to avoid segfault with increased `recursion_limit` Fixes #74711 I do not add the test here since the limit value depends on the machine and it's hard to test the output. r? @oli-obk
2020-07-27Rollup merge of #74803 - infinity0:fix-exec, r=nagisaManish Goregaokar-10/+3
rustbuild: fix bad usage of UNIX exec() in rustc wrapper exec never returns, it replaces the current process. so anything after it is unreachable. that's not how exec_cmd() is used in the surrounding code We use `--on-fail env` on Debian. `env` always returns exit code 0. This means that the `rustc` bootstrap wrapper always returns exit code 0 even when it fails. However, the crossbeam-utils build process (due to autocfg) relies on `rustc` returning error exit codes when detecting CPU features, and ends up writing `cargo:rustc-cfg=has_atomic_u128` even when it's not detected, because the `rustc` wrapper is always giving exit code 0. (This separately is causing our builds to try to compile rustc 40+ times, due to #74801.)
2020-07-27Rollup merge of #74487 - lcnr:const-in-ty-default, r=varkorManish Goregaokar-13/+135
Forbid generic parameters in anon consts inside of type defaults Emit a resolution error for `struct Foo<T, U = [u8; std::mem::size_of::<T>()]>`. We are unable to support this with the way `ty::Generics` is currently used, so let's just forbid it entirely for now. Fixes some ICE on stable, e.g. ```rust struct Foo<T, U = [u8; std::mem::size_of::<*mut T>()]>(T, U); ``` r? @varkor @eddyb
2020-07-27Rollup merge of #73858 - tspiteri:const-methods, r=oli-obkManish Goregaokar-53/+43
Make more primitive integer methods const Now that #72437 has been merged and `const_if_match` is stable, these methods can be stabilized const. The methods are grouped in commits according to feature names: * `const_nonzero_int_methods` - `NonZero*::new` * some `const_checked_int_methods` - `{i*,u*}::checked_add` - `{i*,u*}::checked_sub` - `{i*,u*}::checked_mul` - `{i*,u*}::checked_neg` - `{i*,u*}::checked_shl` - `{i*,u*}::checked_shr` - `i*::checked_abs` * `const_saturating_int_methods` - `{i*,u*}::saturating_add` - `{i*,u*}::saturating_sub` - `{i*,u*}::saturating_mul` - `i*::saturating_neg` - `i*::saturating_abs` * `const_int_sign` - `i*::signum` * `const_ascii_ctype_on_intrinsics` - `{char,u8}::is_ascii_alphabetic` - `{char,u8}::is_ascii_uppercase` - `{char,u8}::is_ascii_lowercase` - `{char,u8}::is_ascii_alphanumeric` - `{char,u8}::is_ascii_digit` - `{char,u8}::is_ascii_hexdigit` - `{char,u8}::is_ascii_punctuation` - `{char,u8}::is_ascii_graphic` - `{char,u8}::is_ascii_whitespace` - `{char,u8}::is_ascii_control`
2020-07-27update testsBastian Kauschke-1/+10
2020-07-27forbid generic params inside of anon consts in ty defaultsBastian Kauschke-8/+121
2020-07-27name `ParamInTyOfConstArg`Bastian Kauschke-5/+5
2020-07-27Auto merge of #74775 - RalfJung:miri-alloc-ids, r=oli-obkbors-122/+122
Miri: replace canonical_alloc_id mechanism by extern_static_alloc_id We only have to call `extern_static_alloc_id` when a `Pointer` is "imported" from the `tcx` to the machine, not on each access. Also drop the old hook for TLS handling, it is not needed any more. The Miri side of this is at https://github.com/rust-lang/miri/pull/1489. Fixes https://github.com/rust-lang/rust/issues/71194 r? @oli-obk
2020-07-27More ensure stack to avoid segfault with increased `recursion_limit`Yuki Okushi-18/+28
2020-07-27Auto merge of #74817 - JohnTitor:rollup-0fchdye, r=JohnTitorbors-37/+25
Rollup of 6 pull requests Successful merges: - #74088 (Avoid writes without any data in `Write::write_all_vectored`) - #74598 (Fix sync_once_cell_does_not_leak_partially_constructed_boxes) - #74750 (Clean up some uses of logging in ui tests) - #74783 (python codes cleanup) - #74790 (Don't italicize comments in ayu theme) - #74799 (Fixed typo in `closure`) Failed merges: r? @ghost