]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoApply suggestions from code review
Josh Stone [Thu, 6 Aug 2020 17:52:23 +0000 (10:52 -0700)]
Apply suggestions from code review

Flatten the INC definition to one line.

Co-authored-by: lzutao <taolzu@gmail.com>
3 years agoExpand RISCV pseudo-instructions to match LLVM 11
Josh Stone [Wed, 5 Aug 2020 18:34:58 +0000 (11:34 -0700)]
Expand RISCV pseudo-instructions to match LLVM 11

3 years agoUpgrade to LLVM 11 (rc2)
Josh Stone [Tue, 28 Jul 2020 19:16:41 +0000 (12:16 -0700)]
Upgrade to LLVM 11 (rc2)

3 years agoDon't make clang use gcc's include-fixed
Josh Stone [Mon, 20 Jul 2020 23:55:56 +0000 (16:55 -0700)]
Don't make clang use gcc's include-fixed

This was breaking `#include_next <limits.h>`, such that we weren't
getting definitions of `PATH_MAX` and `_POSIX_ARG_MAX`.

3 years agoTest new floating point bit casts
Dylan MacKenzie [Fri, 22 May 2020 01:51:47 +0000 (18:51 -0700)]
Test new floating point bit casts

3 years agoUse intra-doc link in `proc_macro`
LeSeulArtichaut [Sat, 22 Aug 2020 20:29:43 +0000 (22:29 +0200)]
Use intra-doc link in `proc_macro`

3 years agoUse intra-doc-links in `core::{raw, ffi, pin}`
LeSeulArtichaut [Sat, 22 Aug 2020 20:15:17 +0000 (22:15 +0200)]
Use intra-doc-links in `core::{raw, ffi, pin}`

3 years agoAdd `#![feature(const_float_classify)]` for `f64::classify` and friends
Dylan MacKenzie [Sat, 22 Aug 2020 19:25:39 +0000 (12:25 -0700)]
Add `#![feature(const_float_classify)]` for `f64::classify` and friends

3 years agoAdd `#![feature(const_float_bits_conv)]` for `f64::to_bits` and friends
Dylan MacKenzie [Sat, 22 Aug 2020 19:24:35 +0000 (12:24 -0700)]
Add `#![feature(const_float_bits_conv)]` for `f64::to_bits` and friends

3 years agoAuto merge of #75171 - amosonn:new_zeroed_slice, r=Amanieu
bors [Sat, 22 Aug 2020 18:46:42 +0000 (18:46 +0000)]
Auto merge of #75171 - amosonn:new_zeroed_slice, r=Amanieu

New zeroed slice

Add to #63291 the methods

```rust
impl<T> Box<[T]> { pub fn new_zeroed_slice(len: usize) -> Box<[MaybeUninit<T>]> {…} }
impl<T> Rc<[T]> { pub fn new_zeroed_slice(len: usize) -> Rc<[MaybeUninit<T>]> {…} }
impl<T> Arc<[T]> { pub fn new_zeroed_slice(len: usize) -> Arc<[MaybeUninit<T>]> {…} }
```

as suggested in https://github.com/rust-lang/rust/issues/63291#issuecomment-605511675 .

Also optimize `{Rc, Arc}::new_zeroed` to use `alloc_zeroed`, otherwise they are no more efficient than using `new_uninit` and zeroing the memory manually (which was the original implementation).

3 years agorustc_metadata: Move some code around to merge impls of `CrateMetadataRef`
Vadim Petrochenkov [Sat, 22 Aug 2020 18:38:56 +0000 (21:38 +0300)]
rustc_metadata: Move some code around to merge impls of `CrateMetadataRef`

3 years agoDo not forget capacity when collecting def path hashes
Vadim Petrochenkov [Sat, 22 Aug 2020 18:36:34 +0000 (21:36 +0300)]
Do not forget capacity when collecting def path hashes

3 years agoLazy decoding of DefPathTable from crate metadata (non-incremental case)
Aaron Hill [Wed, 29 Jul 2020 16:26:15 +0000 (12:26 -0400)]
Lazy decoding of DefPathTable from crate metadata (non-incremental case)

3 years agoTreat a NULL return from `dlsym` as an error on illumos
Dylan MacKenzie [Sat, 22 Aug 2020 18:13:32 +0000 (11:13 -0700)]
Treat a NULL return from `dlsym` as an error on illumos

This works around behavior observed on illumos in #74469, in which
foreign code (libc according to the OP) was racing with rustc to check
`dlerror`.

3 years agoRefactor dynamic library error checking on *nix
Dylan MacKenzie [Thu, 20 Aug 2020 21:34:40 +0000 (14:34 -0700)]
Refactor dynamic library error checking on *nix

