Commit graph

124200 commits

Author SHA1 Message Date
Jake Goulding
4c69d4bc05 Add the aarch64-apple-darwin target
This is a basic copy-paste-modify from the existing
x86_64-apple-darwin target.
2020-07-20 20:33:14 -04:00
Andy Russell
7f3e2c0d37
refactor and reword intra-doc link errors
This commit refactors intra-doc link error reporting to deduplicate code
and decouple error construction from the type of error. This greatly
improves flexibility at each error construction site, while reducing the
complexity of the diagnostic creation.

This commit also rewords the diagnostics for clarity and style:

- Diagnostics should not end in periods.
- It's unnecessary to say "ignoring it". Since this is a warning by
  default, it's already clear that the link is ignored.
2020-07-20 18:44:15 -04:00
bors
734233d297 Auto merge of #74569 - Manishearth:rollup-hkn5ex9, r=Manishearth
Rollup of 13 pull requests

Successful merges:

 - #72714 (Fix debug assertion in typeck)
 - #73197 (Impl Default for ranges)
 - #73323 (wf: check foreign fn decls for well-formedness)
 - #74051 (disallow non-static lifetimes in const generics)
 - #74376 (test caching opt_const_param_of on disc)
 - #74501 (Ayu theme: Use different background color for Run button)
 - #74505 (Fix search input focus in ayu theme)
 - #74522 (Update sanitizer docs)
 - #74546 (Fix duplicate maybe_uninit_extra attribute)
 - #74552 (Stabilize TAU constant.)
 - #74555 (Improve "important traits" popup display on mobile)
 - #74557 (Fix an ICE on an invalid `binding @ ...` in a tuple struct pattern)
 - #74561 (update backtrace-rs)

Failed merges:

r? @ghost
2020-07-20 21:38:46 +00:00
Bastian Kauschke
cfcbca6c69 update coherence docs 2020-07-20 23:18:06 +02:00
Bastian Kauschke
c71b196f66 review 2020-07-20 22:34:26 +02:00
Manish Goregaokar
df8d169c31
Rollup merge of #74561 - RalfJung:backtrace, r=alexcrichton
update backtrace-rs

Hopefully fixes https://github.com/rust-lang/rust/issues/74484
r? @alexcrichton
2020-07-20 12:30:34 -07:00
Manish Goregaokar
6bbf82ddd7
Rollup merge of #74557 - jakubadamw:issue-74539, r=nagisa
Fix an ICE on an invalid `binding @ ...` in a tuple struct pattern

Fixes #74539.
2020-07-20 12:30:32 -07:00
Manish Goregaokar
963b837a83
Rollup merge of #74555 - GuillaumeGomez:important-traits-popup, r=Manishearth
Improve "important traits" popup display on mobile

