Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
2bd28d9
Add regression tests
TommasoBianchi Nov 24, 2019
042d855
Fix too restrictive checks on Drop impls
TommasoBianchi Dec 16, 2019
b08d697
Formatting fixes
TommasoBianchi Dec 16, 2019
020be74
Clean up E0120 long explanation
GuillaumeGomez Dec 19, 2019
94d207f
Clean up E0121 long explanation
GuillaumeGomez Dec 19, 2019
7f0741d
Update E0120.md
Dylan-DPC Dec 20, 2019
dce0f06
Update E0121.md
Dylan-DPC Dec 20, 2019
963f20d
Allow -Cllvm-args to override rustc's default LLVM args.
michaelwoerister Dec 18, 2019
1ca145c
Remove rarely used -Zdisable_instrumentation_preinliner flag.
michaelwoerister Dec 18, 2019
382d370
Make ptr::slice_from_raw_parts a const fn available under a feature flag
Dec 20, 2019
a7aec3f
1. ast::Mutability::{Mutable -> Mut, Immutable -> Not}.
Centril Dec 16, 2019
a7641f1
address review comments
Centril Dec 19, 2019
6d7c6d7
into: simplify AddressOf logic after rebase
Centril Dec 20, 2019
d490c34
Don't ICE in subslice pattern const-eval
matthewjasper Dec 20, 2019
16b7fd2
Fix src/libcore/str/mod.rs doc comments
brunobell Dec 21, 2019
8c3c446
Add more tests for slice patterns
matthewjasper Dec 15, 2019
1113eb5
Rollup merge of #67059 - TommasoBianchi:dropck_fix_pr, r=pnkfelix
Centril Dec 21, 2019
c0bf3af
Rollup merge of #67355 - Centril:merge-mut, r=oli-obk
Centril Dec 21, 2019
6e3b1d6
Rollup merge of #67393 - michaelwoerister:llvm-args-override, r=varkor
Centril Dec 21, 2019
a01f956
Rollup merge of #67422 - GuillaumeGomez:cleanup-err-codes, r=Dylan-DPC
Centril Dec 21, 2019
f43ced3
Rollup merge of #67462 - DutchGhost:const_slice_from_raw_parts, r=dto…
Centril Dec 21, 2019
0a2813c
Rollup merge of #67467 - matthewjasper:test-slice-patterns, r=oli-obk
Centril Dec 21, 2019
466fdea
Rollup merge of #67478 - brunobell:master, r=Centril
Centril Dec 21, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Clean up E0121 long explanation
  • Loading branch information
GuillaumeGomez committed Dec 19, 2019
commit 94d207f4b27ba45b8d33e7e73d0829074a02117d
24 changes: 19 additions & 5 deletions src/librustc_error_codes/error_codes/E0121.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
In order to be consistent with Rust's lack of global type inference,
type and const placeholders are disallowed by design in item signatures.
The type placeholder `_` was used withing a type on an item's signature.

Examples of this error include:
Erroneous code example:

```compile_fail,E0121
fn foo() -> _ { 5 } // error, explicitly write out the return type instead
fn foo() -> _ { 5 } // error

static BAR: _ = "test"; // error, explicitly write out the type instead
static BAR: _ = "test"; // error
```

In those cases, you need to provide the type explicitly:

```
fn foo() -> i32 { 5 } // ok!

static BAR: &str = "test"; // ok!
```

The type placeholder `_` can be used outside item's signature as follows:

```
let x = "a4a".split('4')
.collect::<Vec<_>>(); // No need to precise the Vec's generic type.
```