The old code was checking `dlerror` more often than necessary, since the
return value of `dlopen` indicates whether an error occurred.

3 years agoAuto merge of #74566 - lzutao:guard, r=petrochenkov
bors [Sat, 22 Aug 2020 15:38:13 +0000 (15:38 +0000)]
Auto merge of #74566 - lzutao:guard, r=petrochenkov

Gate if-let guard feature

Enhanced on #74315. That PR is in crater queue so I don't want to push to it.

Close  #74232
cc #51114

3 years agoAuto merge of #75783 - denisvasilik:intra-doc-links-core-alloc, r=jyn514
bors [Sat, 22 Aug 2020 13:21:24 +0000 (13:21 +0000)]
Auto merge of #75783 - denisvasilik:intra-doc-links-core-alloc, r=jyn514

Move to intra-doc links for library/core/src/alloc/{layout, global, mod}.rs

Helps with #75080. The files already contained intra-doc links, so there are only minor changes.

@rustbot modify labels: T-doc, A-intra-doc-links, T-rustdoc

Known issues:

* [`handle_alloc_error`]: Link from `core` to `alloc` could not be resolved.
* [`slice`]: slice is a primitive type, but could not be resolved; had to use [`crate::slice`] instead.

3 years agofix dead links to wrapping_offset_from
Ralf Jung [Sat, 11 Jul 2020 14:35:48 +0000 (16:35 +0200)]
fix dead links to wrapping_offset_from

3 years agoremove feature gate from tests
Ralf Jung [Sat, 11 Jul 2020 12:19:07 +0000 (14:19 +0200)]
remove feature gate from tests

3 years agostabilize ptr_offset_from
Ralf Jung [Sat, 11 Jul 2020 11:07:39 +0000 (13:07 +0200)]
stabilize ptr_offset_from

3 years agoremove deprecated wrapping_offset_from
Ralf Jung [Sat, 11 Jul 2020 10:57:33 +0000 (12:57 +0200)]
remove deprecated wrapping_offset_from

3 years agooffset_from: also document same-provenance requirement
Ralf Jung [Sat, 11 Jul 2020 10:56:32 +0000 (12:56 +0200)]
offset_from: also document same-provenance requirement

3 years agoAuto merge of #75795 - matthiaskrgr:cargotest_clippy, r=Dylan-DPC
bors [Sat, 22 Aug 2020 11:07:03 +0000 (11:07 +0000)]
Auto merge of #75795 - matthiaskrgr:cargotest_clippy, r=Dylan-DPC

cargotest: fix clippy warnings

Fixes clippy::redundant_static_lifetimes and clippy::toplevel_ref_arg
I also replaced some .expect("") calls with .unwrap()s since there was no message passed by the .expect() anyway.

3 years agoLink to primitive instead of module
Denis Vasilik [Sat, 22 Aug 2020 10:16:03 +0000 (12:16 +0200)]
Link to primitive instead of module

3 years agocompiletest: fix a couple clippy lint findings
Matthias Krüger [Fri, 21 Aug 2020 20:02:42 +0000 (22:02 +0200)]
compiletest: fix a couple clippy lint findings

3 years agoAuto merge of #75790 - LeSeulArtichaut:std-intra-doc, r=jyn514
bors [Sat, 22 Aug 2020 08:54:29 +0000 (08:54 +0000)]
Auto merge of #75790 - LeSeulArtichaut:std-intra-doc, r=jyn514

Use intra-doc-links in `std::sync::*`

Helps with #75080.
r? @jyn514

3 years agoAuto merge of #75776 - GuillaumeGomez:missing-doc-examples-lint-improvements, r=jyn514
bors [Sat, 22 Aug 2020 06:51:13 +0000 (06:51 +0000)]
Auto merge of #75776 - GuillaumeGomez:missing-doc-examples-lint-improvements, r=jyn514

Missing doc examples lint improvements

Fixes #75719.

To be merged after #75718 (only the two last commits are from this PR).

Since you already reviewed #75718, I'll set you as reviewer here as well. :)

r? @jyn514

3 years agoAuto merge of #75772 - tmiasko:io-maybe-no, r=dtolnay
bors [Sat, 22 Aug 2020 04:39:15 +0000 (04:39 +0000)]
Auto merge of #75772 - tmiasko:io-maybe-no, r=dtolnay

Remove unused `Maybe` wrapper around raw standard streams

* Remove result type from raw standard streams constructors
* Make raw standard stream constructors const
* Remove wrapper type handling absent raw standard streams

cargo checked with:

