Commit Graph

124311 Commits

Author SHA1 Message Date
Joshua Nelson
0192fa4786 Make the default stage dependent on the subcommand
### 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-27 23:11:17 -04:00
Joshua Nelson
d34a1b0c1b Don't duplicate builder code
- Add Builder::new_internal
2020-07-27 23:11:17 -04:00
Who? Me?!
62fd2c81e3
Update outdated readme 2020-07-27 22:05:34 -05:00
Joshua Nelson
def6177708 Move look_for_tests to private_items_doc_tests 2020-07-27 23:03:56 -04:00
Joshua Nelson
617d10975e Separate missing_doc_code_examples from intra-doc links
These two lints have no relation other than both being nightly-only.
This allows stabilizing intra-doc links without stabilizing
missing_doc_code_examples.
2020-07-27 22:54:14 -04:00
bors
ac48e62db8 Auto merge of #73265 - mark-i-m:mv-std, r=Mark-Simulacrum,mark-i-m
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-28 00:51:53 +00:00
mark
2c31b45ae8 mv std libs to library/ 2020-07-27 19:51:13 -05:00
Tomasz Miąsko
821d50aa0c Make closures and generators a must use types
Warn about unused expressions with closure or generator type. This follows
existing precedence of must use annotations present on `FnOnce`, `FnMut`, `Fn`
traits, which already indirectly apply to closures in some cases, e.g.,:

```rust
fn f() -> impl FnOnce() {
    || {}
}

fn main() {
    // an existing warning: unused implementer of `std::ops::FnOnce` that must be used:
    f();

    // a new warning: unused closure that must be used:
    || {};
}
```
2020-07-28 00:00:00 +00:00
bors
9be8ffcb02 Auto merge of #73583 - anp:location-eq, r=dtolnay
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-27 22:38:25 +00:00
Joseph Ryan
cee8023c69
More requested changes 2020-07-27 17:34:17 -05:00
Nathaniel McCallum
25670749b4 Suppress debuginfo on naked function arguments
A function that has no prologue cannot be reasonably expected to support
debuginfo. In fact, the existing code (before this patch) would generate
invalid instructions that caused crashes. We can solve this easily by
just not emitting the debuginfo in this case.

Fixes https://github.com/rust-lang/rust/issues/42779
cc https://github.com/rust-lang/rust/issues/32408
2020-07-27 18:27:15 -04:00
Ximin Luo
e7089a97e7 rustbuild: refactor how the wrapper deals with exit codes 2020-07-27 23:22:07 +01:00
Ximin Luo
3dcab2922c rustbuild: format both Ok/Err separately, since Result doesn't do it 2020-07-27 22:44:48 +01:00
Ximin Luo
84896c7f09 rustbuild: use Display for exit status instead of Debug, see #74832 for justification 2020-07-27 22:06:04 +01:00
Joseph Ryan
3d707a008e
Make requested changes 2020-07-27 16:00:39 -05:00
Joseph Ryan
65bf5d5248
TODO -> FIXME 2020-07-27 16:00:39 -05:00
Joseph Ryan
a790952254
Pull out more types from html 2020-07-27 16:00:38 -05:00
Joseph Ryan
6a4396b98c
Extract Cache and other types from html module 2020-07-27 16:00:38 -05:00
Joseph Ryan
5bc97946ca
Refactor html backend to use generic interface 2020-07-27 16:00:38 -05:00
Joseph Ryan
c692ed468c
Move Error and RenderInfo out of html module 2020-07-27 16:00:38 -05:00
bors
76e83339bb Auto merge of #73503 - lcnr:forall-predicate-what-and-why-2, r=nikomatsakis
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-27 20:16:36 +00:00
Bastian Kauschke
602ef6bc0e clippy 2020-07-27 21:17:28 +02:00
Bastian Kauschke
833b1d84e8 cleanup 2020-07-27 21:12:51 +02:00
Bastian Kauschke
51cbcca2eb fix rustdoc 2020-07-27 21:12:51 +02:00
Bastian Kauschke
072cc45839 it works again 🎉 2020-07-27 21:11:19 +02:00
Bastian Kauschke
825cb5bdc9 fix rebase 2020-07-27 21:08:19 +02:00
Bastian Kauschke
cd9743b4d4 directly contain PredicateAtom in PredicateKind::ForAll 2020-07-27 21:08:14 +02:00
Bastian Kauschke
d8cf8ba5f7 introduce PredicateAtom 2020-07-27 21:07:37 +02:00
Bastian Kauschke
52af82bdb9 add reuse_or_mk_predicate 2020-07-27 21:07:37 +02:00
Bastian Kauschke
d030752f63 refactor query_outlives_constraints_into_obligations 2020-07-27 21:06:36 +02:00
Bastian Kauschke
3ba61922d2 this might be unqualified, but at least it's now quantified 2020-07-27 21:06:36 +02:00
Bastian Kauschke
562d478421 fix rustdoc 2020-07-27 21:06:36 +02:00
Bastian Kauschke
1151d62049 split ignore_qualifiers 2020-07-27 21:06:36 +02:00
Bastian Kauschke
c6c0d17c8d review 2020-07-27 21:06:36 +02:00
Bastian Kauschke
bbd581c583 fix elaborate for predicates with unbound variables 2020-07-27 21:06:36 +02:00
Bastian Kauschke
8d4c99ad88 clippy 2020-07-27 21:06:36 +02:00
Bastian Kauschke
b79f7fbda8 rustdoc 2020-07-27 21:06:36 +02:00
Bastian Kauschke
9852b42b58 PredicateKint -> PredicateKind, the beginning of the end 2020-07-27 21:06:36 +02:00
Bastian Kauschke
506f4308b7 progress 2020-07-27 21:06:35 +02:00
Bastian Kauschke
4c3b1e89cf elaborate 2020-07-27 21:06:35 +02:00
Bastian Kauschke
7f39b0c9ab subst_supertrait 2020-07-27 21:06:35 +02:00
Bastian Kauschke
1fda8c207e somewhat related cleanup 2020-07-27 21:06:35 +02:00
Bastian Kauschke
653f56af53 wf 2020-07-27 21:06:35 +02:00
Bastian Kauschke
c1d244ffd8 convert trivial predicates 2020-07-27 21:06:35 +02:00
Bastian Kauschke
fb36c8bc80 query_outlives_constraints_into_obligations 2020-07-27 21:06:35 +02:00
Bastian Kauschke
cd30894c2f anonymize_predicate 2020-07-27 21:06:35 +02:00
Matthew Jasper
1b33f39126 Handle trait/projection predicates with bound regions correctly 2020-07-27 21:06:35 +02:00
Bastian Kauschke
9a33b59154 minimal 2020-07-27 21:06:35 +02:00
Bastian Kauschke
104cb878e3 add PredicateKint, because who doesn't like bodging 2020-07-27 20:15:46 +02:00
bors
efc02b03d1 Auto merge of #74831 - Manishearth:rollup-ugw4pt4, r=Manishearth
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-27 16:21:09 +00:00