Commit graph

7988 commits

Author SHA1 Message Date
Camille GILLOT
b19ae20aad Track span dependency using a callback. 2021-09-10 20:18:18 +02:00
Camille GILLOT
e85ddeb474 Encode spans relative to their parent. 2021-09-10 20:18:11 +02:00
Camille GILLOT
00485e0c0e Keep a parent LocalDefId in SpanData. 2021-09-10 20:17:33 +02:00
Camille GILLOT
06f7ca307d Keep def_spans collected by resolution. 2021-09-10 20:17:08 +02:00
Manish Goregaokar
1c091e4f63
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``
2021-09-10 08:23:23 -07:00
Manish Goregaokar
257f5adf0e
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
2021-09-10 08:23:18 -07:00
Manish Goregaokar
dc003dd49e
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`
2021-09-10 08:23:17 -07:00
Manish Goregaokar
358a018292
Rollup merge of #87441 - ibraheemdev:i-86865, r=cjgillot
Emit suggestion when passing byte literal to format macro

Closes #86865
2021-09-10 08:23:15 -07:00
Manish Goregaokar
e422612f8e
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.
2021-09-10 08:23:15 -07:00
Manish Goregaokar
000dbd27f1
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()
```
2021-09-10 08:23:14 -07:00
Amanieu d'Antras
8c7a05a23f Treat drop_in_place as nounwind with -Z panic-in-drop=abort
The AbortUnwindCalls MIR pass will eliminate any unnecessary cleanups
and will prevent any unwinds from leaking out by forcing an abort.
2021-09-10 14:18:15 +01:00
jackh726
47035e4d08 Use FxHashMap 2021-09-09 23:28:20 -04:00
jackh726
0a3c6bb887 In relate_tys, when creating new universes, insert missing universes as other 2021-09-09 18:04:59 -04:00
Fabian Wolff
57fcb2e2d6 Fix two uses of span_note when the source is not available 2021-09-09 21:17:05 +02:00
Amanieu d'Antras
c1bcf5c548 Add -Z panic-in-drop={unwind,abort} command-line option 2021-09-09 18:57:03 +01:00
Fabian Wolff
79adda930f Ignore automatically derived impls of Clone and Debug in dead code analysis 2021-09-09 19:49:07 +02:00
Sasha Pourcelot
b21425de3c 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.
2021-09-09 17:44:40 +02:00
jackh726
8e7613f9e0 Only add_implied_bounds for norm_ty if different 2021-09-09 11:26:16 -04:00
jackh726
c49b0762c0 Use FxHashSet instead of Vec for well formed tys 2021-09-09 11:25:44 -04:00
Ellen
8295e4a6cf add test for builtin types N + N unifying with fn call 2021-09-09 15:44:04 +01:00
Esteban Kuber
dc02b51382 Use more accurate spans for "unused delimiter" lint 2021-09-09 14:24:33 +00:00
Andreas Liljeqvist
bc95994c32 bugfix 2021-09-09 10:41:20 +02:00
Andreas Liljeqvist
a2ee1420b8 Wrap 2021-09-09 10:41:20 +02:00
Andreas Liljeqvist
9095cf9905 rename is_valid_for to is_valid 2021-09-09 10:41:19 +02:00
Andreas Liljeqvist
dd34e0c966 Rename (un)signed to (un)signed_int 2021-09-09 10:41:19 +02:00
Andreas Liljeqvist
9129f4306f Move unsigned_max etc into Size again 2021-09-09 10:41:19 +02:00
Andreas Liljeqvist
459c9108e4 Remove clone 2021-09-09 10:41:19 +02:00
Andreas Liljeqvist
5b2f757dae Make abi::Abi Copy and remove a *lot* of refs
fix

fix

Remove more refs and clones

fix

more