```shell
env CC=true ./x.py check library/std/ \
  --target i686-unknown-linux-gnu \
  --target wasm32-unknown-emscripten \
  --target wasm32-wasi \
  --target x86_64-fortanix-unknown-sgx \
  --target x86_64-pc-windows-gnu \
  --target x86_64-unknown-cloudabi \
  --target x86_64-unknown-hermit \
  --target x86_64-unknown-linux-gnu \
  --target x86_64-uwp-windows-gnu \
  --target x86_64-wrs-vxworks
```

Note: Last target doesn't compile currently.

3 years agorustdoc: Only resolve traits in scope
Joshua Nelson [Sat, 8 Aug 2020 18:57:35 +0000 (14:57 -0400)]
rustdoc: Only resolve traits in scope

3 years agorustdoc: Cache traits implemented by a type
Joshua Nelson [Thu, 30 Jul 2020 01:11:14 +0000 (21:11 -0400)]
rustdoc: Cache traits implemented by a type

This avoids taking the slow path several thousand times in a row.

- Fallback to all traits if the traits in scope are unknown
- Use a rustdoc thread_local cache instead of a query

The set of traits implemented by a type is not stable across crates:
there could be new traits added in a new crate.

- Use DocContext instead of a thread-local

3 years agorustdoc: Add support for associated items even outside the impl itself
Joshua Nelson [Sat, 18 Jul 2020 20:48:03 +0000 (16:48 -0400)]
rustdoc: Add support for associated items even outside the impl itself

Previously, associated items would only be available for linking
directly on the `impl Trait for Type`. Now they can be used anywhere.

- Make `item` for resolve mandatory
- Refactor resolving associated items into a separate function
- Remove broken trait_item logic
- Don't skip the type namespace for associated items
- Only call `variant_field` for `TypeNS`
- Add test for associated items
- Use exhaustive matches instead of wildcards

Wildcards caused several bugs while implementing this.

3 years agorustdoc: Rename misleading function
Joshua Nelson [Sat, 18 Jul 2020 20:48:59 +0000 (16:48 -0400)]
rustdoc: Rename misleading function

- `is_associated` -> `is_type_alias`

`is_associated` is not a good name for what this is doing. If you look at
https://github.com/rust-lang/rust/pull/74489/files#diff-6a301d597807ee441a41e7237800563dR296,
is_associated() and as_assoc_kind() do completely different things, but
from the name it sounds like they're similar.

3 years agoresolve: Add public entrypoint `traits_in_module`
Joshua Nelson [Sat, 8 Aug 2020 17:37:44 +0000 (13:37 -0400)]
resolve: Add public entrypoint `traits_in_module`

- Consider the implicit prelude as well

3 years agoresolve: Split `ensure_traits` into a separate function
Joshua Nelson [Sat, 8 Aug 2020 17:21:19 +0000 (13:21 -0400)]
resolve: Split `ensure_traits` into a separate function

3 years agoresolve: Move `get_traits_in_module_containing_item` to Resolver
Joshua Nelson [Sat, 8 Aug 2020 17:06:45 +0000 (13:06 -0400)]
resolve: Move `get_traits_in_module_containing_item` to Resolver

3 years agoAuto merge of #75792 - matthiaskrgr:bootstrap_clippy, r=Dylan-DPC
bors [Sat, 22 Aug 2020 02:38:36 +0000 (02:38 +0000)]
Auto merge of #75792 - matthiaskrgr:bootstrap_clippy, r=Dylan-DPC

bootstrap: fix a couple of clippy lint warnings

clippy::print_literal
clippy::clone_on_copy
clippy::single_char_pattern
clippy::into_iter_on_ref
clippy::match_like_matches_macro

3 years agoAuto merge of #75797 - Dylan-DPC:rollup-lfeytr7, r=Dylan-DPC
bors [Sat, 22 Aug 2020 00:16:02 +0000 (00:16 +0000)]
Auto merge of #75797 - Dylan-DPC:rollup-lfeytr7, r=Dylan-DPC

Rollup of 12 pull requests

Successful merges:

 - #75705 (Move to intra-doc links for /library/core/src/intrinsics.rs)
 - #75711 (Split `astconv.rs` into its own submodule)
 - #75718 (Don't count variants/fields/consts/associated types in doc-coverage doc examples)
 - #75725 (Use intra-doc-links in `alloc`)
 - #75745 (Remove duplication in `fold_item`)
 - #75753 (Another motivation for CFG: return-oriented programming)
 - #75769 (Minor, remove double nesting of a test module)
 - #75771 (Extend normalization in const-eval-query-stack test)
 - #75781 (More inline asm register name fixups for LLVM)
 - #75782 (Convert core/src/str/pattern.rs to Intra-doc links)
 - #75787 (Use intra-doc-links in `core::ops::*`)
 - #75788 (MIR call terminator represents diverging calls too)

