Commit Graph

119752 Commits

Author SHA1 Message Date
Dylan DPC
8cb8d9cfe2
Rollup merge of #71165 - lcnr:patch-2, r=Amanieu
`slice::fill`: use `T` instead of generic arg

implements https://github.com/rust-lang/rust/issues/70758#issuecomment-613994427

As the discussion in #70758 has shifted, I now use `T` instead of `&T`.
2020-05-03 14:17:53 +05:30
bors
0a675c5e02 Auto merge of #71815 - Mark-Simulacrum:no-llvm-rebuild, r=jonas-schievink
Don't bust caches on x.py check/build switches

Fixes #71152
2020-05-03 02:58:00 +00:00
Esteban Küber
74b7ed78b1 trailing newlines 2020-05-02 18:24:08 -07:00
Esteban Küber
9bb5b549aa Add docs 2020-05-02 18:24:08 -07:00
Esteban Küber
b0085c86fc Suggest constraint on impl Trait in return type
Fix #71035.
2020-05-02 18:24:07 -07:00
Esteban Küber
6648a08b30 fix rebase 2020-05-02 18:24:07 -07:00
Esteban Küber
299bd12fe5 Point at associated types when they have a default type
Associated types with a default type in a trait can't be relied upon to
remain of that default type when in use, so literals of that type can't
be used in the trait's items. Point at the associated type and state
that information.

Reduce verbosity for associated consts of the wrong type.
2020-05-02 18:24:07 -07:00
Esteban Küber
ee96b8b119 review comment: use or patterns 2020-05-02 18:24:07 -07:00
Esteban Küber
31b3566196 When a projection is expected, suggest constraining or calling method 2020-05-02 18:24:07 -07:00
Esteban Küber
3a795fba03 On type mismatch involving associated type, suggest constraint
When an associated type is found when a specific type was expected, if
possible provide a structured suggestion constraining the associated
type in a bound.

```
error[E0271]: type mismatch resolving `<T as Foo>::Y == i32`
  --> $DIR/associated-types-multiple-types-one-trait.rs:13:5
   |
LL |     want_y(t);
   |     ^^^^^^ expected `i32`, found associated type
...
LL | fn want_y<T:Foo<Y=i32>>(t: &T) { }
   |                 ----- required by this bound in `want_y`
   |
   = note:         expected type `i32`
           found associated type `<T as Foo>::Y`
help: consider constraining the associated type `<T as Foo>::Y` to `i32`
   |
LL | fn have_x_want_y<T:Foo<X=u32, Y = i32>>(t: &T)
   |                             ^^^^^^^^^
```

```
error[E0308]: mismatched types
  --> $DIR/trait-with-missing-associated-type-restriction.rs:12:9
   |
LL |     qux(x.func())
   |         ^^^^^^^^ expected `usize`, found associated type
   |
   = note:         expected type `usize`
           found associated type `<impl Trait as Trait>::A`
help: consider constraining the associated type `<impl Trait as Trait>::A` to `usize`
   |
LL | fn foo(x: impl Trait<A = usize>) {
   |                     ^^^^^^^^^^
```
2020-05-02 18:23:46 -07:00
mibac138
8a77d1ca3f Add build script to rustc_attr because of cfg(version) 2020-05-03 02:42:12 +02:00
mibac138
a3ee28370f Add more tests for cfg(version) 2020-05-03 02:42:11 +02:00
mibac138
96f27c73cf Change cfg(version) error message wording 2020-05-03 02:42:10 +02:00
mibac138
90aa62a1bf Implement RFC 2523, #[cfg(version(..))] 2020-05-03 02:42:07 +02:00
bors
c1e0552869 Auto merge of #71807 - Dylan-DPC:rollup-jvb8sd9, r=Dylan-DPC
Rollup of 7 pull requests

Successful merges:

 - #69274 (Implement RFC 2396: `#[target_feature]` 1.1)
 - #71767 (doc: make Stack and StackElement a little pretty)
 - #71772 (Mark query function as must_use.)
 - #71777 (cleanup: `config::CrateType` -> `CrateType`)
 - #71784 (Remove recommendation for unmaintained dirs crate)
 - #71785 (Update comment regarding SO_REUSEADDR on Windows)
 - #71787 (fix rustdoc warnings)

Failed merges:

r? @ghost
2020-05-02 23:35:09 +00:00
Mark Rousskov
7f645aba10 Don't skip building LLVM if already built 2020-05-02 18:43:55 -04:00
Mark Rousskov
131e120585 Extract stamp testing for LLVM
The extracted function can be used by the rest of bootstrap to detect if we've
already built an up-to-date LLVM (and so it's safe for us to either request it
or pretend it exists).
2020-05-02 18:25:45 -04:00
Dylan MacKenzie
14a2c8d042 Decode qualifs from defaulted trait associated consts 2020-05-02 14:46:22 -07:00
Dylan MacKenzie
bcc44b8e02 Test associated const default qualifs cross-crate
This also tests for the ICE in #71734
2020-05-02 14:46:22 -07:00
unexge
ef813ca95a Add stability attribute to E0539 error examples 2020-05-03 00:25:45 +03:00
bors
f05a524044 Auto merge of #69274 - LeSeulArtichaut:target-feature-11, r=hanna-kruppe
Implement RFC 2396: `#[target_feature]` 1.1

Tracking issue: #69098

