Commit graph

155683 commits

Author SHA1 Message Date
Roxane
d0e2b607de Fix test 2021-09-26 21:02:21 -04:00
bors
30fe4ba1fb Auto merge of #7722 - dtolnay-contrib:float, r=giraffate
Stop suggesting a float truncation that is not shorter

Fixes #7721.

Previously Clippy would say that a number has excessive precision even if it has the minimum possible precision for the floating point value that it corresponds to.

changelog: Fix [`excessive_precision`] being triggered on floats that are already written in shortest form
2021-09-27 00:49:08 +00:00
bors
b2804655f5 Auto merge of #89092 - bjorn3:sync_cg_clif-2021-09-19, r=bjorn3
Sync rustc_codegen_cranelift

Nothing exciting this time. Mostly internal refactorings.

r? `@ghost`

`@rustbot` label +A-codegen +A-cranelift +T-compiler
2021-09-26 23:31:01 +00:00
Samuel Moelius
1e15bbe552 Pass real crate-level attributes to pre_expansion_lint 2021-09-26 21:50:50 +00:00
jackh726
a84e3fab30 Don't normalize opaque types with escaping late-bound regions.
Turns out, this has some really bad perf implications in large types (issue #88862). While we technically can handle them fine, it doesn't change test output either way. For now, revert with an added benchmark. Future attempts to change this back will have to consider perf.
2021-09-26 15:58:24 -04:00
Roxane
87010206ad 2229: Consume IfLet expr 2021-09-26 15:52:02 -04:00
Noah Lev
df687bdae0 Add regression test for issue #83564 2021-09-26 12:39:10 -07:00
bors
05044c2e6c Auto merge of #89144 - sexxi-goose:insig_stdlib, r=nikomatsakis
2229: Mark insignificant dtor in stdlib

I looked at all public [stdlib Drop implementations](https://doc.rust-lang.org/stable/std/ops/trait.Drop.html#implementors) and categorized them into Insigificant/Maybe/Significant Drop.

Reasons are noted here: https://docs.google.com/spreadsheets/d/19edb9r5lo2UqMrCOVjV0fwcSdS-R7qvKNL76q7tO8VA/edit#gid=1838773501

One thing missing from this PR is tagging HashMap as insigificant destructor as that needs some discussion.

r? `@Mark-Simulacrum`

cc `@nikomatsakis`
2021-09-26 19:36:00 +00:00
Fabian Wolff
750018e16e Improve diagnostics for inaccessible items 2021-09-26 19:22:20 +02:00
Esteban Kuber
5c70f25f8c Detect when negative literal indices are used and suggest appropriate code 2021-09-26 16:52:10 +00:00
Fabian Wolff
65eb381dec Do not suggest importing inaccessible items 2021-09-26 18:43:58 +02:00
Joshua Nelson
6f087aedb6 Use the correct edition when syntax highlighting doctests
Previously it would unconditionally use edition 2015, which was
incorrect.
2021-09-26 16:36:33 +00:00
Joshua Nelson
f4aa3b544f Preserve the whole LangSyntax when parsing doctests
Previously, only the raw string and the `is_ignore` field were
preserved, which made it hard to recover anything else.
2021-09-26 16:28:36 +00:00
Loïc BRANSTETT
88ff75c6cc Fix populate of union.impls 2021-09-26 18:22:07 +02:00
antoyo
64c561dc22
Fix global initialization (#91)
* Make define_global() return a RValue directly
* Return LValue in functions declaring a global variable
* Remove useless cast
* Fix bytes_in_context to use an array rvalue
* Remove global_names which is unused
* Make const_struct create a constant struct
* Correctly initialize global in static_addr_of_mut
* Fix global variable initialization
* Remove workaround for ARGV
2021-09-26 12:20:02 -04:00
Takayuki Maeda
3bab36357c test suggesting immutable or mutable trait implementations 2021-09-27 00:59:57 +09:00
Takayuki Maeda
3e41397ef2 fix test error 2021-09-27 00:50:46 +09:00
bors
c09d637432 Auto merge of #88316 - est31:remove_box_tests, r=Mark-Simulacrum
Remove most box syntax uses from the testsuite except for src/test/ui/issues

Removes most box syntax uses from the testsuite outside of the src/test/ui/issues directory. The goal was to only change tests where box syntax is an implementation detail instead of the actual feature being tested. So some tests were left out, like the regression test for #87935, or tests where the obtained error message changed significantly.

Mostly this replaces box syntax with `Box::new`, but there are some minor drive by improvements, like formatting improvements or `assert_eq` instead of `assert!( == )`.

Prior PR that removed box syntax from the compiler and tools: #87781
2021-09-26 15:48:10 +00:00
Takayuki Maeda
620f480e64 better suggestions 2021-09-27 00:30:39 +09:00
Commeownist
4e7e822f39
Impove handling of registers in inline asm (#82)
* Correctly handle st(0) register in the clobbers list
* Gate the clobbers based on enabled target features
2021-09-26 09:30:45 -04:00
bors
ac8dd1b2f2 Auto merge of #89101 - ehuss:compiletest-incremental-build, r=Mark-Simulacrum
Support incremental in compiletest for non-incremental modes.

This adds first-class support for using incremental builds in non-incremental-mode tests.  These tests previously manually passed `-C incremental=tmp/foo` which resulted in reusing the same tmp folder between runs.  This means that these tests could fail whenever the on-disk incremental format changed (such as when updating one's local source tree).  This changes it so that these tests can pass a `// incremental-build` header which instructs compiletest to create a set aside a dedicated incremental directory which will be cleared before the test starts to ensure it has a clean slate.
2021-09-26 08:09:12 +00:00
Takayuki Maeda
e2aad3fe60 fix the relevant tests 2021-09-26 16:43:47 +09:00
Takayuki Maeda
0661c2de24 suggest both immutable and mutable trait implementations 2021-09-26 16:43:44 +09:00
David Tolnay
e63d69244e
Stop suggesting a float truncation that is not shorter 2021-09-25 22:55:23 -07:00
bors
f6e6ddc09d Auto merge of #88680 - ehuss:more-attr-validation, r=petrochenkov
Validate builtin attributes for macro args.

This adds some validation for `path`, `crate_type`, and `recursion_limit` attributes so that they will now return an error if you attempt to pass a macro into them (such as `#[path = foo!()]`). Previously, the attribute would be completely ignored. These attributes are special because their values need to be known before/during expansion.

cc #87681
2021-09-26 05:15:11 +00:00
antoyo
0f4b616a08
Add notes for cross-compilation to gcc-only targets (#68) 2021-09-26 00:06:42 -04:00
bors
4da89a180f Auto merge of #89262 - Manishearth:rollup-vtkbetm, r=Manishearth
Rollup of 7 pull requests

Successful merges:

 - #88895 (rustdoc: Cleanup `clean` part 2)
 - #88973 (Expose the std_detect env_override feature)
 - #89010 (Add some intra doc links)
 - #89198 (rustdoc: Don't show hidden trait methods)
 - #89216 (Consistent big O notation)
 - #89224 (Change the order of imports suggestions)
 - #89256 (Fix typo in release notes)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-09-26 02:31:12 +00:00
est31
6550021124 Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
Manish Goregaokar
7d9a0e5da9
Rollup merge of #89256 - danielg1111:fix_typo, r=Mark-Simulacrum
Fix typo in release notes
2021-09-25 18:22:22 -07:00
Manish Goregaokar
04d3f93a2b
Rollup merge of #89224 - TaKO8Ki:change-the-order-of-suggestions, r=joshtriplett
Change the order of imports suggestions

closes #83564
2021-09-25 18:22:21 -07:00
Manish Goregaokar
067bfe3618 Rollup merge of #89216 - r00ster91:bigo, r=dtolnay
Consistent big O notation

This makes the big O time complexity notation in places with markdown support more consistent.
Inspired by #89210
2021-09-25 18:22:20 -07:00
Manish Goregaokar
653dcaac2b
Rollup merge of #89216 - r00ster91:bigo, r=dtolnay
Consistent big O notation

This makes the big O time complexity notation in places with markdown support more consistent.
Inspired by #89210
2021-09-25 18:22:20 -07:00
Manish Goregaokar
c118d8b79b
Rollup merge of #89198 - hkmatsumoto:hide-hidden-methods, r=jyn514
rustdoc: Don't show hidden trait methods

Fix #89186.

By skipping trait items whose attributes include `hidden`, we avoid showing such trait methods.
2021-09-25 18:22:19 -07:00
Manish Goregaokar
b8c3a6cfb9
Rollup merge of #89010 - est31:intra_doc_links, r=m-ou-se
Add some intra doc links
2021-09-25 18:22:19 -07:00
Manish Goregaokar
f9d4eb0ae3
Rollup merge of #88973 - lu-zero:std_detect-env_override, r=Amanieu
Expose the std_detect env_override feature
2021-09-25 18:22:18 -07:00
Manish Goregaokar
7777f952f0
Rollup merge of #88895 - camelid:cleanup-pt2, r=jyn514
rustdoc: Cleanup `clean` part 2

Split out from #88379. This contains the following commits from that PR:

- Remove `Type::ResolvedPath.is_generic`
- Rename `is_generic()` to `is_assoc_ty()`

r? `@jyn514`
2021-09-25 18:22:17 -07:00
Nadrieril
b7e358ee17 Trivialize tracking of unreachable subpatterns
Phew it had been very had to make it work without a good way to identify
patterns. Now it's dead easy.
2021-09-26 00:30:39 +01:00
Nadrieril
b6062bda4c Avoid double-deref in Fields 2021-09-26 00:30:39 +01:00
Nadrieril
71abc9565f Replace Pat with a new intermediate representation 2021-09-26 00:30:38 +01:00
Nadrieril
fde45e96b8 Remove dependency of SubPatSet on Pat 2021-09-26 00:07:18 +01:00
Nadrieril
5853399aee Move special &str handling to Constructor and Fields 2021-09-26 00:05:52 +01:00
Nadrieril
035c5213ae Use usize for slice arity 2021-09-26 00:05:52 +01:00
Nadrieril
3175409682 Rework Fields internals.
Now `Fields` is just a `Vec` of patterns, with some extra info on the
side to reconstruct patterns when needed. This emphasizes that this
extra info is not central to the algorithm.
2021-09-26 00:05:52 +01:00
Nadrieril
87a0a25b38 A for loop is a lot faster apparently 2021-09-26 00:05:52 +01:00
Nadrieril
ff90c6353b Cleanup the reporting of unreachable patterns 2021-09-26 00:05:52 +01:00
Nadrieril
003bbcb799 Always report reachability for user-supplied patterns 2021-09-26 00:05:52 +01:00
Nadrieril
2bf6e7880d Remove some unreachable code 2021-09-26 00:05:52 +01:00
Nadrieril
2e78c6bd99 Remove premature shortcutting 2021-09-26 00:05:50 +01:00
Matthias Krüger
d888b4b98c clippy lints: update doctest ranges to inclusive ones 2021-09-25 22:40:58 +02:00
Matthias Krüger
c3515c301d bump clippy crates to edition 2021 2021-09-25 22:40:58 +02:00