Failed merges:

 - #75773 (Introduce expect snapshot testing library into rustc)

r? @ghost

3 years agoRollup merge of #75788 - nagisa:mir-call-doccomment, r=wesleywiser
Dylan DPC [Sat, 22 Aug 2020 00:14:59 +0000 (02:14 +0200)]
Rollup merge of #75788 - nagisa:mir-call-doccomment, r=wesleywiser

MIR call terminator represents diverging calls too

@bors rollup=always

3 years agoRollup merge of #75787 - LeSeulArtichaut:core-intra-doc, r=jyn514
Dylan DPC [Sat, 22 Aug 2020 00:14:57 +0000 (02:14 +0200)]
Rollup merge of #75787 - LeSeulArtichaut:core-intra-doc, r=jyn514

Use intra-doc-links in `core::ops::*`

Helps with #75080.
r? @jyn514

3 years agoRollup merge of #75782 - GuillaumeGomez:more-links, r=jyn514
Dylan DPC [Sat, 22 Aug 2020 00:14:56 +0000 (02:14 +0200)]
Rollup merge of #75782 - GuillaumeGomez:more-links, r=jyn514

Convert core/src/str/pattern.rs to Intra-doc links

Part of #75080.

3 years agoRollup merge of #75781 - Amanieu:asm-fix, r=nagisa
Dylan DPC [Sat, 22 Aug 2020 00:14:54 +0000 (02:14 +0200)]
Rollup merge of #75781 - Amanieu:asm-fix, r=nagisa

More inline asm register name fixups for LLVM

Fixes #75761

r? @nagisa

3 years agoRollup merge of #75771 - tmiasko:const-eval-query-stack-normalize, r=jonas-schievink
Dylan DPC [Sat, 22 Aug 2020 00:14:52 +0000 (02:14 +0200)]
Rollup merge of #75771 - tmiasko:const-eval-query-stack-normalize, r=jonas-schievink

Extend normalization in const-eval-query-stack test

Builds with debuginfo have additional information in backtrace.

3 years agoRollup merge of #75769 - matklad:flatten, r=petrochenkov
Dylan DPC [Sat, 22 Aug 2020 00:14:50 +0000 (02:14 +0200)]
Rollup merge of #75769 - matklad:flatten, r=petrochenkov

Minor, remove double nesting of a test module

3 years agoRollup merge of #75753 - koutheir:patch-1, r=steveklabnik
Dylan DPC [Sat, 22 Aug 2020 00:14:49 +0000 (02:14 +0200)]
Rollup merge of #75753 - koutheir:patch-1, r=steveklabnik

Another motivation for CFG: return-oriented programming

3 years agoRollup merge of #75745 - jyn514:refactor-resolve, r=Manishearth
Dylan DPC [Sat, 22 Aug 2020 00:14:47 +0000 (02:14 +0200)]
Rollup merge of #75745 - jyn514:refactor-resolve, r=Manishearth

Remove duplication in `fold_item`

r? @Manishearth

3 years agoRollup merge of #75725 - LeSeulArtichaut:alloc-intra-doc, r=jyn514
Dylan DPC [Sat, 22 Aug 2020 00:14:45 +0000 (02:14 +0200)]
Rollup merge of #75725 - LeSeulArtichaut:alloc-intra-doc, r=jyn514

Use intra-doc-links in `alloc`

I didn't have time to test this, so I will let the CI do it for me.

r? @jyn514 cc #75080

3 years agoRollup merge of #75718 - GuillaumeGomez:coverage-ui-doc-examples-count, r=jyn514
Dylan DPC [Sat, 22 Aug 2020 00:14:44 +0000 (02:14 +0200)]
Rollup merge of #75718 - GuillaumeGomez:coverage-ui-doc-examples-count, r=jyn514

Don't count variants/fields/consts/associated types in doc-coverage doc examples

Fixes #75714.

I think I'll need to update the equivalent lint too. Creating an issue for that!

r? @jyn514

3 years agoRollup merge of #75711 - CohenArthur:split-up-astconv, r=oli-obk
Dylan DPC [Sat, 22 Aug 2020 00:14:41 +0000 (02:14 +0200)]
Rollup merge of #75711 - CohenArthur:split-up-astconv, r=oli-obk

Split `astconv.rs` into its own submodule

Fixes #67418