fix
2021-09-09 10:41:19 +02:00
Andreas Liljeqvist
86ff6aeb82 Fix docstring 2021-09-09 10:41:18 +02:00
Andreas Liljeqvist
da92cd6dcf Use special Debug format when start > end 2021-09-09 10:41:18 +02:00
Andreas Liljeqvist
f5d8749f85 Remove contains_zero, respect the compiler 2021-09-09 10:41:18 +02:00
Andreas Liljeqvist
021c3346ed derive Copy for WrappingRange and Scalar 2021-09-09 10:41:18 +02:00
Andreas Liljeqvist
4c46296f22 fix match 2021-09-09 10:41:18 +02:00
Andreas Liljeqvist
05cd48b008 Add methods for checking for full ranges to Scalar and WrappingRange
Move *_max methods back to util

change to inline instead of inline(always)

Remove valid_range_exclusive from scalar
Use WrappingRange instead

implement always_valid_for in a safer way

Fix accidental edit
2021-09-09 10:41:17 +02:00
bors
02a57fa132 Auto merge of #88748 - bjorn3:try_fix_perf_regression, r=wesleywiser
Revert "Remove optimization_fuel_crate from Session"

This reverts commit 5464b2e713.

This hopefully fixes the perf regression in https://github.com/rust-lang/rust/pull/88530#issuecomment-915314117.
2021-09-09 06:16:04 +00:00
Noble-Mushtak
804ccfaaab Fatal error for functions with more than 65535 arguments 2021-09-08 21:14:49 -04:00
Mark Rousskov
b4e7649d6d Bump stage0 compiler to 1.56 2021-09-08 20:51:05 -04:00
Ellen
cd2915eddb fmt 2021-09-09 01:32:03 +01:00
Ellen
3212734bd7 resolve from_hir_call FIXME 2021-09-09 01:32:03 +01:00
Ellen
8c7954dc42 add a CastKind to Node::Cast 2021-09-09 01:32:03 +01:00
Ellen
955e2b2da0 nits 2021-09-09 01:32:03 +01:00
Ellen
79be080255 remove comment 2021-09-09 01:32:03 +01:00
Ellen
406d2ab95d rename mir -> thir around abstract consts 2021-09-09 01:32:03 +01:00
Ellen
15101c8e95 remove debug stmts 2021-09-09 01:32:03 +01:00
Ellen
1f57f8b903 remove WorkNode 2021-09-09 01:32:03 +01:00
Ellen
4cbcb0936a handle ExprKind::NeverToAny 2021-09-09 01:32:03 +01:00
Ellen
fc63e9a8fb dont build abstract const for monomorphic consts 2021-09-09 01:32:03 +01:00
Ellen
08e8644016 move thir visitor to rustc_middle 2021-09-09 01:32:03 +01:00
Ellen
c170dcf04c tidy 2021-09-09 01:32:03 +01:00
Ellen
4483c2bdf6 dont support blocks 2021-09-09 01:32:03 +01:00
Ellen
9b2913814b as casts and block exprs 2021-09-09 01:32:03 +01:00
Ellen
2987f4ba42 WIP state 2021-09-09 01:32:03 +01:00
bors
97032a6dfa 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.
2021-09-08 20:42:42 +00:00
Camille GILLOT
924dbc36c9 Rebase fallout. 2021-09-08 20:40:30 +02:00
Jack Huey
4cb751e1f4
Rollup merge of #88726 - MingweiSamuel:patch-1, r=wesleywiser
Fix typo in `const_generics` replaced with `adt_const_params` note
2021-09-08 12:24:22 -04:00
Jack Huey
77ac329a08
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 `+`
```
2021-09-08 12:24:16 -04:00
Niko Matsakis
c9d46eb224 Rework DepthFirstSearch API
This expands the API to be more flexible, allowing for more visitation patterns
on graphs. This will be useful to avoid extra datasets (and allocations) in
cases where the expanded DFS API is sufficient.

This also fixes a bug with the previous DFS constructor, which left the start
node not marked as visited (even though it was immediately returned).
2021-09-08 12:23:37 -04:00
bjorn3
102264652e Revert "Remove optimization_fuel_crate from Session"
This reverts commit 5464b2e713.
2021-09-08 17:36:41 +02:00
Augie Fackler
4d045406d1 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.
2021-09-08 10:47:41 -04:00
bors
434cb437b5 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
2021-09-08 07:27:41 +00:00
bors
72969f6526 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`
2021-09-08 04:00:58 +00:00
bors
0d0d2fe182 Auto merge of #88477 - sexxi-goose:issue-88476, r=nikomatsakis
2229: Don't move out of drop type