r? @nikomatsakis
cc @gnzlbg @joshtriplett
2020-05-02 20:24:50 +00:00
unexge
9536567210 Add #![feature(staged_api)] attribute to E0539 error examples 2020-05-02 23:10:34 +03:00
Esteban Küber
16a0349571 Do not try to find binop method on RHS TyErr
Fix #71798.
2020-05-02 12:50:57 -07:00
Charles Lew
f3ec00a5fe Add a fast code path to optimize confusable_idents lint for ASCII code base. 2020-05-03 02:31:13 +08:00
Charles Lew
c05961c2db Implement confusable_idents lint. 2020-05-03 02:30:50 +08:00
Bastian Kauschke
902aa62d51 slice::fill: take T by value. 2020-05-02 20:15:05 +02:00
unexge
e4ee172ab0 Add long error explanation for E0539 2020-05-02 21:14:08 +03:00
Eduard-Mihai Burtescu
926c7a298d typeck: always expose explicit enum discriminant AnonConsts' parent in generics_of. 2020-05-02 19:51:44 +03:00
Eduard-Mihai Burtescu
2c29f0cc8e typeck/wfcheck: require that explicit enum discriminants const-evaluate succesfully. 2020-05-02 19:51:38 +03:00
Dylan DPC
97cf378f54
Rollup merge of #71787 - tshepang:rustdoc-warnings, r=varkor
fix rustdoc warnings
2020-05-02 18:27:52 +02:00
Dylan DPC
5a7b21faba
Rollup merge of #71785 - reitermarkus:cfg-attribute, r=Mark-Simulacrum
Update comment regarding SO_REUSEADDR on Windows
2020-05-02 18:27:48 +02:00
Dylan DPC
94d2fd9205
Rollup merge of #71784 - Xaeroxe:patch-1, r=jonas-schievink
Remove recommendation for unmaintained dirs crate

See #71684 for reasoning here
2020-05-02 18:27:43 +02:00
Dylan DPC
590d201e0b
Rollup merge of #71777 - petrochenkov:crtype, r=Mark-Simulacrum
cleanup: `config::CrateType` -> `CrateType`
2020-05-02 18:27:39 +02:00
Dylan DPC
78dc7e15c9
Rollup merge of #71772 - cjgillot:ensure, r=petrochenkov
Mark query function as must_use.

And use the `ensure()` version when the result is not needed.
2020-05-02 18:27:35 +02:00
Dylan DPC
5747d1e000
Rollup merge of #71767 - tshepang:stack-stuff, r=jonas-schievink
doc: make Stack and StackElement a little pretty

Also, fix rustdoc warnings.
2020-05-02 18:27:31 +02:00
Dylan DPC
e96036fca2
Rollup merge of #69274 - LeSeulArtichaut:target-feature-11, r=hanna-kruppe
Implement RFC 2396: `#[target_feature]` 1.1

Tracking issue: #69098

r? @nikomatsakis
cc @gnzlbg @joshtriplett
2020-05-02 18:27:27 +02:00
bors
d20113d0f5 Auto merge of #71794 - RalfJung:miri, r=RalfJung
update Miri

This contains the concurrency support by @vakaras :)

Fixes https://github.com/rust-lang/rust/issues/71729
r? @ghost
Cc @rust-lang/miri
2020-05-02 16:24:51 +00:00
Bastian Kauschke
a691521867
typo 2020-05-02 18:16:36 +02:00
Eduard-Mihai Burtescu
50c63e48f1 ty: use delay_span_bug in ty::AdtDef::eval_explicit_discr. 2020-05-02 18:58:39 +03:00
Markus Reiter
39a97900be Replace cfg macro with attribute. 2020-05-02 17:06:16 +02:00
Simonas Kazlauskas
a569f2970a Update psm and stacker to 0.1.7 2020-05-02 16:47:56 +02:00
Simonas Kazlauskas
a5c5365031 Move ensure_sufficient_stack to data_structures
We anticipate this to have uses in all sorts of crates and keeping it in
`rustc_data_structures` enables access to it from more locations without
necessarily pulling in the large `librustc` crate.
2020-05-02 16:47:52 +02:00
Simonas Kazlauskas
968f442c7c Set the default stack size to 8MB
This was the value used before we originally started raising the stack
size to infinity.
2020-05-02 16:38:01 +02:00
Oliver Scherer
96c5012b57 Add psm to the crate whitelist 2020-05-02 16:38:01 +02:00
Oliver Scherer
26edcee093 Prevent stack overflow for deeply recursive code 2020-05-02 16:37:57 +02:00
bors
53d3bc02ed Auto merge of #70655 - oli-obk:subrepo_funness, r=Mark-Simulacrum
Make clippy a git subtree instead of a git submodule

r? @eddyb

cc #70651

documentation at https://github.com/rust-lang/rust/pull/70654
2020-05-02 13:19:30 +00:00
Ralf Jung
89666ab6b4 fix miri-unleash delayed sanity checking 2020-05-02 14:39:19 +02:00
Ralf Jung
17ca7a0e48 explain why we use def_span 2020-05-02 13:35:17 +02:00
Ralf Jung
08ba0145c7 make sure the miri-unleash-flag is not used to circumvent feature gates 2020-05-02 13:32:58 +02:00
bors
7184d137f6 Auto merge of #71795 - RalfJung:rollup-yqxfi5a, r=RalfJung
Rollup of 6 pull requests

Successful merges:

 - #71712 (Miri: port error backtraces to std::backtrace)
 - #71736 (bootstrap: also apply unused-attributes hack without deny_warnings)
 - #71738 (remove AllocId generalization of Pointer)
 - #71739 (remove obsolete comment)
 - #71781 (Uncomment test code for failure to use `Box::pin`)
 - #71782 (Use a non-existent test path instead of clobbering /dev/null)

Failed merges:

r? @ghost
2020-05-02 10:13:57 +00:00