This changed induced a few changes across the Type checker, but only there. Mostly, it was just renaming `Self::` into something else to call specific methods from a subtrait instead of having a 2500+ lines one.

I split up the `astconv.rs` file into its own module. This way, directives such as
```rust
use crate::astconv::AstConv;
```
are still valid, and doing
```rust
use crate::astconv::{AstConv, AstConvGeneric};
```
is possible

(instead of having two modules, one named `astconv_generic.rs` for example and `astconv.rs`)

I'm not entirely sure that the name `AstConvGeneric` is a good one. However, only methods related to lifetimes or generics have been moved over to this module. Sorry about the large diff.

I'd be very happy to make any correction you deem necessary.

r? @oli-obk

3 years agoRollup merge of #75705 - denisvasilik:intra-doc-links-intrinsics, r=jyn514
Dylan DPC [Sat, 22 Aug 2020 00:14:36 +0000 (02:14 +0200)]
Rollup merge of #75705 - denisvasilik:intra-doc-links-intrinsics, r=jyn514

Move to intra-doc links for /library/core/src/intrinsics.rs

Helps with #75080.

@rustbot modify labels: T-doc, A-intra-doc-links, T-rustdoc

Known issues:

* The following f32 and f64 primitive methods cannot be resolved:

    f32/f64::powi
    f32/f64::sqrt
    f32/f64::sin
    f32/f64::cos
    f32/f64::powf
    f32/f64::exp
    f32/f64::exp2
    f32/f64::ln
    f32/f64::log2
    f32/f64::log10
    f32/f64::mul_add
    f32/f64::abs
    f32/f64::copysign
    f32/f64::floor
    f32/f64::ceil
    f32/f64::trunc
    f32/f64::round

* Links from core to std:

    [`std::pointer::*`]
    [`std::process::abort`]
    [`from_raw_parts`]
    [`Vec::append`]

* Links with anchors?

I provided a separate commit that replaced links with anchors by intra-doc links.
Here the anchor location information gets lost, so its questionable whether to
actually replace those links.

3 years agoAdd partitioning -Z option to control which partitioning scheme is used
Wesley Wiser [Sun, 12 Jul 2020 02:32:42 +0000 (22:32 -0400)]
Add partitioning -Z option to control which partitioning scheme is used

3 years agoSplit partitioning.rs into a module
Wesley Wiser [Thu, 9 Jul 2020 02:16:06 +0000 (22:16 -0400)]
Split partitioning.rs into a module

3 years agoAdd a CGU partitioning trait
Wesley Wiser [Fri, 21 Aug 2020 23:28:21 +0000 (19:28 -0400)]
Add a CGU partitioning trait

This will allow us to prototype different partitioning schemes without
adding a lot of extra conditionals everywhere.

3 years agocargotest: fix clippy warnings
Matthias Krüger [Fri, 21 Aug 2020 23:49:36 +0000 (01:49 +0200)]
cargotest: fix clippy warnings

Fixes clippy::redundant_static_lifetimes and clippy::toplevel_ref_arg
I also replaced some .expect("") calls with .unwrap()s since there was no message passed by the .expect() anyway.

3 years agoUse intra-doc-links in `std::sync::*`
LeSeulArtichaut [Fri, 21 Aug 2020 22:26:28 +0000 (00:26 +0200)]
Use intra-doc-links in `std::sync::*`

3 years agobootstrap: fix a couple of clippy lint warnings
Matthias Krüger [Fri, 21 Aug 2020 23:08:04 +0000 (01:08 +0200)]
bootstrap: fix a couple of clippy lint warnings

clippy::print_literal
clippy::clone_on_copy
clippy::single_char_pattern
clippy::into_iter_on_ref
clippy::match_like_matches_macro

3 years agoAdd more links
Guillaume Gomez [Fri, 21 Aug 2020 18:43:36 +0000 (20:43 +0200)]
Add more links

3 years agoRemove links that get imported from the prelude
LeSeulArtichaut [Fri, 21 Aug 2020 21:25:07 +0000 (23:25 +0200)]
Remove links that get imported from the prelude

3 years agoUse intra-doc-links in `core::ops::*`
LeSeulArtichaut [Fri, 21 Aug 2020 20:34:21 +0000 (22:34 +0200)]
Use intra-doc-links in `core::ops::*`

3 years agoMIR call terminator represents diverging calls too
Simonas Kazlauskas [Fri, 21 Aug 2020 21:11:52 +0000 (00:11 +0300)]
MIR call terminator represents diverging calls too

3 years agoUpdate rc.rs
amosonn [Fri, 21 Aug 2020 20:25:09 +0000 (22:25 +0200)]
Update rc.rs