Fixes #88476

r? `@nikomatsakis`
2021-09-08 00:58:33 +00:00
jackh726
890de33e4f Fix duplicate error 2021-09-07 18:51:24 -04:00
jackh726
af9de99f12 Detect stricter constraints on gats where clauses in impls vs trait 2021-09-07 18:30:58 -04:00
jackh726
22ef04e22f A bit of cleanup to astconv 2021-09-07 18:25:57 -04:00
jackh726
216906fb75 Change is_unsized to add_implicitly_sized 2021-09-07 18:08:46 -04:00
jackh726
f1f1d56d93 Don't move ?Trait bounds to param bounds if they're in where clauses 2021-09-07 18:08:46 -04:00
jackh726
2eaf9fe364 Static assert size of GenericBoun to ensure size doesn't change 2021-09-07 17:53:43 -04:00
Augie Fackler
484b79b950 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.
2021-09-07 16:15:02 -04:00
Augie Fackler
532bb80f7f 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
2021-09-07 15:30:42 -04:00
Camille GILLOT
c5fc2609f0 Rename rustc_mir to rustc_const_eval. 2021-09-07 20:46:26 +02:00
Camille GILLOT
fd9c04fe32 Move the dataflow framework to its own crate. 2021-09-07 19:57:07 +02:00
Camille GILLOT
81a600b6b7 Move monomorphize code to its own crate. 2021-09-07 19:53:04 +02:00
Mingwei Samuel
f8cbb1935c
Fix typo in const_generics replaced with adt_const_params note 2021-09-07 09:27:30 -07:00
bors
69c4aa2901 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.
2021-09-07 15:28:34 +00:00
bors
73641cd23b 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`
2021-09-07 12:31:11 +00:00
bors
385f8e2078 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`.
2021-09-07 05:28:53 +00:00
Mark Rousskov
2eac09d258 Use index newtyping for TyVid 2021-09-06 22:38:06 -04:00
bors
11bbb52313 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`
2021-09-06 23:58:16 +00:00
Camille GILLOT
bba4be681d Move rustc_mir::transform to rustc_mir_transform. 2021-09-07 00:43:14 +02:00
Andrew Hickman
d6ce3269b4 Suggest wapping expr in parentheses on invalid unary negation
Fixes #88701
2021-09-06 23:34:47 +01:00
Camille GILLOT
31a61ccc38 Move rustc_mir::borrow_check to new crate rustc_borrowck. 2021-09-07 00:29:22 +02:00
Aaron Hill
404402430d
Move confused_type_with_std_module to ResolverOutputs
This eliminates untracked global state from `Session`.
2021-09-06 11:20:59 -05:00
bors
13db8440bb Auto merge of #88686 - rylev:rollup-m1tf9ir, r=m-ou-se
Rollup of 6 pull requests

Successful merges:

 - #88602 (Add tests for some const generics issues)
 - #88647 (Document when to use Windows' `symlink_dir` vs. `symlink_file`)
 - #88659 (Remove SmallVector mention)
 - #88661 (Correct typo)
 - #88673 (Fix typo: needede -> needed)
 - #88685 (⬆️ rust-analyzer)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-09-06 13:20:16 +00:00
Paul Trojahn
50e5f90c92 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
2021-09-06 13:18:05 +02:00
bors
1c858ba5bf Auto merge of #88678 - matthewjasper:if-boolean-scoping, r=oli-obk
Change scope of temporaries in match guards

Each pattern in a match arm has its own copy of the match guard in MIR, with its own temporary, so it has to be dropped before the the guards are joined to the single copy of the arm. This PR changes `then_else_break` to allow it to put the temporary in the innermost scope possible. This change isn't done for `if` expressions because that affects a large number of mir-opt tests and could more significantly affect performance.

closes #88649

r? `@oli-obk`
2021-09-06 10:39:21 +00:00
Ryan Levick
5f09e93318
Rollup merge of #88659 - est31:update_smallvec_name, r=matthewjasper
Remove SmallVector mention

SmallVector is long gone, as it's been first replaced
by OneVector in commit e5e6375352,
which then has been removed entirely in favour of SmallVec in
commit 130a32fa72.
2021-09-06 12:38:55 +02:00
bors
d19d864e79 Auto merge of #88631 - camelid:sugg-span, r=davidtwco
Improve structured tuple struct suggestion

Previously, the span was just for the constructor name, which meant it
would result in syntactically-invalid code when applied. Now, the span
is for the entire expression.

I also changed it to use `span_suggestion_verbose`, for two reasons:

1. Now that the suggestion span has been corrected, the output is a bit
   cluttered and hard to read. Putting the suggestion its own window
   creates more space.

2. It's easier to see what's being suggested, since now the version
   after the suggestion is applied is shown.

r? `@davidtwco`
2021-09-06 07:58:24 +00:00
bors
8f3aa5e8b9 Auto merge of #88493 - chenyukang:fix-duplicated-diagnostic, r=estebank
Fix #88256 remove duplicated diagnostics

Fix #88256
2021-09-06 00:14:41 +00:00
bors
7849e3e9dd Auto merge of #88435 - cjgillot:no-walk-crate, r=Aaron1011
Avoid invoking the hir_crate query to traverse the HIR

Walking the HIR tree is done using the `hir_crate` query. However, this is unnecessary, since `hir_owner(CRATE_DEF_ID)` provides the same information. Since depending on `hir_crate` forces dependents to always be executed, this leads to unnecessary work.

By splitting HIR and attributes visits, we can avoid an edge to `hir_crate` when trying to visit the HIR tree.
2021-09-05 21:40:34 +00:00
bors
e30b68353f Auto merge of #88552 - nbdd0121:vtable, r=nagisa
Stop allocating vtable entries for non-object-safe methods

Current a vtable entry is allocated for all associated fns, even if the method is not object-safe: https://godbolt.org/z/h7vx6f35T

As a result, each vtable for `Iterator`' currently consumes 74 `usize`s. This PR stops allocating vtable entries for those methods, reducing vtable size of each `Iterator` vtable to 7 `usize`s.

Note that this PR introduces will cause more invocations of `is_vtable_safe_method`. So a perf run might be needed. If result isn't favorable then we might need to query-ify `is_vtable_safe_method`.
2021-09-05 18:55:32 +00:00
Matthew Jasper
ad7f109bfa Change scope of temporaries in match guards
Each pattern in a match arm has its own copy of the match guard in MIR,
with its own temporary, so it has to be dropped before the the guards
are joined to the single copy of the arm.
2021-09-05 18:50:55 +01:00
Gary Guo
97214eecc5 Add query own_existential_vtable_entries 2021-09-05 18:13:32 +01:00
Gary Guo
871eb6233e Stop allocating vtable entries for non-object-safe methods 2021-09-05 18:13:32 +01:00
bors
e2750baf53 Auto merge of #88499 - eddyb:layout-off, r=nagisa
Provide `layout_of` automatically (given tcx + param_env + error handling).

After #88337, there's no longer any uses of `LayoutOf` within `rustc_target` itself, so I realized I could move the trait to `rustc_middle::ty::layout` and redesign it a bit.

This is similar to #88338 (and supersedes it), but at no ergonomic loss, since there's no funky `C: LayoutOf<Ty = Ty>` -> `Ty: TyAbiInterface<C>` generic `impl` chain, and each `LayoutOf` still corresponds to one `impl` (of `LayoutOfHelpers`) for the specific context.

After this PR, this is what's needed to get `trait LayoutOf` (with the `layout_of` method) implemented on some context type:
* `TyCtxt`, via `HasTyCtxt`
* `ParamEnv`, via `HasParamEnv`
* a way to transform `LayoutError`s into the desired error type
  * an error type of `!` can be paired with having `cx.layout_of(...)` return `TyAndLayout` *without* `Result<...>` around it, such as used by codegen
  * this is done through a new `LayoutOfHelpers` trait (and so is specifying the type of `cx.layout_of(...)`)

When going through this path (and not bypassing it with a manual `impl` of `LayoutOf`), the end result is that only the error case can be customized, the query itself and the success paths are guaranteed to be uniform.

(**EDIT**: just noticed that because of the supertrait relationship, you cannot actually implement `LayoutOf` yourself, the blanket `impl` fully covers all possible context types that could ever implement it)

Part of the motivation for this shape of API is that I've been working on querifying `FnAbi::of_*`, and what I want/need to introduce for that looks a lot like the setup in this PR - in particular, it's harder to express the `FnAbi` methods in `rustc_target`, since they're much more tied to `rustc` concepts.

r? `@nagisa` cc `@oli-obk` `@bjorn3`
2021-09-05 16:14:41 +00:00
Harald van Dijk
cd75af25e0
Change more x64 size checks to not apply to x32.
Commit 95e096d6 changed a bunch of size checks already, but more have
been added, so this fixes the new ones the same way: the various size
checks that are conditional on target_arch = "x86_64" were not intended
to apply to x86_64-unknown-linux-gnux32, so add
target_pointer_width = "64" to the conditions.
2021-09-05 16:42:36 +01:00
Mara Bos
b4d06bfa8f
Rollup merge of #88657 - camelid:fix-dyn-sugg, r=m-ou-se
Fix 2021 `dyn` suggestion that used code as label

The arguments to `span_suggestion` were in the wrong order, so the error
looked like this:

    error[E0783]: trait objects without an explicit `dyn` are deprecated
      --> src/test/ui/editions/dyn-trait-sugg-2021.rs:10:5
       |
    10 |     Foo::hi(123);
       |     ^^^ help: <dyn Foo>: `use `dyn``

Now the error looks like this, as expected:

    error[E0783]: trait objects without an explicit `dyn` are deprecated
      --> src/test/ui/editions/dyn-trait-sugg-2021.rs:10:5
       |
    10 |     Foo::hi(123);
       |     ^^^ help: use `dyn`: `<dyn Foo>`

This issue was only present in the 2021 error; the 2018 lint was
correct.

r? `@m-ou-se`
2021-09-05 10:32:24 +02:00
Mara Bos
c1ccc1b3ff
Rollup merge of #88257 - estebank:invalid-attr-error, r=oli-obk
Provide more context on incorrect inner attribute

Suggest changing an inner attribute into an outer attribute if followed by an item.
2021-09-05 10:32:20 +02:00
bors
d32dc80bb6 Auto merge of #88559 - bjorn3:archive_logic_dedup, r=cjgillot
Move add_rlib and add_native_library to cg_ssa

This deduplicates logic between codegen backends.

cc `@antoyo` and `@khyperia` for cg_gcc and rust-gpu.
2021-09-05 04:37:12 +00:00
est31
d84a39b35a Remove SmallVector mention
SmallVector is long gone, as it's been first replaced
by OneVector in commit e5e6375352,
which then has been removed entirely in favour of SmallVec in
commit 130a32fa72.
2021-09-05 06:10:21 +02:00