]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agodon't convert types into identical types
Matthias Krüger [Sat, 11 Sep 2021 08:31:56 +0000 (10:31 +0200)]
don't convert types into identical types

example: let x: String = String::new().into();

2 years agoAuto merge of #88824 - Manishearth:rollup-7bzk9h6, r=Manishearth
bors [Sat, 11 Sep 2021 03:30:55 +0000 (03:30 +0000)]
Auto merge of #88824 - Manishearth:rollup-7bzk9h6, r=Manishearth

Rollup of 15 pull requests

Successful merges:

 - #85200 (Ignore derived Clone and Debug implementations during dead code analysis)
 - #86165 (Add proc_macro::Span::{before, after}.)
 - #87088 (Fix stray notes when the source code is not available)
 - #87441 (Emit suggestion when passing byte literal to format macro)
 - #88546 (Emit proper errors when on missing closure braces)
 - #88578 (fix(rustc): suggest `items` be borrowed in `for i in items[x..]`)
 - #88632 (Fix issues with Markdown summary options)
 - #88639 (rustdoc: Fix ICE with `doc(hidden)` on tuple variant fields)
 - #88667 (Tweak `write_fmt` doc.)
 - #88720 (Rustdoc coverage fields count)
 - #88732 (RustWrapper: avoid deleted unclear attribute methods)
 - #88742 (Fix table in docblocks)
 - #88776 (Workaround blink/chromium grid layout limitation of 1000 rows)
 - #88807 (Fix typo in docs for iterators)
 - #88812 (Fix typo `option` -> `options`.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

2 years agoAuto merge of #88823 - hyd-dev:miri, r=RalfJung
bors [Fri, 10 Sep 2021 15:51:58 +0000 (15:51 +0000)]
Auto merge of #88823 - hyd-dev:miri, r=RalfJung

Update Miri

Fixes #88768.

r? `@RalfJung`

2 years agoRollup merge of #88812 - gz:patch-1, r=ehuss
Manish Goregaokar [Fri, 10 Sep 2021 15:23:27 +0000 (08:23 -0700)]
Rollup merge of #88812 - gz:patch-1, r=ehuss

Fix typo `option` -> `options`.

2 years agoRollup merge of #88807 - jruderman:which_reverses, r=joshtriplett
Manish Goregaokar [Fri, 10 Sep 2021 15:23:26 +0000 (08:23 -0700)]
Rollup merge of #88807 - jruderman:which_reverses, r=joshtriplett

Fix typo in docs for iterators

2 years agoRollup merge of #88776 - dns2utf8:rustdoc_workaround_1000_elements_grid_bug, r=Guilla...
Manish Goregaokar [Fri, 10 Sep 2021 15:23:25 +0000 (08:23 -0700)]
Rollup merge of #88776 - dns2utf8:rustdoc_workaround_1000_elements_grid_bug, r=GuillaumeGomez

Workaround blink/chromium grid layout limitation of 1000 rows

I made this in case we don't come up with a better solution in time.

See https://github.com/rust-lang/rust/issues/88545 for more details.

A rendered version of the standard library is hosted here:
https://data.estada.ch/rustdoc-nightly_497ee321af_2021-09-09/core/arch/arm/index.html

r? `@GuillaumeGomez` `@jsha`

2 years agoRollup merge of #88742 - GuillaumeGomez:fix-table-in-docblocks, r=nbdd0121
Manish Goregaokar [Fri, 10 Sep 2021 15:23:24 +0000 (08:23 -0700)]
Rollup merge of #88742 - GuillaumeGomez:fix-table-in-docblocks, r=nbdd0121

Fix table in docblocks

"Overwrite" of #88702.