3 years agoUse intra-doc links
Denis Vasilik [Fri, 21 Aug 2020 19:41:43 +0000 (21:41 +0200)]
Use intra-doc links

3 years agoUse intra-doc links
Denis Vasilik [Fri, 21 Aug 2020 19:35:52 +0000 (21:35 +0200)]
Use intra-doc links

3 years agoAdd regression test
Amanieu d'Antras [Fri, 21 Aug 2020 18:52:48 +0000 (19:52 +0100)]
Add regression test

3 years agoAdded link to Microsoft's documentation of CFG
Dr. Koutheir Attouchi [Fri, 21 Aug 2020 18:52:30 +0000 (14:52 -0400)]
Added link to Microsoft's documentation of CFG

3 years agoFixed a typo
Dr. Koutheir Attouchi [Fri, 21 Aug 2020 18:47:18 +0000 (14:47 -0400)]
Fixed a typo

3 years agoConvert links to intra-doc links format
Guillaume Gomez [Fri, 21 Aug 2020 18:28:57 +0000 (20:28 +0200)]
Convert links to intra-doc links format

3 years agobump tidy to cargo_metadata 0.11
Jubilee Young [Fri, 21 Aug 2020 08:24:58 +0000 (01:24 -0700)]
bump tidy to cargo_metadata 0.11

Updates cargo_metadata in tidy's Cargo.toml from 0.9.1 to 0.11
Real version change 0.9.11 -> 0.11.1
https://github.com/oli-obk/cargo_metadata/compare/v0.9.1...v0.11.1

3 years agoAuto merge of #75708 - JohnTitor:stay-cool-full-bootstrap-builder, r=pietroalbini
bors [Fri, 21 Aug 2020 17:43:27 +0000 (17:43 +0000)]
Auto merge of #75708 - JohnTitor:stay-cool-full-bootstrap-builder, r=pietroalbini

Remove the full-bootstrap builder from CI

Fixes #75198

3 years agoMore inline asm register name fixups for LLVM
Amanieu d'Antras [Fri, 21 Aug 2020 17:42:06 +0000 (18:42 +0100)]
More inline asm register name fixups for LLVM

Fixes #75761

3 years agoApply suggestions from code review
LeSeulArtichaut [Fri, 21 Aug 2020 11:09:32 +0000 (13:09 +0200)]
Apply suggestions from code review

Co-authored-by: Joshua Nelson <joshua@yottadb.com>
3 years agoRework imports used solely for docs
Denis Vasilik [Fri, 21 Aug 2020 17:19:58 +0000 (19:19 +0200)]
Rework imports used solely for docs

3 years agoApply auto-formatter
Denis Vasilik [Fri, 21 Aug 2020 16:50:09 +0000 (18:50 +0200)]
Apply auto-formatter

3 years agoIncorporate suggestions from review
Denis Vasilik [Fri, 21 Aug 2020 16:35:17 +0000 (18:35 +0200)]
Incorporate suggestions from review

3 years agoStrenghten tests for missing_doc_code_examples lint
Guillaume Gomez [Fri, 21 Aug 2020 16:05:51 +0000 (18:05 +0200)]
Strenghten tests for missing_doc_code_examples lint

3 years agoUnify checks for lint missing_doc_code_examples and --show-coverage
Guillaume Gomez [Fri, 21 Aug 2020 13:33:34 +0000 (15:33 +0200)]
Unify checks for lint missing_doc_code_examples and --show-coverage

3 years agoAuto merge of #75694 - RalfJung:miri-align-to, r=nagisa
bors [Fri, 21 Aug 2020 15:40:48 +0000 (15:40 +0000)]
Auto merge of #75694 - RalfJung:miri-align-to, r=nagisa

enable align_to tests in Miri

With https://github.com/rust-lang/miri/issues/1074 resolved, we can enable these tests in Miri.

I also tweaked the test sized to get reasonable execution times with decent test coverage.

3 years agoShow line even if there is no code examples
Guillaume Gomez [Fri, 21 Aug 2020 14:43:04 +0000 (16:43 +0200)]
Show line even if there is no code examples

3 years agoIgnore more kind of items for doc examples
Guillaume Gomez [Fri, 21 Aug 2020 11:51:03 +0000 (13:51 +0200)]
Ignore more kind of items for doc examples

3 years agoMinor, remove double nesting of a test module
Aleksey Kladov [Fri, 21 Aug 2020 11:30:39 +0000 (13:30 +0200)]
Minor, remove double nesting of a test module

3 years agoRemove wrapper type handling absent raw standard streams
Tomasz Miąsko [Fri, 21 Aug 2020 00:00:00 +0000 (00:00 +0000)]
Remove wrapper type handling absent raw standard streams

