Commit graph

136095 commits

Author SHA1 Message Date
Vadim Petrochenkov
0dab076358 rustc_parse: Better spans for synthesized token streams 2021-01-07 17:48:13 +03:00
Hanzhen Liang
f942c3cbf4 Return EOF_CHAR constant instead of magic char. 2021-01-07 13:20:04 +01:00
bors
b5c496de37 Auto merge of #79863 - JohnTitor:compiler-builtins, r=bjorn3
Update `compiler_builtins` to 0.1.39

This version contains the fixes of https://github.com/rust-lang/compiler-builtins/issues/390 and https://github.com/rust-lang/compiler-builtins/issues/391.
Also, rename features following https://github.com/rust-lang/compiler-builtins/pull/386.
2021-01-07 11:22:42 +00:00
Daiki Ihara
c71348a9c6 Refine E0435 description 2021-01-07 20:20:58 +09:00
Daiki Ihara
c9e7045e81 bless tests 2021-01-07 20:20:58 +09:00
Daiki Ihara
f03907b33f Add pointing const identifier when emitting E0435 2021-01-07 20:20:58 +09:00
bors
bf5f30684a Auto merge of #80648 - Aaron1011:expn-data-private, r=petrochenkov
Make `ExpnData` fields `krate` and `orig_id` private

These fields are only used by hygiene serialized, and should not be
accessed by anything outside of `rustc_span`.
2021-01-07 08:25:39 +00:00
Yuki Okushi
6275a29dbe Update compiler_builtins to 0.1.39 2021-01-07 16:16:36 +09:00
Ejez
2b8109f229
Improve wording of parse doc
Change:
```
`parse` can parse any type that...
```
to:
```
`parse` can parse into any type that...
```
Word `into` added to be more precise and in coherence with other parts of the doc.
2021-01-07 07:47:03 +03:00
bors
dfdfaa1f04 Auto merge of #80200 - mahkoh:dst-offset, r=nagisa
Optimize DST field access

For

    struct X<T: ?Sized>(T)
    struct Y<T: ?Sized>(u8, T)

the offset of the unsized field is

    0
    mem::align_of_val(&self.1)

respectively. This patch changes the expression used to compute these
offsets so that the optimizer can perform this optimization.

Consider

```rust
fn f(x: &X<dyn Any>) -> &dyn Any {
    &x.0
}
```

Before:

```asm
test:
	movq	%rsi, %rdx
	movq	16(%rsi), %rax
	leaq	-1(%rax), %rcx
	negq	%rax
	andq	%rcx, %rax
	addq	%rdi, %rax
	retq
```

After:

```asm
test:
	movq	%rsi, %rdx
	movq	%rdi, %rax
	retq
```
2021-01-07 03:13:21 +00:00
bors
5b3d52414e Auto merge of #80425 - camelid:resolve-moduledata-docs, r=petrochenkov
Document `ModuleData` and improve names

- Document `ModuleData`
- Rename `ModuleData.normal_ancestor_id` to `nearest_parent_mod`
- Rename `Resolver::nearest_mod_parent` to `nearest_parent_mod`

cc https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/mentoring/near/221029702

r? `@petrochenkov`
2021-01-07 00:31:09 +00:00
bors
d7769b9bea Auto merge of #80754 - sunfishcode:path-cleanup/rustc-fs-util, r=davidtwco
Optimize away a `fs::metadata` call.

This also eliminates a use of a `Path` convenience function, in support
of #80741, refactoring `std::path` to focus on pure data structures and
algorithms.
2021-01-06 21:48:06 +00:00
Camelid
ff75da89b1 Rename to nearest_parent_mod
* Rename `ModuleData.normal_ancestor_id` to `nearest_parent_mod`

`normal_ancestor_id` is a very confusing name if you don't already
understand what it means. Adding docs helps, but using a clearer and
more obvious name is also important.

* Rename `Resolver::nearest_mod_parent` to `nearest_parent_mod`

* Add more docs
2021-01-06 12:55:44 -08:00
Camelid
06931988c0 Document ModuleData
* Convert comments on fields to doc comments so they're visible in API
  docs
* Add new documentation
* Get rid of "normal module" terminology
2021-01-06 12:51:36 -08:00
bors
c2de47a9aa Auto merge of #80758 - RalfJung:miri, r=RalfJung
update Miri

