Nicholas Nethercote
7a4fdcbbc5
Remove unnecessary fields from EnumNonMatchingCollapsed.
...
The `&[ast::Variant]` field isn't used.
The `Vec<Ident>` field is only used for its length, but that's always
the same as the length of the `&[Ident]` and so isn't necessary.
2022-07-01 06:04:36 +10:00
Nicholas Nethercote
72a1621061
Use split_{first,last} in cs_fold1.
...
It makes the code a little nicer to read.
2022-07-01 06:04:36 +10:00
Camille GILLOT
6bb549f0d1
Allow inlining #[inline] functions.
2022-06-30 21:45:29 +02:00
Wesley Wiser
d1d9092e3c
Test enabling MIR inliner
2022-06-30 21:45:29 +02:00
Camille GILLOT
b33c6e1bd8
Do not error on the param_env during inlining.
...
This created unexpected diagnostics while compiling alga:
cannot satisfy `<Self as Module>::Ring == _`
Turns out that we don't need this diagnostic as we disable inlining when
it would trigger an ICE.
2022-06-30 21:45:29 +02:00
Camille GILLOT
ce4b5c8afc
Skip inlining if there are normalization issues.
2022-06-30 21:45:29 +02:00
Camille GILLOT
0161ecd13f
Recover when failing to normalize closure signature.
2022-06-30 21:45:29 +02:00
Camille GILLOT
2e45cd4b69
Do not ICE when failing to resolve.
2022-06-30 21:45:29 +02:00
Camille GILLOT
114c9284b9
Check history earlier.
2022-06-30 21:45:29 +02:00
Wesley Wiser
5999f34ff6
Don't assert polymorphization has taken effect in const eval
...
Const eval no longer runs MIR optimizations so unless this is getting
run as part of a MIR optimization like const-prop, there can be unused
type parameters even if polymorphization is enabled.
2022-06-30 21:45:29 +02:00
Vincenzo Palazzo
835b7a523a
ui: improve suggestion test by addig the help message
...
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com >
2022-06-30 18:59:36 +00:00
Matthias Krüger
8385d6bee4
Rollup merge of #98695 - tshepang:or-pattern, r=compiler-errors
...
use "or pattern"
2022-06-30 19:55:55 +02:00
Matthias Krüger
9bcf992499
Rollup merge of #98688 - RalfJung:from-mplace, r=oli-obk
...
interpret: add From<&MplaceTy> for PlaceTy
We have a similar instance for `&MPlaceTy` to `OpTy`. Also add the same for `&mut`.
This avoids having to write `&(*place).into()`, which we have a few times here and at least twice in Miri (and it comes up again in my current patch).
r? ```@oli-obk```
2022-06-30 19:55:54 +02:00
Matthias Krüger
6ee667374e
Rollup merge of #98677 - lyming2007:issue-98492-fix, r=lcnr
...
For diagnostic information of Boolean, remind it as use the type: 'bool'
Fixes #98492 .
It helps programmers coming from other languages
modified: compiler/rustc_resolve/src/late/diagnostics.rs
2022-06-30 19:55:53 +02:00
Matthias Krüger
5cd41d7be8
Rollup merge of #98670 - krasimirgg:llvm-15-LLVMConstExtractValue, r=nikic
...
llvm-wrapper: adapt for LLVMConstExtractValue removal
`LLVMConstExtractValue` was removed recently from LLVM: 5548e807b5 .
This adapts llvm-wrapper to use the new alternative where available, following https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/LLVMConstExtractValue.20removal .
2022-06-30 19:55:52 +02:00
Yiming Lei
15d3ea504a
For diagnostic information of Boolean, remind it as use the type: 'bool'
...
It helps programmers coming from other languages
modified: compiler/rustc_resolve/src/late/diagnostics.rs
modified: src/test/ui/lint/recommend-literal.rs
modified: src/test/ui/lint/recommend-literal.stderr
modified: compiler/rustc_resolve/src/late/diagnostics.rs
modified: src/test/ui/lint/recommend-literal.rs
modified: src/test/ui/lint/recommend-literal.stderr
modified: compiler/rustc_resolve/src/late/diagnostics.rs
modified: src/test/ui/lint/recommend-literal.rs
modified: src/test/ui/lint/recommend-literal.stderr
2022-06-30 08:34:10 -07:00
Niko Matsakis
7fda86249f
promote placeholder bounds to 'static obligations
...
In NLL, when we are promoting a bound out from a closure,
if we have a requirement that `T: 'a` where `'a` is in a
higher universe, we were previously ignoring that, which is
totally wrong. We should be promoting those constraints to `'static`,
since universes are not expressible across closure boundaries.
2022-06-30 10:49:23 -04:00
Oli Scherer
84fc551664
Make evaluate_obligation not succeed unconditionally if it registered new hidden types for opaque types
2022-06-30 14:23:31 +00:00
lcnr
e043821e93
add issue number to fixme
2022-06-30 15:53:17 +02:00
Oli Scherer
ade2a96ff1
use a method instead of manually doing what its body does
2022-06-30 13:24:35 +00:00
lcnr
8931fbd694
add logging to write_resolution
2022-06-30 14:48:49 +02:00
Krasimir Georgiev
a3a88c73f1
llvm-wrapper: adapt for LLVMConstExtractValue removal
2022-06-30 12:47:34 +00:00
bors
7425fb293f
Auto merge of #98377 - davidv1992:add-lifetimes-to-argument-temporaries, r=oli-obk
...
Added llvm lifetime annotations to function call argument temporaries.
The goal of this change is to ensure that llvm will do stack slot
optimization on these temporaries. This ensures that in code like:
```rust
const A: [u8; 1024] = [0; 1024];
fn copy_const() {
f(A);
f(A);
}
```
we only use 1024 bytes of stack space, instead of 2048 bytes.
I am new to developing for the rust compiler, and as such not entirely sure, but I believe this should be sufficient to close #98156 .
Also, this does not contain a test case to ensure this keeps working, primarily because I am not sure how to go about testing this. I would love some suggestions as to how that could be approached.
2022-06-30 09:20:52 +00:00
David Wood
fedd4c63f8
lint: port asm labels diagnostics
...
Signed-off-by: David Wood <david.wood@huawei.com >
2022-06-30 08:59:22 +01:00
David Wood
5524ca1a1d
lint: port deref nullptr diagnostics
...
Signed-off-by: David Wood <david.wood@huawei.com >
2022-06-30 08:59:22 +01:00
David Wood
2e563a4a3e
lint: port clashing extern diagnostics
...
Signed-off-by: David Wood <david.wood@huawei.com >
2022-06-30 08:59:22 +01:00
David Wood
157cbbca04
lint: add todo for invalid value diagnostics
...
Signed-off-by: David Wood <david.wood@huawei.com >
2022-06-30 08:59:22 +01:00
David Wood
bd8fe82138
lint: port incomplete features diagnostics
...
Signed-off-by: David Wood <david.wood@huawei.com >
2022-06-30 08:59:22 +01:00
David Wood
acea23e796
lint: port explicit outlives diagnostics
...
Signed-off-by: David Wood <david.wood@huawei.com >
2022-06-30 08:59:22 +01:00
David Wood
10676418fa
lint: port keyword idents diagnostics
...
Signed-off-by: David Wood <david.wood@huawei.com >
2022-06-30 08:59:22 +01:00
David Wood
10f2d3f566
lint: port test items diagnostics
...
Signed-off-by: David Wood <david.wood@huawei.com >
2022-06-30 08:59:22 +01:00
David Wood
3a498a7436
lint: port ... range pattern diagnostics
...
Signed-off-by: David Wood <david.wood@huawei.com >
2022-06-30 08:59:22 +01:00
David Wood
3c9bda5b20
lint: port trivial bounds diagnostics
...
Signed-off-by: David Wood <david.wood@huawei.com >
2022-06-30 08:59:22 +01:00
David Wood
01a64af4dd
lint: port type alias bounds diagnostics
...
Signed-off-by: David Wood <david.wood@huawei.com >
2022-06-30 08:59:22 +01:00
David Wood
dbced105db
lint: port unreachable pub diagnostic
...
Signed-off-by: David Wood <david.wood@huawei.com >
2022-06-30 08:59:22 +01:00
David Wood
23ee3e0914
lint: port unstable feature diagnostics
...
Signed-off-by: David Wood <david.wood@huawei.com >
2022-06-30 08:59:22 +01:00
David Wood
d071f504f8
lint: port mutable transmutes diagnostic
...
Signed-off-by: David Wood <david.wood@huawei.com >
2022-06-30 08:59:22 +01:00
David Wood
dbdbdb6874
lint: port no-mangle diagnostics
...
Signed-off-by: David Wood <david.wood@huawei.com >
2022-06-30 08:59:22 +01:00
David Wood
a13b70ea83
lint: port unused doc comment diagnostics
...
Signed-off-by: David Wood <david.wood@huawei.com >
2022-06-30 08:59:22 +01:00
David Wood
e151d66343
lint: port deprecated attr diagnostics
...
Signed-off-by: David Wood <david.wood@huawei.com >
2022-06-30 08:59:22 +01:00
David Wood
18a48c1d6c
lint: port anonymous parameter diagnostics
...
Signed-off-by: David Wood <david.wood@huawei.com >
2022-06-30 08:59:22 +01:00
David Wood
284ec37810
lint: port missing debug impl diagnostics
...
Signed-off-by: David Wood <david.wood@huawei.com >
2022-06-30 08:59:22 +01:00
David Wood
28655bc955
lint: port missing copy impl diagnostics
...
Signed-off-by: David Wood <david.wood@huawei.com >
2022-06-30 08:59:22 +01:00
David Wood
82bd2c23e5
lint: port missing documentation diagnostics
...
Signed-off-by: David Wood <david.wood@huawei.com >
2022-06-30 08:59:22 +01:00
David Wood
7dffd14b96
lint: port unsafe diagnostics
...
Signed-off-by: David Wood <david.wood@huawei.com >
2022-06-30 08:59:22 +01:00
David Wood
4c63a2145c
lint: port non-shorthand pattern diagnostics
...
Signed-off-by: David Wood <david.wood@huawei.com >
2022-06-30 08:59:22 +01:00
David Wood
d433c9a446
lint: port box pointers diagnostics
...
Signed-off-by: David Wood <david.wood@huawei.com >
2022-06-30 08:59:22 +01:00
David Wood
588977b350
lint: port while true diagnostics
...
Signed-off-by: David Wood <david.wood@huawei.com >
2022-06-30 08:59:22 +01:00
David Wood
4f7b10f484
lint: port unused allocation diagnostics
...
Signed-off-by: David Wood <david.wood@huawei.com >
2022-06-30 08:59:22 +01:00
David Wood
e24833869f
lint: port unused import braces diagnostics
...
Signed-off-by: David Wood <david.wood@huawei.com >
2022-06-30 08:59:22 +01:00