Raw standard streams are always available.  Remove unused wrapper type
that was supposed to be responsible for handling their absence.

3 years agoMake raw standard stream constructors const
Tomasz Miąsko [Thu, 20 Aug 2020 00:00:00 +0000 (00:00 +0000)]
Make raw standard stream constructors const

3 years agoRemove result type from raw standard streams constructors
Tomasz Miąsko [Thu, 20 Aug 2020 00:00:00 +0000 (00:00 +0000)]
Remove result type from raw standard streams constructors

Raw standard streams constructors are infallible. Remove unnecessary
result type.

3 years agoAuto merge of #75697 - lzutao:mir-dumb-const-prefix, r=oli-obk
bors [Fri, 21 Aug 2020 11:08:31 +0000 (11:08 +0000)]
Auto merge of #75697 - lzutao:mir-dumb-const-prefix, r=oli-obk

Suppress "const" prefix of FnDef constants in MIR dump

I [was asked][1] to suppress the `const` infront of `FnDef`.
I tried to suppress comments for other types, but turned out that `const ()` and `()` is different: https://github.com/rust-lang/rust/pull/75697#discussion_r473892806

[1]: https://github.com/rust-lang/rust/pull/75670#issuecomment-675574333

3 years agoastconv: Split astconv.rs into its own module with submodules
CohenArthur [Wed, 19 Aug 2020 17:07:03 +0000 (19:07 +0200)]
astconv: Split astconv.rs into its own module with submodules

To separate the astconv.rs file, I split it into its own module with a
subtrait called GenericAstConv. This subtrait handles methods related to
generics, be it types or lifetimes.

typeck: Add bounds module and Bounds struct

bounds: Run fmt, add documentation

generic_astconv: Add subtrait GenericAstConv

Some methods of AstConv deal exclusively with Generics. Therefore, it
makes sense to have them in their own trait. Some other methods from
AstConv might be added to it later

generic_astconv: Add more methods from AstConv

Add check_generic_arg_count_for_call() and check_generic_arg_count()

astconv: Add module for clarity

generic: Rename GenericAstConv -> AstConvGeneric

generic: add more methods to AstConvGeneric

astconv: Remove AstConvGeneric trait, add impl dyn AstConv in other
module

astconv: Add errors module to handle AstConv complaints

fmt: format code in astconv/

astconv: Remove old file

astconv: Fix visibility on GenericArgPosition

astconv: Fix visibility on GenericArgPosition

astconv: Fix function visibility on other originally private functions

3 years agoAuto merge of #75765 - JohnTitor:rollup-lexaoa9, r=JohnTitor
bors [Fri, 21 Aug 2020 09:00:49 +0000 (09:00 +0000)]
Auto merge of #75765 - JohnTitor:rollup-lexaoa9, r=JohnTitor

Rollup of 5 pull requests

Successful merges:

 - #75324 (clarify documentation of remove_dir errors)
 - #75532 (Fix RFC-1014 test)
 - #75664 (Update mailmap for mati865)
 - #75727 (Switch to intra-doc links in `core::result`)
 - #75750 (Move to intra doc links for std::thread documentation)

Failed merges:

r? @ghost

3 years agoRollup merge of #75750 - poliorcetics:intra-links-std-thread, r=jyn514
Yuki Okushi [Fri, 21 Aug 2020 08:55:15 +0000 (17:55 +0900)]
Rollup merge of #75750 - poliorcetics:intra-links-std-thread, r=jyn514

Move to intra doc links for std::thread documentation

Helps with #75080.

@rustbot modify labels: T-doc, A-intra-doc-links, T-rustdoc

r? @jyn514

3 years agoRollup merge of #75727 - camelid:intra-doc-links-for-core-result, r=jyn514
Yuki Okushi [Fri, 21 Aug 2020 08:55:14 +0000 (17:55 +0900)]
Rollup merge of #75727 - camelid:intra-doc-links-for-core-result, r=jyn514

Switch to intra-doc links in `core::result`

Part of #75080.

@rustbot modify labels: A-intra-doc-links T-doc T-rustdoc

3 years agoRollup merge of #75664 - mati865:mailmap, r=Dylan-DPC
Yuki Okushi [Fri, 21 Aug 2020 08:55:12 +0000 (17:55 +0900)]
Rollup merge of #75664 - mati865:mailmap, r=Dylan-DPC

Update mailmap for mati865