Instead of adding a z-index to the sidebar (which only hides the issue, doesn't fix it), I wrap `<table>` elements inside a `<div>` and limit all chidren of `.docblock` elements' width to prevent having the scrollbar on the whole doc block.

![Screenshot from 2021-09-08 15-11-24](https://user-images.githubusercontent.com/3050060/132515740-71796515-e74f-429f-ba98-2596bdbf781c.png)

Thanks `@nbdd0121` for `overflow-x: auto;`. ;)

r? `@notriddle`

2 years agoRollup merge of #88732 - durin42:llvm-14-attrs-2, r=nikic
Manish Goregaokar [Fri, 10 Sep 2021 15:23:23 +0000 (08:23 -0700)]
Rollup merge of #88732 - durin42:llvm-14-attrs-2, r=nikic

RustWrapper: avoid deleted unclear attribute methods

These were deleted in https://reviews.llvm.org/D108614, and in C++ I
definitely see the argument for their removal. I didn't try and
propagate the changes up into higher layers of rustc in this change
because my initial goal was to get rustc working against LLVM HEAD
promptly, but I'm happy to follow up with some refactoring to make the
API on the Rust side match the LLVM API more directly (though the way
the enum works in Rust makes the API less scary IMO).

r? ``@nagisa`` cc ``@nikic``

2 years agoRollup merge of #88720 - GuillaumeGomez:rustdoc-coverage-fields-count, r=Manishearth
Manish Goregaokar [Fri, 10 Sep 2021 15:23:22 +0000 (08:23 -0700)]
Rollup merge of #88720 - GuillaumeGomez:rustdoc-coverage-fields-count, r=Manishearth

Rustdoc coverage fields count

Follow-up of #88688.

Instead of requiring enum tuple variant fields and tuple struct fields to be documented, we count them if they are documented, otherwise we don't include them in the count.

r? `@Manishearth`

2 years agoRollup merge of #88667 - kraktus:patch-1, r=dtolnay
Manish Goregaokar [Fri, 10 Sep 2021 15:23:21 +0000 (08:23 -0700)]
Rollup merge of #88667 - kraktus:patch-1, r=dtolnay

Tweak `write_fmt` doc.

Found this weird sentence while reading the docs.

2 years agoRollup merge of #88639 - Emilgardis:fix-issue-88600, r=GuillaumeGomez
Manish Goregaokar [Fri, 10 Sep 2021 15:23:20 +0000 (08:23 -0700)]
Rollup merge of #88639 - Emilgardis:fix-issue-88600, r=GuillaumeGomez

rustdoc: Fix ICE with `doc(hidden)` on tuple variant fields

Fixes #88600.

```rust
pub struct H;
pub struct S;

pub enum FooEnum {
    HiddenTupleItem(#[doc(hidden)] H),
    MultipleHidden(#[doc(hidden)] H, #[doc(hidden)] H),
    MixedHiddenFirst(#[doc(hidden)] H, S),
    MixedHiddenLast(S, #[doc(hidden)] H),
    HiddenStruct {
        #[doc(hidden)]
        h: H,
        s: S,
    },
}
```

Generates
![image](https://user-images.githubusercontent.com/1502855/132259152-382f9517-c2a0-41d8-acd0-64e5993931fc.png)

2 years agoRollup merge of #88632 - camelid:md-opts, r=CraftSpider
Manish Goregaokar [Fri, 10 Sep 2021 15:23:19 +0000 (08:23 -0700)]
Rollup merge of #88632 - camelid:md-opts, r=CraftSpider

Fix issues with Markdown summary options

- Use `summary_opts()` for Markdown summaries
- Enable all main body Markdown options for summaries

2 years agoRollup merge of #88578 - notriddle:notriddle/suggest-add-reference-to-for-loop-iter...
Manish Goregaokar [Fri, 10 Sep 2021 15:23:18 +0000 (08:23 -0700)]
Rollup merge of #88578 - notriddle:notriddle/suggest-add-reference-to-for-loop-iter, r=nagisa

fix(rustc): suggest `items` be borrowed in `for i in items[x..]`

Fixes #87994

2 years agoRollup merge of #88546 - scrabsha:scrabsha/closure-missing-braces, r=estebank
Manish Goregaokar [Fri, 10 Sep 2021 15:23:17 +0000 (08:23 -0700)]
Rollup merge of #88546 - scrabsha:scrabsha/closure-missing-braces, r=estebank

Emit proper errors when on missing closure braces

This commit focuses on emitting clean errors for the following syntax
error:

```
Some(42).map(|a|
    dbg!(a);
    a
);
```

Previous implementation tried to recover after parsing the closure body
(the `dbg` expression) by replacing the next `;` with a `,`, which made
the next expression belong to the next function argument. As such, the
following errors were emitted (among others):
  - the semicolon token was not expected,
  - a is not in scope,
  - Option::map is supposed to take one argument, not two.

This commit allows us to gracefully handle this situation by adding
giving the parser the ability to remember when it has just parsed a
closure body inside a function call. When this happens, we can treat the
unexpected `;` specifically and try to parse as much statements as
possible in order to eat the whole block. When we can't parse statements
anymore, we generate a clean error indicating that the braces are
missing, and return an ExprKind::Err.

Closes #88065.

r? `@estebank`

2 years agoRollup merge of #87441 - ibraheemdev:i-86865, r=cjgillot
Manish Goregaokar [Fri, 10 Sep 2021 15:23:15 +0000 (08:23 -0700)]
Rollup merge of #87441 - ibraheemdev:i-86865, r=cjgillot

Emit suggestion when passing byte literal to format macro

Closes #86865

2 years agoRollup merge of #87088 - FabianWolff:issue-87060, r=estebank
Manish Goregaokar [Fri, 10 Sep 2021 15:23:15 +0000 (08:23 -0700)]
Rollup merge of #87088 - FabianWolff:issue-87060, r=estebank

Fix stray notes when the source code is not available

Fixes #87060. To reproduce it with a local build of rustc, you have to copy the compiler (e.g. `build/x86_64-unknown-linux-gnu/stage1/`) somewhere and then rename the compiler source directory (maybe there is a smarter way as well). Then, rustc won't find the standard library sources and report stray notes such as
```
note: deref defined here
```
with no location for "here". Another example I've found is this:
```rust
use std::ops::Add;

fn foo<T: Add<Output=()>>(x: T) {
    x + x;
}

fn main() {}
```
```
error[E0382]: use of moved value: `x`
  --> binop.rs:4:9
   |
3  | fn foo<T: Add<Output=()>>(x: T) {
   |                           - move occurs because `x` has type `T`, which does not implement the `Copy` trait
4  |     x + x;
   |     ----^
   |     |   |
   |     |   value used here after move
   |     `x` moved due to usage in operator
   |
note: calling this operator moves the left-hand side
help: consider further restricting this bound
   |
3  | fn foo<T: Add<Output=()> + Copy>(x: T) {
   |                          ^^^^^^

error: aborting due to previous error
```
where, again, the note is supposed to point somewhere but doesn't. I have fixed this by checking whether the corresponding source code is actually available before emitting the note.

2 years agoRollup merge of #86165 - m-ou-se:proc-macro-span-shrink, r=dtolnay
Manish Goregaokar [Fri, 10 Sep 2021 15:23:14 +0000 (08:23 -0700)]
Rollup merge of #86165 - m-ou-se:proc-macro-span-shrink, r=dtolnay

Add proc_macro::Span::{before, after}.

This adds `proc_macro::Span::before()` and `proc_macro::Span::after()` to get a zero width span at the start or end of the span.

These are equivalent to rustc's `Span::shrink_to_lo()` and `Span::shrink_to_hi()` but with a less cryptic name. They are useful when generating diagnostlics like "missing \<thing\> after \<thing\>".

E.g.

```rust
syn::Error::new(ident.span().after(), "missing `:` after field name").into_compile_error()
```

2 years agoRollup merge of #85200 - FabianWolff:issue-84647, r=nikomatsakis
Manish Goregaokar [Fri, 10 Sep 2021 15:23:13 +0000 (08:23 -0700)]
Rollup merge of #85200 - FabianWolff:issue-84647, r=nikomatsakis

Ignore derived Clone and Debug implementations during dead code analysis

This pull request fixes #84647. Derived implementations of `Clone` and `Debug` always trivially read all fields, so "field is never read" dead code warnings are never triggered. Arguably, though, a user most likely will only be interested in whether _their_ code ever reads those fields, which is the behavior I have implemented here.

Note that implementations of `Clone` and `Debug` are only ignored if they are `#[derive(...)]`d; a custom `impl Clone/Debug for ...` will still be analyzed normally (i.e. if a custom `Clone` implementation uses all fields of the struct, this will continue to suppress dead code warnings about unused fields); this seemed like the least intrusive change to me (although it would be easy to change — just drop the `&& [impl_]item.span.in_derive_expansion()` in the if conditions).

The only thing that I am slightly unsure about is that in #84647, `@matklad` said
> Doesn't seem easy to fix though :(

However, it _was_ pretty straightforward to fix, so did I perhaps overlook something obvious? `@matklad,` could you weigh in on this?

2 years agoUpdate Miri
hyd-dev [Fri, 10 Sep 2021 14:17:57 +0000 (22:17 +0800)]
Update Miri

2 years agoAuto merge of #88797 - m-ou-se:uhhhh, r=pietroalbini
bors [Fri, 10 Sep 2021 12:26:55 +0000 (12:26 +0000)]
Auto merge of #88797 - m-ou-se:uhhhh, r=pietroalbini

Work around CI issue with windows sdk 10.0.20348.0.

See https://github.com/rust-lang/rust/issues/88796#issuecomment-916844522

2 years agoTemporarily ignore some debuginfo tests on windows.
Mara Bos [Fri, 10 Sep 2021 12:08:19 +0000 (14:08 +0200)]
Temporarily ignore some debuginfo tests on windows.

2 years agoWork around CI issue with windows sdk 10.0.20348.0.
Mara Bos [Fri, 10 Sep 2021 11:46:15 +0000 (13:46 +0200)]
Work around CI issue with windows sdk 10.0.20348.0.

2 years agoAdd test for enum tuple variants and tuple struct doc count
Guillaume Gomez [Mon, 6 Sep 2021 14:27:09 +0000 (16:27 +0200)]
Add test for enum tuple variants and tuple struct doc count

2 years agoDon't require documentation for fields in an enum tuple variant or for tuple struct...
Guillaume Gomez [Mon, 6 Sep 2021 14:26:49 +0000 (16:26 +0200)]
Don't require documentation for fields in an enum tuple variant or for tuple struct fields.

2 years agoFix typo `option` -> `options`.
Gerd Zellweger [Fri, 10 Sep 2021 07:36:35 +0000 (00:36 -0700)]
Fix typo `option` -> `options`.

2 years agoFix typo in docs for iterators
Jesse Ruderman [Fri, 10 Sep 2021 02:21:56 +0000 (19:21 -0700)]
Fix typo in docs for iterators

2 years agoFix two uses of `span_note` when the source is not available
Fabian Wolff [Mon, 12 Jul 2021 16:08:14 +0000 (18:08 +0200)]
Fix two uses of `span_note` when the source is not available

2 years agoIgnore automatically derived impls of `Clone` and `Debug` in dead code analysis
Fabian Wolff [Fri, 21 May 2021 17:35:49 +0000 (19:35 +0200)]
Ignore automatically derived impls of `Clone` and `Debug` in dead code analysis

2 years agoEmit proper errors on missing closure braces
Sasha Pourcelot [Mon, 16 Aug 2021 13:22:36 +0000 (15:22 +0200)]
Emit proper errors on missing closure braces

This commit focuses on emitting clean errors for the following syntax
error:

```
Some(42).map(|a|
    dbg!(a);
    a
);
```

Previous implementation tried to recover after parsing the closure body
(the `dbg` expression) by replacing the next `;` with a `,`, which made
the next expression belong to the next function argument. As such, the
following errors were emitted (among others):
  - the semicolon token was not expected,
  - a is not in scope,
  - Option::map is supposed to take one argument, not two.

This commit allows us to gracefully handle this situation by adding
giving the parser the ability to remember when it has just parsed a
closure body inside a function call. When this happens, we can treat the
unexpected `;` specifically and try to parse as much statements as
possible in order to eat the whole block. When we can't parse statements
anymore, we generate a clean error indicating that the braces are
missing, and return an ExprKind::Err.

2 years agoWorkaround blink/chromium grid layout limitation of 1000 rows
Stefan Schindler [Thu, 9 Sep 2021 13:11:02 +0000 (15:11 +0200)]
Workaround blink/chromium grid layout limitation of 1000 rows

See https://github.com/rust-lang/rust/issues/88545 for more details

2 years agoAuto merge of #88676 - devnexen:fbsd_toolchain_upd, r=Mark-Simulacrum
bors [Thu, 9 Sep 2021 09:21:30 +0000 (09:21 +0000)]
Auto merge of #88676 - devnexen:fbsd_toolchain_upd, r=Mark-Simulacrum

update of the CI freebsd toolchain

adding libproctsta, for the upcoming libc update.

2 years agoAuto merge of #88748 - bjorn3:try_fix_perf_regression, r=wesleywiser
bors [Thu, 9 Sep 2021 06:16:04 +0000 (06:16 +0000)]
Auto merge of #88748 - bjorn3:try_fix_perf_regression, r=wesleywiser

Revert "Remove optimization_fuel_crate from Session"

This reverts commit 5464b2e713d5366b3aec5c6eebbe1b84a782c51e.

This hopefully fixes the perf regression in https://github.com/rust-lang/rust/pull/88530#issuecomment-915314117.

2 years agoAuto merge of #88752 - Mark-Simulacrum:bootstrap-bump, r=m-ou-se
bors [Thu, 9 Sep 2021 03:01:47 +0000 (03:01 +0000)]
Auto merge of #88752 - Mark-Simulacrum:bootstrap-bump, r=m-ou-se

Bump stage0 compiler to 1.56

r? `@pietroalbini` (but others should feel free to steal)

2 years agoBump stage0 compiler to 1.56
Mark Rousskov [Wed, 8 Sep 2021 17:13:47 +0000 (13:13 -0400)]
Bump stage0 compiler to 1.56

2 years agoAuto merge of #88615 - flip1995:clippyup, r=Manishearth
bors [Wed, 8 Sep 2021 23:52:31 +0000 (23:52 +0000)]
Auto merge of #88615 - flip1995:clippyup, r=Manishearth

Update Clippy

r? `@Manishearth`

2 years agoAuto merge of #80522 - cjgillot:borrowcrate, r=oli-obk
bors [Wed, 8 Sep 2021 20:42:42 +0000 (20:42 +0000)]
Auto merge of #80522 - cjgillot:borrowcrate, r=oli-obk

Split rustc_mir

The `rustc_mir` crate is the second largest in the compiler.
This PR splits it up into 5 crates:
- rustc_borrowck;
- rustc_const_eval;
- rustc_mir_dataflow;
- rustc_mir_transform;
- rustc_monomorphize.

2 years agoRebase fallout.
Camille GILLOT [Wed, 1 Sep 2021 19:05:35 +0000 (21:05 +0200)]
Rebase fallout.

2 years agoUpdate run-make-fulldeps.
Camille GILLOT [Thu, 2 Sep 2021 17:02:55 +0000 (19:02 +0200)]
Update run-make-fulldeps.

2 years agoAuto merge of #88750 - jackh726:rollup-w57i9fp, r=jackh726
bors [Wed, 8 Sep 2021 17:26:17 +0000 (17:26 +0000)]
Auto merge of #88750 - jackh726:rollup-w57i9fp, r=jackh726

Rollup of 9 pull requests

Successful merges:

 - #86263 (Rustdoc: Report Layout of enum variants)
 - #88541 (Add regression test for #74400)
 - #88553 (Improve diagnostics for unary plus operators (#88276))
 - #88594 (More symbolic doc aliases)
 - #88648 (Correct “copies” to “moves” in `<Option<T> as From<T>>::from` doc, and other copyediting)
 - #88691 (Add a regression test for #88649)
 - #88694 (Drop 1.56 stabilizations from 1.55 release notes)
 - #88712 (Fix docs for `uX::checked_next_multiple_of`)
 - #88726 (Fix typo in `const_generics` replaced with `adt_const_params` note)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

2 years agoRollup merge of #88726 - MingweiSamuel:patch-1, r=wesleywiser
Jack Huey [Wed, 8 Sep 2021 16:24:22 +0000 (12:24 -0400)]
Rollup merge of #88726 - MingweiSamuel:patch-1, r=wesleywiser

Fix typo in `const_generics` replaced with `adt_const_params` note

2 years agoRollup merge of #88712 - jhpratt:fix-int_rounding-docs, r=joshtriplett
Jack Huey [Wed, 8 Sep 2021 16:24:21 +0000 (12:24 -0400)]
Rollup merge of #88712 - jhpratt:fix-int_rounding-docs, r=joshtriplett

Fix docs for `uX::checked_next_multiple_of`

Thanks to `@photino` for noticing this [here](https://github.com/rust-lang/rust/issues/88581#issuecomment-913982246).

r? `@joshtriplett`

`@rustbot` label: +A-docs +A-waiting-on-review

2 years agoRollup merge of #88694 - Mark-Simulacrum:relnotes, r=Mark-Simulacrum
Jack Huey [Wed, 8 Sep 2021 16:24:20 +0000 (12:24 -0400)]
Rollup merge of #88694 - Mark-Simulacrum:relnotes, r=Mark-Simulacrum

Drop 1.56 stabilizations from 1.55 release notes

r? `@Mark-Simulacrum`

2 years agoRollup merge of #88691 - hyd-dev:88649, r=Mark-Simulacrum
Jack Huey [Wed, 8 Sep 2021 16:24:19 +0000 (12:24 -0400)]
Rollup merge of #88691 - hyd-dev:88649, r=Mark-Simulacrum

Add a regression test for #88649

I noticed that #88649 does not have a regression test, so I add one in this PR.

The test fails with this without #88678:
```
error[E0080]: evaluation of constant value failed
  --> /checkout/src/test/ui/consts/issue-88649.rs:13:52
   |
LL |             Foo::Variant1(x) | Foo::Variant2(x) if x => {}
   |                                                    ^ StorageLive on a local that was already live

error: aborting due to previous error

For more information about this error, try `rustc --explain E0080`.
```

2 years agoRollup merge of #88648 - kpreid:option, r=Mark-Simulacrum
Jack Huey [Wed, 8 Sep 2021 16:24:18 +0000 (12:24 -0400)]
Rollup merge of #88648 - kpreid:option, r=Mark-Simulacrum

Correct “copies” to “moves” in `<Option<T> as From<T>>::from` doc, and other copyediting

The `impl<T> From<T> for Option<T>` has no `Copy` or `Clone` bound, so its operation is guaranteed to be a move. The call site might copy, but the function itself cannot.

Since that would have been a rather small PR, I also reviewed the other documentation in the file and made other improvements (in separate commits): adding periods and commas, linking `Deref::Target`, and clarifying what "a container" is in `FromIterator`.

2 years agoRollup merge of #88594 - steffahn:more_symbolic_doc_aliases, r=joshtriplett
Jack Huey [Wed, 8 Sep 2021 16:24:17 +0000 (12:24 -0400)]
Rollup merge of #88594 - steffahn:more_symbolic_doc_aliases, r=joshtriplett

More symbolic doc aliases

A bunch of small changes, mostly adding `#[doc(alias = "…")]` entries for symbolic `"…"`.

Also a small change in documentation of `const` keywords.

2 years agoRollup merge of #88553 - theo-lw:issue-88276, r=estebank
Jack Huey [Wed, 8 Sep 2021 16:24:16 +0000 (12:24 -0400)]
Rollup merge of #88553 - theo-lw:issue-88276, r=estebank

Improve diagnostics for unary plus operators (#88276)

This pull request improves the diagnostics emitted on parsing a unary plus operator. See #88276.

Before:

```
error: expected expression, found `+`
 --> src/main.rs:2:13
  |
2 |     let x = +1;
  |             ^ expected expression
```

After:

```
error: leading `+` is not supported
 --> main.rs:2:13
  |
2 |     let x = +1;
  |             ^
  |             |
  |             unexpected `+`
  |             help: try removing the `+`
```

2 years agoRollup merge of #88541 - vandenheuvel:regression_test_74400, r=Mark-Simulacrum
Jack Huey [Wed, 8 Sep 2021 16:24:15 +0000 (12:24 -0400)]
Rollup merge of #88541 - vandenheuvel:regression_test_74400, r=Mark-Simulacrum

Add regression test for #74400

Closes #74400 by adding a regression test.

2 years agoRollup merge of #86263 - fee1-dead:rustdoc-layout-variants, r=camelid
Jack Huey [Wed, 8 Sep 2021 16:24:14 +0000 (12:24 -0400)]
Rollup merge of #86263 - fee1-dead:rustdoc-layout-variants, r=camelid

Rustdoc: Report Layout of enum variants

Followup of #83501, Fixes #86253.

cc `@camelid`

`@rustbot` label A-rustdoc

2 years agoRevert "Remove optimization_fuel_crate from Session"
bjorn3 [Wed, 8 Sep 2021 15:36:41 +0000 (17:36 +0200)]
Revert "Remove optimization_fuel_crate from Session"

This reverts commit 5464b2e713d5366b3aec5c6eebbe1b84a782c51e.

2 years agoRustWrapper: remove some uses of AttrBuilder
Augie Fackler [Wed, 8 Sep 2021 14:47:41 +0000 (10:47 -0400)]
RustWrapper: remove some uses of AttrBuilder

Turns out we can also use Attribute::get*() methods here, and avoid the
AttrBuilder and an extra helper method here.

2 years agoUpdate Cargo.lock
flip1995 [Wed, 8 Sep 2021 14:32:16 +0000 (16:32 +0200)]
Update Cargo.lock

2 years agoMerge commit '27afd6ade4bb1123a8bf82001629b69d23d62aff' into clippyup
flip1995 [Wed, 8 Sep 2021 14:31:47 +0000 (16:31 +0200)]
Merge commit '27afd6ade4bb1123a8bf82001629b69d23d62aff' into clippyup

2 years agoDrop 1.56 stabilizations from 1.55 release notes
Mark Rousskov [Mon, 6 Sep 2021 16:55:11 +0000 (12:55 -0400)]
Drop 1.56 stabilizations from 1.55 release notes

2 years agoAuto merge of #7631 - camsteffen:depinfo, r=flip1995
bors [Wed, 8 Sep 2021 13:30:11 +0000 (13:30 +0000)]
Auto merge of #7631 - camsteffen:depinfo, r=flip1995

Use binary-dep-depinfo to resolve UI test dependencies

Closes #7343
Closes #6809
Closes #3643

changelog: none

r? `@flip1995`
cc `@Jarcho`

2 years agoDeny warnings in test modules
Cameron Steffen [Wed, 8 Sep 2021 13:19:14 +0000 (08:19 -0500)]
Deny warnings in test modules

2 years agoAdd tests to ensure that <table> don't break doc blocks width anymore
Guillaume Gomez [Wed, 8 Sep 2021 13:09:47 +0000 (15:09 +0200)]
Add tests to ensure that <table> don't break doc blocks width anymore

2 years agoWrap <table> elements into <div> to prevent breaking layout and width
Guillaume Gomez [Wed, 8 Sep 2021 13:08:11 +0000 (15:08 +0200)]
Wrap <table> elements into <div> to prevent breaking layout and width

2 years agoAuto merge of #87489 - bdalrhm:rustdoc-line-num, r=CraftSpider
bors [Wed, 8 Sep 2021 12:55:15 +0000 (12:55 +0000)]
Auto merge of #87489 - bdalrhm:rustdoc-line-num, r=CraftSpider

`rustdoc`: compute correct line number for indented rust code blocks.

This PR fixes a bug in `rustdoc` where it computes the wrong line number for indented rust code blocks (and subsequent blocks) it finds in markdown strings. To fix this issue, we decrement the line number if we find characters between the code block and the preceding line ending. I noticed this issue as I was trying to use `rustdoc` to extract examples from The Rust Reference and run them through the [Rust Model Checker](https://github.com/model-checking/rmc).

2 years agoUse binary-dep-depinfo to resolve UI dependencies
Cameron Steffen [Fri, 3 Sep 2021 20:24:29 +0000 (15:24 -0500)]
Use binary-dep-depinfo to resolve UI dependencies

2 years agoRemove unused dependencies
Cameron Steffen [Fri, 3 Sep 2021 20:55:14 +0000 (15:55 -0500)]
Remove unused dependencies

2 years agoAuto merge of #7644 - flip1995:rustup, r=flip1995
bors [Wed, 8 Sep 2021 09:00:54 +0000 (09:00 +0000)]
Auto merge of #7644 - flip1995:rustup, r=flip1995

Rustup

r? `@ghost`

changelog: none

2 years agoBump Clippy Version -> 0.1.57
flip1995 [Wed, 8 Sep 2021 08:59:04 +0000 (10:59 +0200)]
Bump Clippy Version -> 0.1.57

2 years agoBump nightly version -> 2021-09-08
flip1995 [Wed, 8 Sep 2021 08:58:51 +0000 (10:58 +0200)]
Bump nightly version -> 2021-09-08

2 years agoMerge remote-tracking branch 'upstream/master' into rustup
flip1995 [Wed, 8 Sep 2021 08:50:04 +0000 (10:50 +0200)]
Merge remote-tracking branch 'upstream/master' into rustup

2 years agoAuto merge of #7607 - dswij:mut-range-bound-break, r=flip1995
bors [Wed, 8 Sep 2021 08:14:17 +0000 (08:14 +0000)]
Auto merge of #7607 - dswij:mut-range-bound-break, r=flip1995

`mut_range_bound` check for immediate break after mutation

closes #7532

`mut_range_bound` ignores mutation on range bounds that is placed immediately before break. Still warns if the break is not always reachable.

changelog: [`mut_range_bound`] ignore range bound mutations before immediate break

2 years agoupdate of the CI freebsd toolchain
David Carlier [Sun, 5 Sep 2021 21:25:37 +0000 (22:25 +0100)]
update of the CI freebsd toolchain

adding libproctsta, for the upcoming libc update.

2 years agoAuto merge of #86943 - ptrojahn:suggest_derive, r=estebank
bors [Wed, 8 Sep 2021 07:27:41 +0000 (07:27 +0000)]
Auto merge of #86943 - ptrojahn:suggest_derive, r=estebank

Suggest deriving traits if possible

This only applies to builtin derives as I don't think there is a
clean way to get the available derives in typeck.

Closes #85851

2 years agoAuto merge of #88061 - jackh726:genericbound-cleanup, r=estebank
bors [Wed, 8 Sep 2021 04:00:58 +0000 (04:00 +0000)]
Auto merge of #88061 - jackh726:genericbound-cleanup, r=estebank

Remove `hir::GenericBound::Unsized`

Rather than "moving" the `?Sized` bounds to the param bounds, just also check where clauses in `astconv`. I also did some related cleanup here, but that's not strictly neccesary. Also going to do a perf run here.

r? `@estebank`

2 years agoAdd known problems to `mut_range_bound` docs
dswij [Mon, 6 Sep 2021 22:07:50 +0000 (06:07 +0800)]
Add known problems to `mut_range_bound` docs

2 years agoUpdate test output for `mut_range_bound`
dswij [Fri, 3 Sep 2021 04:27:05 +0000 (12:27 +0800)]
Update test output for `mut_range_bound`

2 years ago`mut_range_bound` to check for immediate break from loop
dswij [Thu, 2 Sep 2021 08:04:46 +0000 (16:04 +0800)]
`mut_range_bound` to check for immediate break from loop

2 years agoAdd additional test for broken loop in `mut_range_bound`
dswij [Thu, 26 Aug 2021 10:20:13 +0000 (18:20 +0800)]
Add additional test for broken loop in `mut_range_bound`

2 years agoAuto merge of #88477 - sexxi-goose:issue-88476, r=nikomatsakis
bors [Wed, 8 Sep 2021 00:58:33 +0000 (00:58 +0000)]
Auto merge of #88477 - sexxi-goose:issue-88476, r=nikomatsakis

2229: Don't move out of drop type

Fixes #88476

r? `@nikomatsakis`

2 years agoA bit of cleanup to astconv
jackh726 [Sun, 15 Aug 2021 08:17:36 +0000 (04:17 -0400)]
A bit of cleanup to astconv

2 years agoChange is_unsized to add_implicitly_sized
jackh726 [Sun, 15 Aug 2021 07:09:47 +0000 (03:09 -0400)]
Change is_unsized to add_implicitly_sized

2 years agoDon't move ?Trait bounds to param bounds if they're in where clauses
jackh726 [Sun, 15 Aug 2021 04:53:40 +0000 (00:53 -0400)]
Don't move ?Trait bounds to param bounds if they're in where clauses

2 years agoStatic assert size of GenericBoun to ensure size doesn't change
jackh726 [Sun, 15 Aug 2021 00:25:38 +0000 (20:25 -0400)]
Static assert size of GenericBoun to ensure size doesn't change

2 years agoRustWrapper: just use the *AtIndex funcs directly
Augie Fackler [Tue, 7 Sep 2021 20:15:02 +0000 (16:15 -0400)]
RustWrapper: just use the *AtIndex funcs directly

Otherwise we're kind of reimplementing the inverse of the well-named
methods, and that's not a direction we want to go.

2 years agoRustWrapper: avoid deleted unclear attribute methods
Augie Fackler [Tue, 7 Sep 2021 18:49:03 +0000 (14:49 -0400)]
RustWrapper: avoid deleted unclear attribute methods

These were deleted in https://reviews.llvm.org/D108614, and in C++ I
definitely see the argument for their removal. I didn't try and
propagate the changes up into higher layers of rustc in this change
because my initial goal was to get rustc working against LLVM HEAD
promptly, but I'm happy to follow up with some refactoring to make the
API on the Rust side match the LLVM API more directly (though the way
the enum works in Rust makes the API less scary IMO).

r? @nagisa cc @nikic

2 years agoRename rustc_mir to rustc_const_eval.
Camille GILLOT [Tue, 5 Jan 2021 19:08:11 +0000 (20:08 +0100)]
Rename rustc_mir to rustc_const_eval.

2 years agoAuto merge of #88724 - Mark-Simulacrum:bump-rls, r=Mark-Simulacrum
bors [Tue, 7 Sep 2021 18:31:03 +0000 (18:31 +0000)]
Auto merge of #88724 - Mark-Simulacrum:bump-rls, r=Mark-Simulacrum

Bump RLS submodule

r? `@Mark-Simulacrum`

2 years agoMove the dataflow framework to its own crate.
Camille GILLOT [Tue, 5 Jan 2021 18:53:07 +0000 (19:53 +0100)]
Move the dataflow framework to its own crate.

2 years agoMove monomorphize code to its own crate.
Camille GILLOT [Sat, 2 Jan 2021 13:42:15 +0000 (14:42 +0100)]
Move monomorphize code to its own crate.

2 years agoFix typo in `const_generics` replaced with `adt_const_params` note
Mingwei Samuel [Tue, 7 Sep 2021 16:27:30 +0000 (09:27 -0700)]
Fix typo in `const_generics` replaced with `adt_const_params` note

2 years agoAuto merge of #88710 - Mark-Simulacrum:tyvid-idx, r=jackh726
bors [Tue, 7 Sep 2021 15:28:34 +0000 (15:28 +0000)]
Auto merge of #88710 - Mark-Simulacrum:tyvid-idx, r=jackh726

Use index newtyping for TyVid

This is useful for using TyVid in types like VecGraph, and just otherwise seems like a small win.

2 years agoBump RLS submodule
Mark Rousskov [Tue, 7 Sep 2021 14:12:12 +0000 (10:12 -0400)]
Bump RLS submodule

2 years agoAuto merge of #88161 - michaelwoerister:fix-whole-archive-no-bundle, r=petrochenkov
bors [Tue, 7 Sep 2021 12:31:11 +0000 (12:31 +0000)]
Auto merge of #88161 - michaelwoerister:fix-whole-archive-no-bundle, r=petrochenkov

Fix handling of +whole-archive native link modifier.

This PR fixes a bug in `add_upstream_native_libraries` that led to the `+whole-archive` modifier being ignored when linking in native libs.

~~Note that the PR does not address the situation when `+whole-archive` is combined with `+bundle`.~~
`@wesleywiser's` commit adds validation code that turns combining `+whole-archive` with `+bundle` into an error.

Fixes https://github.com/rust-lang/rust/issues/88085.

r? `@petrochenkov`
cc `@wesleywiser` `@gcoakes`

2 years agoAdd test case for no-bundle/whole-archive native libs linking.
Michael Woerister [Mon, 30 Aug 2021 09:54:12 +0000 (11:54 +0200)]
Add test case for no-bundle/whole-archive native libs linking.

2 years agoAuto merge of #7642 - mikerite:fix-7641, r=flip1995
bors [Tue, 7 Sep 2021 08:16:36 +0000 (08:16 +0000)]
Auto merge of #7642 - mikerite:fix-7641, r=flip1995

Add `TAU` to `approx_constant`

changelog: [`approx_constant`]: Add `TAU`

2 years agotest: add case for mutating iterator
Michael Howell [Tue, 7 Sep 2021 07:49:43 +0000 (00:49 -0700)]
test: add case for mutating iterator

Note that this incorrectly suggests a shared borrow,
but at least we know it's happening.

2 years agoFix docs for `uX::checked_next_multiple_of`
Jacob Pratt [Tue, 7 Sep 2021 06:14:04 +0000 (02:14 -0400)]
Fix docs for `uX::checked_next_multiple_of`

2 years agoAuto merge of #88689 - Aaron1011:confused-std-resolver, r=cjgillot
bors [Tue, 7 Sep 2021 05:28:53 +0000 (05:28 +0000)]
Auto merge of #88689 - Aaron1011:confused-std-resolver, r=cjgillot

Move `confused_type_with_std_module` to `ResolverOutputs`

This eliminates untracked global state from `Session`.

2 years agoAdd `TAU` to `approx_constant`
Michael Wright [Tue, 7 Sep 2021 03:50:04 +0000 (05:50 +0200)]
Add `TAU` to `approx_constant`

2 years agoUse index newtyping for TyVid
Mark Rousskov [Mon, 30 Aug 2021 21:45:16 +0000 (17:45 -0400)]
Use index newtyping for TyVid

2 years agoAuto merge of #88448 - xu-cheng:btree-blk-build, r=Mark-Simulacrum
bors [Tue, 7 Sep 2021 02:24:11 +0000 (02:24 +0000)]
Auto merge of #88448 - xu-cheng:btree-blk-build, r=Mark-Simulacrum

BTreeMap/BTreeSet::from_iter: use bulk building to improve the performance

Bulk building is a common technique to increase the performance of building a fresh btree map. Instead of inserting items one-by-one, we sort all the items beforehand then create the BtreeMap in bulk.

Benchmark
```
./x.py bench library/alloc --test-args btree::map::from_iter
```

* Before
```
test btree::map::from_iter_rand_100                      ... bench:       3,694 ns/iter (+/- 840)
test btree::map::from_iter_rand_10_000                   ... bench:   1,033,446 ns/iter (+/- 192,950)
test btree::map::from_iter_seq_100                       ... bench:       5,689 ns/iter (+/- 1,259)
test btree::map::from_iter_seq_10_000                    ... bench:     861,033 ns/iter (+/- 118,815)
```

* After
```
test btree::map::from_iter_rand_100                      ... bench:       3,033 ns/iter (+/- 707)
test btree::map::from_iter_rand_10_000                   ... bench:     775,958 ns/iter (+/- 105,152)
test btree::map::from_iter_seq_100                       ... bench:       2,969 ns/iter (+/- 336)
test btree::map::from_iter_seq_10_000                    ... bench:     258,292 ns/iter (+/- 29,364)
```

2 years agoAuto merge of #83214 - cjgillot:dep-map, r=michaelwoerister
bors [Mon, 6 Sep 2021 23:58:16 +0000 (23:58 +0000)]
Auto merge of #83214 - cjgillot:dep-map, r=michaelwoerister

Mmap the incremental data instead of reading it.

Instead of reading the full incremental state using `fs::read_file`, we memmap it using a private read-only file-backed map.
This allows the system to reclaim any memory we are not using, while ensuring we are not polluted by
outside modifications to the file.

Suggested in https://github.com/rust-lang/rust/pull/83036#issuecomment-800458082 by `@bjorn3`

2 years agoMove rustc_mir::transform to rustc_mir_transform.
Camille GILLOT [Fri, 1 Jan 2021 00:53:25 +0000 (01:53 +0100)]
Move rustc_mir::transform to rustc_mir_transform.

2 years agoMove rustc_mir::borrow_check to new crate rustc_borrowck.
Camille GILLOT [Wed, 30 Dec 2020 17:48:40 +0000 (18:48 +0100)]
Move rustc_mir::borrow_check to new crate rustc_borrowck.

2 years agoAuto merge of #88692 - hyd-dev:miri, r=RalfJung
bors [Mon, 6 Sep 2021 21:06:22 +0000 (21:06 +0000)]
Auto merge of #88692 - hyd-dev:miri, r=RalfJung

Update Miri

Fixes #88671.

r? `@RalfJung`

2 years agofix ICE on hidden tuple variant fields
Emil Gardström [Sat, 4 Sep 2021 11:26:07 +0000 (13:26 +0200)]
fix ICE on hidden tuple variant fields

this also renders them as `_`, which rustdoc previously did not.