update Miri to include fix for https://github.com/rust-lang/miri/issues/1643
Cc `@rust-lang/miri` r? `@ghost`
2021-01-06 18:56:48 +00:00
Ralf Jung
037c82c51d update Miri 2021-01-06 18:29:04 +01:00
Dan Gohman
68338bc2b0 Optimize away a fs::metadata call.
This also eliminates a use of a `Path` convenience function, in support
of #80741, refactoring `std::path` to focus on pure data structures and
algorithms.
2021-01-06 08:33:15 -08:00
Dan Gohman
304643c00d Optimize away some fs::metadata calls.
This also eliminates a use of a `Path` convenience function, in support
of #80741, refactoring `std::path` to focus on pure data structures and
algorithms.
2021-01-06 08:31:25 -08:00
Lzu Tao
8ee804dc2b Change related spec files to use the new enum 2021-01-06 13:34:20 +00:00
Lzu Tao
fa4d8bc878 Prefer enum Endian in rustc_target::Target 2021-01-06 13:34:19 +00:00
bors
8fec6c7bb9 Auto merge of #80714 - jakevossen5:master, r=lcnr
fixed const_generics error help

Closes https://github.com/rust-lang/rust/issues/80702
2021-01-06 10:25:18 +00:00
Guillaume Gomez
7bc22e96d3 Don't use to_string on Symbol 2021-01-06 10:59:50 +01:00
bors
9530fdc3f4 Auto merge of #80724 - GuillaumeGomez:remove-useless-doc_alias-feature, r=jyn514
Remove useless doc_alias feature gate

As `@jyn514`  rightfully noted in https://github.com/rust-lang/rust/pull/80686 , this feature is no more. Therefore, cleanup time!

r? `@jyn514`
2021-01-06 05:41:42 +00:00
Camelid
7428e2d134
Apply suggestions from code review
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2021-01-05 19:46:51 -08:00
Eric Huss
1a2ee0b4d9 Update cargo 2021-01-05 19:36:00 -08:00
Camelid
e636805eee rustdoc: Turn next_def_id comments into docs 2021-01-05 19:04:49 -08:00
bors
41601ef394 Auto merge of #80415 - cjgillot:issue-77828, r=petrochenkov
Compute parent module when collecting hir::MacroDef.

Fixes #77828.

r? `@jyn514`
2021-01-06 00:36:14 +00:00
Aru Sahni
aea9a4b449 Remove bottom margin from crate version when the sidebar is collapsed.
This fixes a mobile UI bug where a vertical scrollbar would always be
rendered on the sidebar nav when the menu was closed.
2021-01-05 18:53:23 -05:00
max-heller
2bdbb0d1b4 Document hackiness around primitive associated item disambiguators 2021-01-05 15:15:25 -05:00
Camille GILLOT
4fb12369b3 Do not swallow parent for MacroDef. 2021-01-05 21:10:35 +01:00
Camille GILLOT
abef2ed2bc Add rustdoc test. 2021-01-05 21:10:34 +01:00
Camille GILLOT
59f1ccd35c Compute parent module when collecting hir::MacroDef. 2021-01-05 21:10:34 +01:00
bors
da305a2b00 Auto merge of #80711 - camelid:intrinsic-of-val-safety, r=oli-obk
Make `size_of_val` and `min_align_of_val` intrinsics unsafe

Fixes #80668.

r? `@oli-obk`
2021-01-05 17:07:25 +00:00
Guillaume Gomez
bfdc858a38 Remove useless doc_alias feature 2021-01-05 16:20:46 +01:00
bors
3b63e16552 Auto merge of #80717 - mbartlett21:patch-2, r=dtolnay
Add more code spans to docs in intrinsics.rs

I have added some more code spans in core/src/intrinsics.rs, changing some `=` to `==`, etc. I also changed the wording in some sections.
2021-01-05 14:15:49 +00:00
bors
68ec332611 Auto merge of #80699 - usbalbin:const_copy_tracking_issue, r=oli-obk
const_intrinsic_copy - Add Reference to tracking issue

Add reference to tracking issue #80697 for feature gate added in previous PR #79684
2021-01-05 11:29:27 +00:00
bors
f4b9d32ef5 Auto merge of #80686 - GuillaumeGomez:error-doc-alias-same-name, r=jyn514
Error when #[doc(alias)] has same name as the item

Something I came across when reviewing some doc alias PRs.

r? `@jyn514`
2021-01-05 08:47:46 +00:00
mbartlett21
63dd00b97b
Add code spans to docs in intrinsics.rs 2021-01-05 17:27:10 +10:00
Jake Vossen
65f7dba622 fixed feature gate stderr 2021-01-05 00:02:39 -07:00
Jake Vossen
f37e737535 fixed const_generics error help 2021-01-05 00:01:48 -07:00
Camelid
bbf175df3c Make size_of_val and min_align_of_val intrinsics unsafe 2021-01-04 19:23:55 -08:00
bors
f412fb56b8 Auto merge of #80708 - JohnTitor:rollup-6esk027, r=JohnTitor
Rollup of 12 pull requests

