Ellen
7f8530f16b
more things are const evaluatable *sparkles*
2021-02-01 20:05:50 +00:00
bors
d4e3570db4
Auto merge of #80641 - Danue1:patch-1, r=oli-obk
...
Add visitors for checking #[inline]
For #80564
2021-02-01 19:31:01 +00:00
Nadrieril
ae6fcab733
Make SubPatSet
clearer by flipping its meaning
2021-02-01 19:29:38 +00:00
LingMan
b35d601ab7
Directly use Option<&[T]>
instead of converting from Option<&Vec<T>>
later on
2021-02-01 19:51:24 +01:00
Jesus Rubio
9ef24f960b
Update ui tests
2021-02-01 18:23:12 +01:00
Jesus Rubio
ee5ea24d36
Add long error explanation for E0521
2021-02-01 18:22:13 +01:00
bors
02b85d7220
Auto merge of #81625 - jonas-schievink:rollup-mshpp2n, r=jonas-schievink
...
Rollup of 12 pull requests
Successful merges:
- #78641 (Let io::copy reuse BufWriter buffers)
- #79291 (Add error message for private fn)
- #81364 (Improve `rustc_mir_build::matches` docs)
- #81387 (Move some tests to more reasonable directories - 3)
- #81463 (Rename NLL* to Nll* accordingly to C-CASE)
- #81504 (Suggest accessing field when appropriate)
- #81529 (Fix invalid camel case suggestion involving unicode idents)
- #81536 (Indicate both start and end of pass RSS in time-passes output)
- #81592 (Rustdoc UI fixes)
- #81594 (Avoid building LLVM just for llvm-dwp)
- #81598 (Fix calling convention for CRT startup)
- #81618 (Sync rustc_codegen_cranelift)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
2021-02-01 16:30:22 +00:00
Guillaume Gomez
899b0dd1d1
Fix overflowing text on mobile when sidebar is displayed
2021-02-01 17:21:49 +01:00
Danuel
838f487fc5
Bless tests
2021-02-02 00:43:16 +09:00
Jack Huey
4b64bc1fc9
Upgrade Chalk
2021-02-01 10:37:45 -05:00
Guillaume Gomez
c013f2a735
Improve diff display in case the whole key in missing
2021-02-01 15:56:51 +01:00
Guillaume Gomez
d5243e3a97
Add test for primitive search
2021-02-01 15:56:51 +01:00
Guillaume Gomez
198e3aba8f
Put back primitives in search
2021-02-01 15:56:51 +01:00
LingMan
8e34522309
Remove unneeded mut
variable
...
`arg_elide` gets initialized, immediately cloned, and only written to after that.
The last reading access was removed back in
7704762604
2021-02-01 15:37:46 +01:00
Danuel
8bbb2d057d
Fixed #[inline] to be warned in fields, arms, macro defs
...
Add visitors for checking #[inline]
Add visitors for checking #[inline] with struct field
Fix test for #[inline]
Add visitors for checking #[inline] with #[macro_export] macro
Add visitors for checking #[inline] without #[macro_export] macro
Add use alias with Visitor
Fix lint error
Reduce unnecessary variable
Co-authored-by: LingMan <LingMan@users.noreply.github.com>
Change error to warning
Add warning for checking field, arm with #[allow_internal_unstable]
Add name resolver
Formatting
Formatting
Fix error fixture
Add checking field, arm, macro def
2021-02-01 23:36:19 +09:00
Jonas Schievink
b3339ab828
Rollup merge of #81618 - bjorn3:sync_cg_clif-2021-02-01, r=bjorn3
...
Sync rustc_codegen_cranelift
The highlight of this sync are abi compatibility with cg_llvm allowing mixing of cg_clif and cg_llvm compiled crates and switching to the x64 cranelift backend based on the new backend framework.
r? ``@ghost``
``@rustbot`` label +A-codegen +A-cranelift +T-compiler
2021-02-01 14:29:47 +01:00
Jonas Schievink
2622227208
Rollup merge of #81598 - sivadeilra:windows_dll_imports_fix_x86, r=m-ou-se
...
Fix calling convention for CRT startup
My PR #81478 used the wrong calling convention for a set of
functions that are called by the CRT. These functions need to use
`extern "C"`.
This would only affect x86, which is the only target (that I know of)
that has multiple calling conventions.
```@bors``` r? ```@m-ou-se```
2021-02-01 14:29:45 +01:00
Jonas Schievink
52907cc237
Rollup merge of #81594 - bjorn3:avoid_building_llvm_for_dwp, r=sanxiyn
...
Avoid building LLVM just for llvm-dwp
When the LLVM backend is disabled, the llvm-project submodule is not checked out by default. This breaks the bootstrap test for cg_clif. As cg_clif doesn't support split debuginfo anyway llvm-dwp is not necessary. Other backends would likely not want to build LLVM just for llvm-dwp either.
Fixes https://github.com/bjorn3/rustc_codegen_cranelift/issues/1119
2021-02-01 14:29:44 +01:00
Jonas Schievink
ccc5a85307
Rollup merge of #81592 - GuillaumeGomez:rustdoc-ui-fixes, r=Nemo157
...
Rustdoc UI fixes
The first commit fixes this bug (I couldn't figure out why we were setting the width manually and it works as expected without so...):

The second commit fixes a small bug. On tablets or computer with very little width, the search section goes "over" the search input, making it impossible to click on the search input:

The third and last commit fixes two bugs that you can see in this screenshot:

The wheel is going over the search input and the search tab is going under the search results text. The bug was fixed by simply switching to "mobile mode" at a bigger width:

cc ```@pickfire```
r? ```@Nemo157```
2021-02-01 14:29:42 +01:00
Jonas Schievink
82b00ec606
Rollup merge of #81536 - tgnottingham:time-passes-rss, r=oli-obk
...
Indicate both start and end of pass RSS in time-passes output
Previously, only the end of pass RSS was indicated. This could easily
lead one to believe that the change in RSS from one pass to the next was
attributable to the second pass, when in fact it occurred between the
end of the first pass and the start of the second.
Also, improve alignment of columns.
Sample of output:
```
time: 0.739; rss: 607MB -> 637MB item_types_checking
time: 8.429; rss: 637MB -> 775MB item_bodies_checking
time: 11.063; rss: 470MB -> 775MB type_check_crate
time: 0.232; rss: 775MB -> 777MB match_checking
time: 0.139; rss: 777MB -> 779MB liveness_and_intrinsic_checking
time: 0.372; rss: 775MB -> 779MB misc_checking_2
time: 8.188; rss: 779MB -> 1019MB MIR_borrow_checking
time: 0.062; rss: 1019MB -> 1021MB MIR_effect_checking
```
2021-02-01 14:29:40 +01:00
Jonas Schievink
39ea34744b
Rollup merge of #81529 - estebank:case_lints, r=davidtwco
...
Fix invalid camel case suggestion involving unicode idents
Follow up to #77805 .
2021-02-01 14:29:39 +01:00
Jonas Schievink
853cfd462f
Rollup merge of #81504 - matsujika:suggestion-field-access, r=estebank
...
Suggest accessing field when appropriate
Fix #81222
r? ``@estebank``
2021-02-01 14:29:37 +01:00
Jonas Schievink
9e8753e2bb
Rollup merge of #81463 - matsujika:nll-ensure-c-case, r=varkor
...
Rename NLL* to Nll* accordingly to C-CASE
Given [C-CASE](https://rust-lang.github.io/api-guidelines/naming.html#casing-conforms-to-rfc-430-c-case ), `NLLRegionVariableOrigin` and `NLL` are encouraged to be `NllRegionVariableOrigin` and `Nll` respectively.
2021-02-01 14:29:35 +01:00
Jonas Schievink
c99ec7f724
Rollup merge of #81387 - c410-f3r:tests-tests-tests, r=petrochenkov
...
Move some tests to more reasonable directories - 3
cc #73494
r? ````@petrochenkov````
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-56202.rs <sup>https://github.com/rust-lang/rust/issues/56202 </sup>: traits 1.008
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-69841.rs <sup>https://github.com/rust-lang/rust/issues/69841 </sup>: for-loop-while 1.014
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-10763.rs <sup>https://github.com/rust-lang/rust/issues/10763 </sup>: extern 1.016
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-50599.rs <sup>https://github.com/rust-lang/rust/issues/50599 </sup>: resolve 1.018
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-6128.rs <sup>https://github.com/rust-lang/rust/issues/6128 </sup>: traits 1.043
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-20616-8.rs <sup>https://github.com/rust-lang/rust/issues/20616 </sup>: parser 1.045
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-46553.rs <sup>https://github.com/rust-lang/rust/issues/46553 </sup>: consts 1.081
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-33140-hack-boundaries.rs <sup>https://github.com/rust-lang/rust/issues/33140 </sup>: traits 1.101
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-25826.rs <sup>https://github.com/rust-lang/rust/issues/25826 </sup>: consts 1.108
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-56488.rs <sup>https://github.com/rust-lang/rust/issues/56488 </sup>: traits 1.110
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-58856-1.rs <sup>https://github.com/rust-lang/rust/issues/58856 </sup>: parser 1.133
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-57819.rs <sup>https://github.com/rust-lang/rust/issues/57819 </sup>: parser 1.138
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-54348.rs <sup>https://github.com/rust-lang/rust/issues/54348 </sup>: consts 1.155
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-14309.rs <sup>https://github.com/rust-lang/rust/issues/14309 </sup>: lint 1.160
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-4446.rs <sup>https://github.com/rust-lang/rust/issues/4446 </sup>: threads-sendsync 1.203
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-53675-a-test-called-panic.rs <sup>https://github.com/rust-lang/rust/issues/53675 </sup>: test-attrs 1.211
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-40231-2.rs <sup>https://github.com/rust-lang/rust/issues/40231 </sup>: consts 1.213
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-22037.rs <sup>https://github.com/rust-lang/rust/issues/22037 </sup>: associated-types 1.214
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-59029-2.rs <sup>https://github.com/rust-lang/rust/issues/59029 </sup>: traits 1.219
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-18425.rs <sup>https://github.com/rust-lang/rust/issues/18425 </sup>: consts 1.237
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-6157.rs <sup>https://github.com/rust-lang/rust/issues/6157 </sup>: regions 1.238
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-33819.rs <sup>https://github.com/rust-lang/rust/issues/33819 </sup>: borrowck 1.280
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-3683.rs <sup>https://github.com/rust-lang/rust/issues/3683 </sup>: traits 1.283
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-8709.rs <sup>https://github.com/rust-lang/rust/issues/8709 </sup>: macros 1.291
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-20616-9.rs <sup>https://github.com/rust-lang/rust/issues/20616 </sup>: parser 1.293
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-64732.rs <sup>https://github.com/rust-lang/rust/issues/64732 </sup>: parser 1.296
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-18655.rs <sup>https://github.com/rust-lang/rust/issues/18655 </sup>: associated-types 1.305
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-32947.rs <sup>https://github.com/rust-lang/rust/issues/32947 </sup>: simd 1.322
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-57198.rs <sup>https://github.com/rust-lang/rust/issues/57198 </sup>: parser 1.342
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-10764-rpass.rs <sup>https://github.com/rust-lang/rust/issues/10764 </sup>: extern 1.392
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-73541-2.rs <sup>https://github.com/rust-lang/rust/issues/73541 </sup>: async-await 1.422
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-7970b.rs <sup>https://github.com/rust-lang/rust/issues/7970 </sup>: parser 1.439
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-57684.rs <sup>https://github.com/rust-lang/rust/issues/57684 </sup>: parser 1.512
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-33264.rs <sup>https://github.com/rust-lang/rust/issues/33264 </sup>: llvm-asm 1.523
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-65284-suggest-generic-trait-bound.rs <sup>https://github.com/rust-lang/rust/issues/65284 </sup>: suggestions 1.647
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-17458.rs <sup>https://github.com/rust-lang/rust/issues/17458 </sup>: consts 1.711
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-56762.rs <sup>https://github.com/rust-lang/rust/issues/56762 </sup>: consts 1.787
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-2216.rs <sup>https://github.com/rust-lang/rust/issues/2216 </sup>: for-loop-while 1.856
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.rs <sup>https://github.com/rust-lang/rust/issues/45696 </sup>: nll 2.009
https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-46036.rs <sup>https://github.com/rust-lang/rust/issues/46036 </sup>: nll 2.059
````@petrochenkov```` Can you put a place holder (like `N/A`) for tests without GitHub issues? It is a lot easier to parse fixed sized rows.
2021-02-01 14:29:33 +01:00
Jonas Schievink
ab74346b96
Rollup merge of #81364 - camelid:improve-build-matches-docs, r=varkor
...
Improve `rustc_mir_build::matches` docs
- Fix typos
- Add more information
- General cleanup
2021-02-01 14:29:31 +01:00
Jonas Schievink
21d0e9b8dc
Rollup merge of #79291 - JulianKnodt:ce_priv, r=petrochenkov
...
Add error message for private fn
Attempts to add a more detailed error when a `const_evaluatable` fn from another scope is used inside of a scope which cannot access it.
r? ````@lcnr````
2021-02-01 14:29:29 +01:00
Jonas Schievink
a7a6f013a2
Rollup merge of #78641 - the8472:buffered-copy, r=sfackler
...
Let io::copy reuse BufWriter buffers
This optimization will allow users to implicitly set the buffer size for io::copy by wrapping the writer into a `BufWriter` if the default block size is insufficient, which should fix #49921
Due to min_specialization limitations this approach only works with `BufWriter` but not for `BufReader<R>` since `R` is unconstrained and thus the necessary specialization on `R: Read` is not always applicable. Once specialization becomes more powerful this optimization could be extended to look at the reader and writer side and use whichever buffer is larger.
2021-02-01 14:29:28 +01:00
bors
70b18bc2cb
Auto merge of #81623 - jonas-schievink:rust-analyzer-2021-02-01, r=jonas-schievink
...
⬆️ rust-analyzer
2021-02-01 13:29:15 +00:00
Jonas Schievink
3aefd95479
⬆️ rust-analyzer
2021-02-01 14:27:09 +01:00
bors
9607b5c6ac
Auto merge of #80851 - m-ou-se:panic-2021, r=petrochenkov
...
Implement Rust 2021 panic
This implements the Rust 2021 versions of `panic!()`. See https://github.com/rust-lang/rust/issues/80162 and https://github.com/rust-lang/rfcs/pull/3007 .
It does so by replacing `{std, core}::panic!()` by a bulitin macro that expands to either `$crate::panic::panic_2015!(..)` or `$crate::panic::panic_2021!(..)` depending on the edition of the caller.
This does not yet make std's panic an alias for core's panic on Rust 2021 as the RFC proposes. That will be a separate change: https://github.com/rust-lang/rust/pull/80879/commits/c5273bdfb266c35e8eab9413aa8d58d27fdbe114 That change is blocked on figuring out what to do with https://github.com/rust-lang/rust/issues/80846 first.
2021-02-01 10:25:31 +00:00
bors
e0d9f79399
Auto merge of #80851 - m-ou-se:panic-2021, r=petrochenkov
...
Implement Rust 2021 panic
This implements the Rust 2021 versions of `panic!()`. See https://github.com/rust-lang/rust/issues/80162 and https://github.com/rust-lang/rfcs/pull/3007 .
It does so by replacing `{std, core}::panic!()` by a bulitin macro that expands to either `$crate::panic::panic_2015!(..)` or `$crate::panic::panic_2021!(..)` depending on the edition of the caller.
This does not yet make std's panic an alias for core's panic on Rust 2021 as the RFC proposes. That will be a separate change: https://github.com/rust-lang/rust/pull/80879/commits/c5273bdfb266c35e8eab9413aa8d58d27fdbe114 That change is blocked on figuring out what to do with https://github.com/rust-lang/rust/issues/80846 first.
2021-02-01 10:25:31 +00:00
bjorn3
27855331e8
Merge commit ' d556c56f79
' into sync_cg_clif-2021-02-01
2021-02-01 10:11:46 +01:00
Dániel Buga
003fba3fda
Assert the size of the refactored enums
2021-02-01 09:23:40 +01:00
Dániel Buga
6fd01e0b6e
Box the biggest ast::ItemKind variants
2021-02-01 09:23:39 +01:00
Dániel Buga
b87e1ecdf0
Box the biggest ast::ItemKind variants
2021-02-01 09:23:39 +01:00
Sebastian Dröge
12b605af88
Implement TrustedLen
for iter::Fuse<I: TrustedLen>
2021-02-01 09:47:23 +02:00
Sebastian Dröge
99893346e8
Add SAFETY comment for the TrustedRandomAccess
impl of iter::Fuse
2021-02-01 09:47:22 +02:00
Aman Arora
bf4bdd95c3
Add lint for 2229 migrations
2021-01-31 23:21:04 -05:00
Camelid
82010e86d3
rustdoc: Note why rustdoc::html::markdown
is public
...
Almost all of the modules are crate-private, except for
`rustdoc::json::types`, which I believe is intended to be for public
use; and `rustdoc::html::markdown`, which is used externally by the
error-index generator and so has to be public.
2021-01-31 19:22:37 -08:00
bors
fee0d31397
Auto merge of #81591 - RalfJung:miri, r=RalfJung
...
update Miri
Fixes https://github.com/rust-lang/rust/issues/81551
Cc `@rust-lang/miri` r? `@ghost`
2021-02-01 02:42:07 +00:00
bors
941343e087
Auto merge of #81596 - jonas-schievink:rollup-utk14gr, r=jonas-schievink
...
Rollup of 11 pull requests
Successful merges:
- #80092 (2229: Fix issues with move closures and mutability)
- #80404 (Remove const_in_array_repeat)
- #81255 (Don't link with --export-dynamic on wasm32-wasi)
- #81480 (Add suggestion for nested fields)
- #81549 (Misc ip documentation fixes)
- #81566 (Add a test for #71202 )
- #81568 (Fix an old FIXME in redundant paren lint)
- #81571 (Fix typo in E0759)
- #81572 (Edit multiple error code Markdown files)
- #81589 (Fix small typo in string.rs)
- #81590 (Stabilize int_bits_const)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
2021-01-31 23:45:37 +00:00
Camelid
8b52cdc942
Update outdated comment
...
The highest-priority item is the *first* in the list, not the last.
See [this code][1] for more.
[this code]: 0e63af5da3/compiler/rustc_mir_build/src/build/matches/mod.rs (L1334-L1335)
2021-01-31 15:41:17 -08:00
Caio
2bb4a694d1
Move some tests to more reasonable directories
2021-01-31 19:46:46 -03:00
Cameron Steffen
939136d1bc
Remove Option from path_to_res return type
2021-01-31 15:59:34 -06:00
kadmin
6a03f0350d
Add error message for private fn
...
Bless tests
Update with changes from comments
2021-01-31 20:45:13 +00:00
Julian Wollersberger
988d93c8a0
Indent the code correctly again after removing the query categories.
2021-01-31 21:40:03 +01:00
Julian Wollersberger
7bc09f78af
Remove the remains of the query categories.
2021-01-31 21:37:17 +01:00
Aaron Hill
6c14aad58e
Improve handling of spans around macro result parse errors
...
Fixes #81543
After we expand a macro, we try to parse the resulting tokens as a AST
node. This commit makes several improvements to how we handle spans when
an error occurs:
* Only ovewrite the original `Span` if it's a dummy span. This preserves
a more-specific span if one is available.
* Use `self.prev_token` instead of `self.token` when emitting an error
message after encountering EOF, since an EOF token always has a dummy
span
* Make `SourceMap::next_point` leave dummy spans unused. A dummy span
does not have a logical 'next point', since it's a zero-length span.
Re-using the span span preserves its 'dummy-ness' for other checks
2021-01-31 15:24:34 -05:00
Waffle
d5c221107e
add Vec::extend_from_within
method
...
Implement <https://github.com/rust-lang/rfcs/pull/2714 >, changes from the RFC:
- Rename the method `append_from_within` => `extend_from_within`
- Loose :Copy bound => :Clone
- Specialize in case of :Copy
This commit also adds `Vec::split_at_spare` private method and use it to implement
`Vec::spare_capacity_mut` and `Vec::extend_from_within`. This method returns 2
slices - initialized elements (same as `&mut vec[..]`) and uninitialized but
allocated space (same as `vec.spare_capacity_mut()`).
2021-01-31 22:30:19 +03:00
Eric Huss
071d22760a
rustbuild: Don't build compiler twice for error-index-generator.
2021-01-31 10:25:29 -08:00