3 years agoRollup merge of #75532 - tmiasko:rfc-1014, r=nikomatsakis
Yuki Okushi [Fri, 21 Aug 2020 08:55:10 +0000 (17:55 +0900)]
Rollup merge of #75532 - tmiasko:rfc-1014, r=nikomatsakis

Fix RFC-1014 test

Use two printlns when testing that writing to a closed stdout does not
panic. Otherwise the test is ineffective, since the current implementation
silently ignores the error during first println regardless.

3 years agoRollup merge of #75324 - ericseppanen:master, r=JohnTitor
Yuki Okushi [Fri, 21 Aug 2020 08:55:08 +0000 (17:55 +0900)]
Rollup merge of #75324 - ericseppanen:master, r=JohnTitor

clarify documentation of remove_dir errors

remove_dir will error if the path doesn't exist or isn't a directory.

It's useful to clarify that this is "remove dir or fail" not "remove dir
if it exists".

I don't think this belongs in the title. "Removes an existing, empty
directory" is strangely worded-- there's no such thing as a non-existing
directory.  Better to just say explicitly it will return an error.

3 years agoImprove wording
Guillaume Gomez [Fri, 21 Aug 2020 07:49:26 +0000 (09:49 +0200)]
Improve wording

3 years agoSwitched ROP link to Desktop layout instead of mobile layout
Dr. Koutheir Attouchi [Fri, 21 Aug 2020 07:34:25 +0000 (03:34 -0400)]
Switched ROP link to Desktop layout instead of mobile layout

3 years agoAuto merge of #75642 - matklad:lexer-comments, r=petrochenkov
bors [Fri, 21 Aug 2020 06:05:39 +0000 (06:05 +0000)]
Auto merge of #75642 - matklad:lexer-comments, r=petrochenkov

Move doc comment parsing to rustc_lexer

Plain comments are trivia, while doc comments are not, so it feels
like this belongs to the rustc_lexer.

The specific reason to do this is the desire to use rustc_lexer in
rustdoc for syntax highlighting, without duplicating "is this a doc
comment?" logic there.

r? @ghost

3 years agoAuto merge of #74846 - Aaron1011:fix/pat-token-capture, r=petrochenkov
bors [Fri, 21 Aug 2020 02:16:35 +0000 (02:16 +0000)]
Auto merge of #74846 - Aaron1011:fix/pat-token-capture, r=petrochenkov

Capture tokens for Pat used in macro_rules! argument

This extends PR #73293 to handle patterns (Pat). Unlike expressions,
patterns do not support custom attributes, so we only need to capture
tokens during macro_rules! argument parsing.

3 years agoSuppress "const" prefix of FnDef in MIR dump
Lzu Tao [Thu, 20 Aug 2020 09:44:20 +0000 (09:44 +0000)]
Suppress "const" prefix of FnDef in MIR dump

3 years agoExtend normalization in const-eval-query-stack test
Tomasz Miąsko [Fri, 21 Aug 2020 00:00:00 +0000 (00:00 +0000)]
Extend normalization in const-eval-query-stack test

Builds with debuginfo have additional information in backtrace.

3 years agoAuto merge of #73565 - matthewjasper:core-min-spec, r=nagisa
bors [Thu, 20 Aug 2020 23:05:31 +0000 (23:05 +0000)]
Auto merge of #73565 - matthewjasper:core-min-spec, r=nagisa

Use min_specialization in libcore

Getting `TrustedRandomAccess` to work is the main interesting thing here.

- `get_unchecked` is now an unstable, hidden method on `Iterator`
- The contract for `TrustedRandomAccess` is made clearer in documentation
- Fixed a bug where `Debug` would create aliasing references when using the specialized zip impl
- Added tests for the side effects of `next_back` and `nth`.

closes #68536

3 years agoAnother motivation for CFG: return-oriented programming
Dr. Koutheir Attouchi [Thu, 20 Aug 2020 22:54:40 +0000 (18:54 -0400)]
Another motivation for CFG: return-oriented programming

3 years agoUse intra-doc-links in `alloc`
LeSeulArtichaut [Thu, 20 Aug 2020 21:43:46 +0000 (23:43 +0200)]
Use intra-doc-links in `alloc`

3 years agoAuto merge of #75494 - matthewjasper:defer-recursive-projection-error, r=nikomatsakis
bors [Thu, 20 Aug 2020 20:27:22 +0000 (20:27 +0000)]
Auto merge of #75494 - matthewjasper:defer-recursive-projection-error, r=nikomatsakis

Don't immediately error for cycles during normalization

#73452 meant some normalization cycles could be detected earlier, breaking some code.
This PR makes defers errors for normalization cycles to fulfillment, fixing said code.

Fixes #74868

r? @nikomatsakis