Successful merges:

 - #80442 (Mention Arc::make_mut and Rc::make_mut in the documentation of Cow)
 - #80533 (bootstrap: clippy fixes)
 - #80538 (Add check for `[T;N]`/`usize` mismatch in astconv)
 - #80612 (Remove reverted change from relnotes)
 - #80627 (Builder: Warn if test file does not exist)
 - #80637 (Use Option::filter instead of open-coding it)
 - #80643 (Move variable into the only branch where it is relevant)
 - #80656 (Fixed documentation error for `std::hint::spin_loop`)
 - #80666 (Fix missing link for "fully qualified syntax")
 - #80672 (./x.py clippy: allow the most noisy lints)
 - #80677 (doc -- list edit for consistency)
 - #80696 (make sure that promoteds which fail to evaluate in dead const code behave correctly)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-01-05 03:06:32 +00:00
Yuki Okushi
9daac58ee9
Rollup merge of #80696 - RalfJung:failing-promoteds, r=oli-obk
make sure that promoteds which fail to evaluate in dead const code behave correctly

https://github.com/rust-lang/rust/pull/80243 showed that we'll have to live with these kinds of failing promoteds for a while, so let's make sure we have a test that covers them.
2021-01-05 09:52:52 +09:00
Yuki Okushi
ee94d9d690
Rollup merge of #80677 - kw-fn:patch-2, r=jyn514
doc -- list edit for consistency
2021-01-05 09:52:50 +09:00
Yuki Okushi
cb433736da
Rollup merge of #80672 - matthiaskrgr:xpy_clippy_less_noise, r=Mark-Simulacrum
./x.py clippy: allow the most noisy lints

This silences the following clippy lints in ./x.py clippy:

many_single_char_names (there are a lot of warnings caused by stdarch)
collapsible_if (can reduce readability)
type_complexity
missing_safety_doc (there are almost 3K warnings issued)
too_many_arguments
needless_lifetimes (people want 'tcx lifetimes etc)
wrong_self_convention (warns about from_..(), to_..(), into_..().. fns that do or do not take self by reference.

Just for clarification; this only changes the output of `x.py clippy` inside the rustc repo and does not change anything about clippy or how `cargo clippy` is run on peoples crates.
2021-01-05 09:52:49 +09:00
Yuki Okushi
cda26a6b15
Rollup merge of #80666 - jjlin:master, r=Dylan-DPC
Fix missing link for "fully qualified syntax"

This issue can currently be seen at https://doc.rust-lang.org/stable/std/rc/index.html#toggle-all-docs:~:text=%5B-,fully%20qualified%20syntax

It originates from #76138, where the link was added to `library/alloc/src/sync.rs`, but not `library/alloc/src/rc.rs`.
2021-01-05 09:52:47 +09:00
Yuki Okushi
cbdc24174b
Rollup merge of #80656 - booleancoercion:master, r=sfackler
Fixed documentation error for `std::hint::spin_loop`

Fixes #80644.
2021-01-05 09:52:45 +09:00
Yuki Okushi
598d189e9b
Rollup merge of #80643 - LingMan:unwrap, r=oli-obk
Move variable into the only branch where it is relevant

At the `if` branch `filter` (the `let` binding) is `None` iff `filter` (the parameter) was `None`.
We can branch on the parameter, move the binding into the `if`, and the complexity of handling
`Option<Option<_>` largely dissolves.

`@rustbot` modify labels +C-cleanup +T-compiler

Note: I have no idea how hot this code is. If this method frequently gets called with a `None` filter, there might be a small perf improvement.
2021-01-05 09:52:44 +09:00
Yuki Okushi
faf8beddef
Rollup merge of #80637 - LingMan:filter, r=oli-obk
Use Option::filter instead of open-coding it

`@rustbot` modify labels +C-cleanup +T-compiler
2021-01-05 09:52:42 +09:00
Yuki Okushi
1c6593c473
Rollup merge of #80627 - bugadani:warn, r=Mark-Simulacrum
Builder: Warn if test file does not exist

Running `./x.py test` with a file that does not exists (but where the path belongs to a test suite) silently ignores the missing file and runs the whole test suite. This PR prints a warning to reduce the potential surprise factor.

Closes #80621
2021-01-05 09:52:40 +09:00