Commit Graph

124186 Commits

Author SHA1 Message Date
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
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
Manish Goregaokar
539ba96c18
Rollup merge of #74822 - JohnTitor:no-sigsegv, r=oli-obk
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-27 09:20:20 -07:00
Manish Goregaokar
c9cdc87d8b
Rollup merge of #74803 - infinity0:fix-exec, r=nagisa
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-27 09:20:18 -07:00
Manish Goregaokar
e0543409d5
Rollup merge of #74487 - lcnr:const-in-ty-default, r=varkor
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-27 09:20:16 -07:00
Manish Goregaokar
7864c3f5fa
Rollup merge of #73858 - tspiteri:const-methods, r=oli-obk
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-27 09:20:15 -07:00
Bastian Kauschke
952fd0ce58 update tests 2020-07-27 16:41:27 +02:00
Bastian Kauschke
33a05b40f7 forbid generic params inside of anon consts in ty defaults 2020-07-27 16:33:23 +02:00
Bastian Kauschke
cb19cdb711 name ParamInTyOfConstArg 2020-07-27 16:33:23 +02:00
bors
4a90e36c85 Auto merge of #74775 - RalfJung:miri-alloc-ids, r=oli-obk
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-27 13:07:46 +00:00
Yuki Okushi
00b380b8ca
More ensure stack to avoid segfault with increased recursion_limit 2020-07-27 21:03:42 +09:00
bors
52d2c7ac94 Auto merge of #74817 - JohnTitor:rollup-0fchdye, r=JohnTitor
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
2020-07-27 11:07:32 +00:00
Ralf Jung
b8fd0f6a13 rename eval_const_to_op -> const_to_op 2020-07-27 13:01:01 +02:00
Yuki Okushi
7df242dd09
Rollup merge of #74799 - Dhs92:master, r=joshtriplett
Fixed typo in `closure`
2020-07-27 19:32:02 +09:00
Yuki Okushi
0042e41181
Rollup merge of #74790 - Cldfire:ayu-no-italic-comments, r=GuillaumeGomez
Don't italicize comments in ayu theme

Closes #74770.

Before:

![image](https://user-images.githubusercontent.com/13814214/88486217-2bf18700-cf4a-11ea-896d-e7787b94e7a7.png)

After:

![image](https://user-images.githubusercontent.com/13814214/88486225-3a3fa300-cf4a-11ea-929f-90461799dc01.png)
2020-07-27 19:32:00 +09:00
Yuki Okushi
807d221ddd
Rollup merge of #74783 - jnozsc:python_cleanup, r=Mark-Simulacrum
python codes cleanup
2020-07-27 19:31:58 +09:00
Yuki Okushi
72aad35649
Rollup merge of #74750 - oli-obk:logging_and_test_cleanups, r=JohnTitor
Clean up some uses of logging in ui tests

The removed test can't possibly trigger anything today as we don't have logging in libstd.

The `exec-env` flag was mistakenly used for adding env vars to rustc invocations both in test and in the test suite and there were some accidental renames from RUST_LOG to RUSTC_LOG that I reverted.
2020-07-27 19:31:56 +09:00
Yuki Okushi
ba3c245227
Rollup merge of #74598 - mzohreva:mz/fix-test, r=KodrAus
Fix sync_once_cell_does_not_leak_partially_constructed_boxes

Spinning multiple threads in this test causes a deadlock in
SGX where thread scheduling is not preemptive.

cc @jethrogb @AdrianCX
2020-07-27 19:31:55 +09:00
Yuki Okushi
1361b02c9f
Rollup merge of #74088 - tmiasko:write-all-vectored-empty, r=KodrAus
Avoid writes without any data in `Write::write_all_vectored`

Previously, when non-empty sequence of empty IoSlices have been provided
to `Write::write_all_vectored`, the buffers would be written as is with
`Write::write_vectored` and subsequently the return value `Ok(0)` would
be misinterpreted as an error.

Avoid writes without any data by advancing the buffers first. This
matches the documented behaviour of `Write::write_all_vectored`
and is analogous to what happens in `Write::write_all`.
2020-07-27 19:31:53 +09:00
bors
9af6b3d4e7 Auto merge of #74737 - smmalis37:astconv-factor, r=davidtwco
Pull out some duplicated code into a new function

I debated pulling the actual struct_span_err calls into the new method, but I felt like having to pass in multiple arguments for it and wiring up string formatting outweighed the benefits.

Viewing the diff with whitespace ignored is recommended.
2020-07-27 09:22:09 +00:00
bors
1841fb97e1 Auto merge of #74653 - petrochenkov:pmenv, r=dtolnay
proc_macro: Add API for tracked access to environment variables

Continuation of https://github.com/rust-lang/rust/pull/71858.

`proc_macro::tracked_env::var` is similar to regular `env::var` called from a proc macro, except that it also adds the accessed variable to depinfo.
2020-07-27 05:50:29 +00:00