I implemented what @XAMPPRocky suggested in the [internals thread topic](https://internals.rust-lang.org/t/feedback-on-important-traits-rustdoc-feature/12752/18). I can confirm it works nicely.

r? @Manishearth

@Manishearth: By the way: I realized that when you click on the "i", you have to click again to make the popup disappear. Do you want me to extend the popup removal to any click outside the popup?
2020-07-20 12:30:31 -07:00
Manish Goregaokar
810d322366
Rollup merge of #74552 - fusion-engineering-forks:stabilize-tau, r=dtolnay
Stabilize TAU constant.

Closes #66770.
2020-07-20 12:30:29 -07:00
Manish Goregaokar
b7357c4c90
Rollup merge of #74546 - jethrogb:jb/duplicate-attribute-maybe_uninit_extra, r=kennytm
Fix duplicate maybe_uninit_extra attribute

Introduced in #72414
2020-07-20 12:30:27 -07:00
Manish Goregaokar
15f8b80d95
Rollup merge of #74522 - tmiasko:sanitizer-docs, r=nikomatsakis
Update sanitizer docs

* Document AddressSanitizer memory leak detection defaults.
* Remove CC & CFLAGS from MemorySanitizer example - they are now unnecessary for pure Rust projects (backtrace-rs moved away from libbacktrace).
2020-07-20 12:30:25 -07:00
Manish Goregaokar
6467f6f494
Rollup merge of #74505 - Cldfire:fix-search-focus, r=GuillaumeGomez
Fix search input focus in ayu theme

Closes #74496.

Before:

![image](https://user-images.githubusercontent.com/13814214/87868463-d0c8fe80-c963-11ea-9003-aa578d869e98.png)

After:

![image](https://user-images.githubusercontent.com/13814214/87868467-dc1c2a00-c963-11ea-89a8-1280f68ff9df.png)
2020-07-20 12:30:24 -07:00
Manish Goregaokar
e0fae890ce
Rollup merge of #74501 - lzutao:css_run_border, r=GuillaumeGomez
Ayu theme: Use different background color for Run button

Make it clearer that there is a button Run there.

Demo in https://github.com/rust-lang/rust/pull/74501#issuecomment-660597377 .
2020-07-20 12:30:22 -07:00
Manish Goregaokar
6a4276d30c
Rollup merge of #74376 - lcnr:type-dependent-path-cleanup, r=eddyb
test caching opt_const_param_of on disc

Followup to #74113, implements parts of #74360

Tried caching `opt_const_param_of` on disk and adding an early exit if `tcx.dep_kind(def_id) != DefKind::AnonConst`.

Ended up causing a perf regression instead, so we just remove the FIXME and a short note to `opt_const_param_of`.

r? @eddyb
2020-07-20 12:30:20 -07:00
Manish Goregaokar
991da05c32
Rollup merge of #74051 - yodaldevoid:issue_60814, r=nikomatsakis
disallow non-static lifetimes in const generics

Disallow non-static lifetimes in const generics in order to to patch over an ICE caused when we encounter a non-static lifetime in a const generic during borrow checking. This restriction may be relaxed in the future, but we need more discussion before then, and in the meantime we should still deal with this ICE.

Fixes issue #60814
2020-07-20 12:30:18 -07:00
Manish Goregaokar
0897bc2403
Rollup merge of #73323 - davidtwco:issue-73252-wfcheck-foreign-fn-decl, r=ecstatic-morse
wf: check foreign fn decls for well-formedness

Fixes #73252 and fixes #73253.

This PR extends current well-formedness checking to apply to foreign function declarations, re-using the existing machinery for regular functions. In doing this, later parts of the compiler (such as the `improper_ctypes` lint) can rely on being operations not failing as a result of invalid code which would normally be caught earlier.
2020-07-20 12:30:16 -07:00
Manish Goregaokar
241374a93b
Rollup merge of #73197 - c410-f3r:ranges, r=dtolnay
Impl Default for ranges

Couldn't find an issue about it.

`Range` and friends probably can implement `Default` if `Idx: Default`. For example, the following would be possible:

```rust
#[derive(Default)]
struct Foo(core::ops::RangeToInclusive<u64>);

let _ = [1, 2, 3].get(core::ops::Range::default());

core::ops::RangeFrom::<u8>::default().take(20).for_each(|x| { dbg!(x); });

fn stuff<T: Default>() { let instance = T::default(); ... more stuff }
stuff::<core::ops::RangeTo<f32>>();
```

Maybe there are some concerns about safety or misunderstandings?
2020-07-20 12:30:14 -07:00
Manish Goregaokar
105cd49554
Rollup merge of #72714 - JohnTitor:debug-assert, r=nikomatsakis
Fix debug assertion in typeck

Fixes #72410
2020-07-20 12:30:12 -07:00
Santiago Pastorino
cf52d5fb87
Use forge links for prioritization procedure 2020-07-20 16:29:58 -03:00
aticu
40df8fd0fa Apply #66379 to *mut T as_ref 2020-07-20 20:39:17 +02:00
David Wood
4b99699c84
index: introduce and use FiniteBitSet
This commit introduces a `FiniteBitSet` type which replaces the manual
bit manipulation which was being performed in polymorphization.

Signed-off-by: David Wood <david@davidtw.co>
2020-07-20 19:35:37 +01:00
David Wood
b1f8bd6356
mir: use attribute over -Z polymorphize-errors
This commit replaces the `-Z polymorphize-errors` debugging flag with a
`#[rustc_polymorphize_error]` attribute for use on functions.

Signed-off-by: David Wood <david@davidtw.co>
2020-07-20 19:35:35 +01:00
David Wood
5ce29d3d6f
metadata: record unused_generic_params
This commit records the results of `unused_generic_params` in crate
metadata, hopefully improving performance.

Signed-off-by: David Wood <david@davidtw.co>
2020-07-20 19:35:34 +01:00
David Wood
f52c72948a
ty: normalize fn sigs before subst
This commit normalizes function signatures for instances before
substituting, a workaround for polymorphization considering
parameters unused when they show up in the signature, but not the
body (due to being normalized).

Unfortunately, this causes test output to change with the parallel
compiler only.

Signed-off-by: David Wood <david@davidtw.co>
2020-07-20 19:35:32 +01:00
David Wood
2989fea88a
mir: unused_generic_params query
This commit implements the `unused_generic_params` query, an initial
version of polymorphization which detects when an item does not use
generic parameters and is being needlessly monomorphized as a result.

Signed-off-by: David Wood <david@davidtw.co>
2020-07-20 19:35:30 +01:00
Matthew Jasper
45c01edaf2 Use ReEmpty(U0) as the implicit region bound in typeck 2020-07-20 18:50:09 +01:00
Jakub Adam Wieczorek
f5e5eb6f46 Fix an ICE on an invalid binding @ ... in a tuple struct pattern 2020-07-20 15:48:40 +00:00
Pietro Albini
750ad2097e
ci: upload non-macOS from GHA instead of Azure Pipelines 2020-07-20 17:43:48 +02:00
Pietro Albini
5e11ae4fc5
ci: allow RLA to pick the right PR number 2020-07-20 17:12:30 +02:00
Ralf Jung
4cbd265c11 update backtrace-rs 2020-07-20 16:44:46 +02:00
bors
f9a3086363 Auto merge of #74550 - matklad:rust-analyzer-2020-07-20, r=matklad
⬆️ rust-analyzer

r? @ghost
2020-07-20 13:42:20 +00:00
Guillaume Gomez
995d63ac73 Improve "important traits" popup display on mobile 2020-07-20 14:37:47 +02:00
Mara Bos
5d4147a965 Stabilize TAU constant.
Closes #66770.
2020-07-20 14:01:25 +02:00
Aleksey Kladov
ace3db00c6 ⬆️ rust-analyzer 2020-07-20 13:21:16 +02:00
Jethro Beekman
c8cdcc8e51 Fix duplicate maybe_uninit_extra attribute 2020-07-20 12:44:37 +02:00
David Wood
47756bb0fa
shim: adjust valid shim asserts
This commit makes valid shim asserts more specific - checking for the
specific types that are valid for a given type of shim - and removes
asserts for types which require substitutions.

Signed-off-by: David Wood <david@davidtw.co>
2020-07-20 11:23:32 +01:00
David Wood
19e849516e
debuginfo: add type metadata for params
This commit adds type metadata for generic parameters (that arise from
polymorphization). Generic parameter metadata is considered zero-sized
and named after the generic parameter.

Signed-off-by: David Wood <david@davidtw.co>
2020-07-20 11:23:31 +01:00
David Wood
5bf2c7d4fe
debuginfo: no type metadata if substs reqd
This commit skips generating debuginfo type metadata if substitutions
are required by the type. This avoids ICEs that result from layouts
of types with substitutions being computed.

Signed-off-by: David Wood <david@davidtw.co>
2020-07-20 11:23:29 +01:00
David Wood
842fa0ce3e
ty: add doc comments to Generics methods
This commit adds doc comments to the `param_at`, `region_param` and
`const_param` methods on the `Generics` struct.

Signed-off-by: David Wood <david@davidtw.co>
2020-07-20 11:23:27 +01:00
David Wood
b7c8b96e66 trait_sel: only test predicates w/ no substs
This commit modifies the `substitute_normalize_and_test_predicates`
query, renaming it to `impossible_predicates` and only checking
predicates which do not require substs. By making this change,
polymorphization doesn't have to explicitly support vtables.

Signed-off-by: David Wood <david@davidtw.co>
2020-07-20 11:23:26 +01:00
David Wood
ce7c48fa15
trait_sel: only test predicates w/ no substs
This commit modifies the `substitute_normalize_and_test_predicates`
query, renaming it to `impossible_predicates` and only checking
predicates which do not require substs. By making this change,
polymorphization doesn't have to explicitly support vtables.

Signed-off-by: David Wood <david@davidtw.co>
2020-07-20 11:23:26 +01:00
David Wood
c6ed442f40
ty: STILL_FURTHER_SPECIALIZABLE w/out prnt subst
This commit modifies the `STILL_FURTHER_SPECIALIZABLE` flag so that the
flag isn't set by the parent substs of closures or generators.

Signed-off-by: David Wood <david@davidtw.co>
2020-07-20 11:23:25 +01:00
David Wood
576deef691
mir: rename should_monomorphize_locally
This commit renames `should_monomorphize_locally` to
`should_codegen_locally` which better describes what the function
determines once polymorphization is added.

Signed-off-by: David Wood <david@davidtw.co>
2020-07-20 11:23:24 +01:00
David Wood
996bc9abb5
mir: avoid double substitution
This commit avoids a natural, free-range double substitution error by
monomorphizing the projection element before getting the type.

Signed-off-by: David Wood <david@davidtw.co>
2020-07-20 11:23:22 +01:00
bors
71384101ea Auto merge of #74010 - pierwill:pierwill-o-notation, r=GuillaumeGomez
Use italics for O notation

In documentation, I think it makes sense to italicize O notation (*O(n)*) as opposed to using back-ticks (`O(n)`). Visually, back-ticks focus the reader on the literal characters being used, making them ideal for representing code. Using italics, as far I can tell, more closely follows typographic conventions in mathematics and computer science.

Just a suggestion, of course! 😇
2020-07-20 10:19:58 +00:00
David Wood
ceac273e60
wf: check foreign fn decls for well-formedness
This commit extends current well-formedness checking to apply to foreign
function declarations, re-using the existing machinery for regular
functions. In doing this, later parts of the compiler (such as the
`improper_ctypes` lint) can rely on being operations not failing as a
result of invalid code which would normally be caught earlier.

Signed-off-by: David Wood <david@davidtw.co>
2020-07-20 10:28:12 +01:00
bors
05630b06fd Auto merge of #74540 - alexcrichton:std-no-backtrace, r=Mark-Simulacrum
std: Fix compilation without backtrace feature

This should hopefully handle #74484 but in any case fixes compilation of
the standard library without the `backtrace` feature. The need for this
feature is somewhat unclear now because the `backtrace` crate should
always compile (no more C code!) but we can handle that later if
necessary.
2020-07-20 06:09:42 +00:00
pierwill
76b8420168 Use italics for O notation
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2020-07-19 21:43:39 -07:00
bors
891e6fee57 Auto merge of #74543 - Manishearth:rollup-m5w6hyg, r=Manishearth
Rollup of 9 pull requests

Successful merges:

 - #73618 (Documentation for the false keyword)
 - #74486 (Improve Read::read_exact documentation)
 - #74514 (Do not clobber RUSTDOCFLAGS)
 - #74516 (do not try fetching the ancestors of errored trait impls)
 - #74520 (include backtrace folder in rust-src component)
 - #74523 (Improve documentation for `core::fmt` internals)
 - #74527 (Add myself to toolstate change notifications for rustfmt)
 - #74534 (Only skip impls of foreign unstable traits)
 - #74536 (fix documentation surrounding the `in` and `for` keywords)

Failed merges:

r? @ghost
2020-07-20 02:43:31 +00:00
Manish Goregaokar
27947b69f9
Rollup merge of #74536 - Nicholas-Baron:master, r=joshtriplett
fix documentation surrounding the `in` and `for` keywords

Addresses #74529

The `in` keyword incorrectly referenced the `Iterator` trait. This reference was changed to `IntoIterator` without changing the underlying link.

Additionally, the `IntoIterator` trait was referenced towards the end of the documentation for `for`. An additional reference was added earlier and broadened the existing documentation from any iterator to anything that can be turned into an iterator.
2020-07-19 19:12:45 -07:00