Skip to content

Instantly share code, notes, and snippets.

@Nadrieril
Created May 13, 2025 15:32
Show Gist options
  • Save Nadrieril/915c958726022d12e13e6deb9ce97d6f to your computer and use it in GitHub Desktop.
Save Nadrieril/915c958726022d12e13e6deb9ce97d6f to your computer and use it in GitHub Desktop.
JSON GOSIM chaorn demo
This file has been truncated, but you can view the full file.
{
"charon_version": "0.1.88",
"translated": {
"crate_name": "test_crate",
"options": {
"ullbc": false,
"lib": false,
"bin": null,
"mir_promoted": false,
"mir_optimized": false,
"mir": null,
"input_file": null,
"read_llbc": null,
"dest_dir": null,
"dest_file": "tests/ui/gosim-demo.llbc",
"use_polonius": false,
"skip_borrowck": false,
"no_code_duplication": false,
"monomorphize": false,
"extract_opaque_bodies": false,
"translate_all_methods": false,
"include": [],
"opaque": [],
"exclude": [],
"remove_associated_types": [],
"hide_marker_traits": false,
"start_from": [],
"no_cargo": false,
"rustc_args": [
"--edition=2021"
],
"cargo_args": [],
"abort_on_error": false,
"error_on_warnings": true,
"no_serialize": false,
"print_original_ullbc": false,
"print_ullbc": false,
"print_built_llbc": false,
"print_llbc": true,
"no_merge_goto_chains": false,
"no_ops_to_function_calls": false,
"preset": "Tests"
},
"all_ids": [
{
"Fun": 0
},
{
"Fun": 1
},
{
"TraitDecl": 0
},
{
"TraitDecl": 1
},
{
"Type": 0
},
{
"Type": 1
},
{
"Type": 2
},
{
"Type": 3
},
{
"Fun": 2
},
{
"TraitDecl": 2
},
{
"TraitImpl": 0
},
{
"Fun": 3
},
{
"TraitDecl": 3
},
{
"TraitImpl": 1
},
{
"Fun": 4
},
{
"TraitImpl": 2
},
{
"Fun": 5
},
{
"Fun": 6
},
{
"TraitImpl": 3
},
{
"Fun": 7
},
{
"Fun": 8
},
{
"Fun": 9
},
{
"Fun": 10
},
{
"Fun": 11
},
{
"Fun": 12
},
{
"Fun": 13
},
{
"Fun": 14
},
{
"Fun": 15
},
{
"TraitDecl": 4
},
{
"Fun": 16
},
{
"TraitDecl": 5
},
{
"TraitDecl": 6
},
{
"Fun": 17
},
{
"Fun": 18
},
{
"Fun": 19
},
{
"Fun": 20
},
{
"Fun": 21
},
{
"Fun": 22
},
{
"Fun": 23
},
{
"Fun": 24
},
{
"Fun": 25
},
{
"Fun": 26
},
{
"Fun": 27
},
{
"Fun": 28
},
{
"Fun": 29
},
{
"Fun": 30
},
{
"Fun": 31
},
{
"Fun": 32
},
{
"Fun": 33
},
{
"Fun": 34
},
{
"Fun": 35
},
{
"TraitDecl": 7
},
{
"Fun": 36
},
{
"TraitDecl": 8
},
{
"TraitDecl": 9
},
{
"Fun": 37
},
{
"TraitDecl": 10
},
{
"Fun": 38
},
{
"TraitDecl": 11
},
{
"Fun": 39
},
{
"TraitDecl": 12
},
{
"Fun": 40
},
{
"Fun": 41
},
{
"Fun": 42
},
{
"Fun": 43
},
{
"Fun": 44
},
{
"Fun": 45
},
{
"Fun": 46
},
{
"Fun": 47
},
{
"Fun": 48
},
{
"Fun": 49
},
{
"Fun": 50
},
{
"Fun": 51
},
{
"Fun": 52
},
{
"TraitDecl": 13
},
{
"Fun": 53
},
{
"TraitDecl": 14
},
{
"Fun": 54
},
{
"Fun": 55
},
{
"Fun": 56
},
{
"Type": 4
},
{
"Fun": 57
},
{
"Fun": 58
},
{
"Fun": 59
},
{
"Fun": 60
},
{
"Fun": 61
},
{
"TraitDecl": 15
},
{
"Fun": 62
},
{
"Fun": 63
},
{
"Fun": 64
},
{
"Fun": 65
},
{
"TraitDecl": 16
},
{
"Fun": 66
},
{
"TraitDecl": 17
},
{
"Fun": 67
},
{
"Fun": 68
},
{
"Fun": 69
},
{
"TraitDecl": 18
},
{
"Fun": 70
},
{
"Fun": 71
},
{
"TraitDecl": 19
},
{
"Fun": 72
},
{
"Fun": 73
},
{
"Fun": 74
},
{
"Fun": 75
},
{
"Fun": 76
},
{
"Fun": 77
},
{
"Fun": 78
},
{
"Fun": 79
},
{
"Fun": 80
},
{
"Fun": 81
},
{
"TraitDecl": 20
},
{
"Fun": 82
},
{
"Fun": 83
},
{
"Fun": 84
},
{
"Fun": 85
},
{
"Fun": 86
},
{
"TraitDecl": 21
},
{
"Fun": 87
},
{
"Fun": 88
},
{
"Fun": 89
},
{
"Fun": 90
},
{
"Fun": 91
},
{
"Fun": 92
},
{
"Fun": 93
},
{
"Fun": 94
},
{
"Fun": 95
},
{
"Fun": 96
},
{
"Fun": 97
},
{
"Fun": 98
},
{
"Fun": 99
},
{
"Fun": 100
},
{
"Fun": 101
},
{
"TraitDecl": 22
},
{
"Fun": 102
},
{
"Fun": 103
},
{
"TraitDecl": 23
},
{
"Fun": 104
},
{
"Fun": 105
},
{
"Type": 5
},
{
"Fun": 106
},
{
"Fun": 107
},
{
"Fun": 108
},
{
"Fun": 109
},
{
"Fun": 110
},
{
"Fun": 111
},
{
"Fun": 112
},
{
"Fun": 113
},
{
"Fun": 114
},
{
"Fun": 115
},
{
"Fun": 116
},
{
"Fun": 117
},
{
"Fun": 118
},
{
"Fun": 119
},
{
"Fun": 120
},
{
"Fun": 121
},
{
"Fun": 122
},
{
"Fun": 123
},
{
"Type": 6
},
{
"Type": 7
},
{
"Type": 8
},
{
"Fun": 124
},
{
"Fun": 125
},
{
"Fun": 126
},
{
"Fun": 127
},
{
"Fun": 128
},
{
"Fun": 129
},
{
"Fun": 130
},
{
"Fun": 131
},
{
"Fun": 132
},
{
"Fun": 133
},
{
"Fun": 134
},
{
"Fun": 135
},
{
"Fun": 136
},
{
"Fun": 137
},
{
"Fun": 138
},
{
"Fun": 139
},
{
"Fun": 140
},
{
"Fun": 141
},
{
"Fun": 142
}
],
"item_names": [
{
"key": {
"TraitImpl": 3
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"fmt",
0
]
},
{
"Ident": [
"num",
0
]
},
{
"Impl": [
{
"Trait": 3
},
80
]
}
]
},
{
"key": {
"TraitDecl": 6
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"ops",
0
]
},
{
"Ident": [
"function",
0
]
},
{
"Ident": [
"FnOnce",
0
]
}
]
},
{
"key": {
"Fun": 47
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"all",
0
]
}
]
},
{
"key": {
"Type": 8
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"fmt",
0
]
},
{
"Ident": [
"Error",
0
]
}
]
},
{
"key": {
"Fun": 125
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"fmt",
0
]
},
{
"Ident": [
"num",
0
]
},
{
"Impl": [
{
"Trait": 3
},
80
]
},
{
"Ident": [
"fmt",
0
]
}
]
},
{
"key": {
"TraitImpl": 1
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"slice",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Impl": [
{
"Trait": 1
},
182
]
}
]
},
{
"key": {
"Fun": 64
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"cycle",
0
]
}
]
},
{
"key": {
"Fun": 127
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"slice",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Impl": [
{
"Trait": 1
},
182
]
},
{
"Ident": [
"next",
0
]
}
]
},
{
"key": {
"Fun": 134
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"slice",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Impl": [
{
"Trait": 1
},
182
]
},
{
"Ident": [
"fold",
0
]
}
]
},
{
"key": {
"Fun": 121
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"exact_size",
0
]
},
{
"Ident": [
"ExactSizeIterator",
0
]
},
{
"Ident": [
"len",
0
]
}
]
},
{
"key": {
"Fun": 21
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"filter_map",
0
]
}
]
},
{
"key": {
"Fun": 123
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"fmt",
0
]
},
{
"Ident": [
"Debug",
0
]
},
{
"Ident": [
"fmt",
0
]
}
]
},
{
"key": {
"Fun": 38
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"collect_into",
0
]
}
]
},
{
"key": {
"Fun": 53
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"rposition",
0
]
}
]
},
{
"key": {
"Fun": 99
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"cmp",
0
]
},
{
"Ident": [
"PartialOrd",
0
]
},
{
"Ident": [
"__chaining_gt",
0
]
}
]
},
{
"key": {
"Fun": 32
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"map_windows",
0
]
}
]
},
{
"key": {
"Fun": 33
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"fuse",
0
]
}
]
},
{
"key": {
"Type": 1
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"option",
0
]
},
{
"Ident": [
"Option",
0
]
}
]
},
{
"key": {
"Fun": 82
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"__iterator_get_unchecked",
0
]
}
]
},
{
"key": {
"Fun": 43
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"try_for_each",
0
]
}
]
},
{
"key": {
"Fun": 109
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"accum",
0
]
},
{
"Ident": [
"Product",
0
]
},
{
"Ident": [
"product",
0
]
}
]
},
{
"key": {
"Fun": 96
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"cmp",
0
]
},
{
"Ident": [
"PartialOrd",
0
]
},
{
"Ident": [
"ge",
0
]
}
]
},
{
"key": {
"Fun": 9
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"count",
0
]
}
]
},
{
"key": {
"Fun": 130
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"slice",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Impl": [
{
"Trait": 1
},
182
]
},
{
"Ident": [
"last",
0
]
}
]
},
{
"key": {
"Fun": 140
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"slice",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Impl": [
{
"Trait": 1
},
182
]
},
{
"Ident": [
"rposition",
0
]
}
]
},
{
"key": {
"Fun": 86
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"cmp",
0
]
},
{
"Ident": [
"PartialEq",
0
]
},
{
"Ident": [
"ne",
0
]
}
]
},
{
"key": {
"TraitDecl": 7
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"collect",
0
]
},
{
"Ident": [
"FromIterator",
0
]
}
]
},
{
"key": {
"Fun": 92
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"cmp",
0
]
},
{
"Ident": [
"PartialOrd",
0
]
},
{
"Ident": [
"partial_cmp",
0
]
}
]
},
{
"key": {
"TraitDecl": 15
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"marker",
0
]
},
{
"Ident": [
"Copy",
0
]
}
]
},
{
"key": {
"TraitDecl": 0
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"marker",
0
]
},
{
"Ident": [
"Sized",
0
]
}
]
},
{
"key": {
"Fun": 119
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"double_ended",
0
]
},
{
"Ident": [
"DoubleEndedIterator",
0
]
},
{
"Ident": [
"rfold",
0
]
}
]
},
{
"key": {
"Fun": 0
},
"value": [
{
"Ident": [
"test_crate",
0
]
},
{
"Ident": [
"debug_slice",
0
]
}
]
},
{
"key": {
"TraitDecl": 1
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"fmt",
0
]
},
{
"Ident": [
"Debug",
0
]
}
]
},
{
"key": {
"Fun": 80
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"is_sorted_by",
0
]
}
]
},
{
"key": {
"Fun": 50
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"find_map",
0
]
}
]
},
{
"key": {
"Fun": 59
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"min_by",
0
]
}
]
},
{
"key": {
"Fun": 128
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"slice",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Impl": [
{
"Trait": 1
},
182
]
},
{
"Ident": [
"size_hint",
0
]
}
]
},
{
"key": {
"TraitDecl": 5
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"ops",
0
]
},
{
"Ident": [
"function",
0
]
},
{
"Ident": [
"FnMut",
0
]
}
]
},
{
"key": {
"TraitDecl": 3
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
}
]
},
{
"key": {
"Fun": 56
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"max_by_key",
0
]
}
]
},
{
"key": {
"Fun": 3
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"next",
0
]
}
]
},
{
"key": {
"Fun": 12
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"nth",
0
]
}
]
},
{
"key": {
"TraitDecl": 10
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"collect",
0
]
},
{
"Ident": [
"Extend",
0
]
}
]
},
{
"key": {
"Type": 3
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"fmt",
0
]
},
{
"Ident": [
"rt",
0
]
},
{
"Ident": [
"Argument",
0
]
}
]
},
{
"key": {
"Fun": 25
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"take_while",
0
]
}
]
},
{
"key": {
"Fun": 1
},
"value": [
{
"Ident": [
"test_crate",
0
]
},
{
"Ident": [
"main",
0
]
}
]
},
{
"key": {
"Fun": 2
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"collect",
0
]
},
{
"Ident": [
"IntoIterator",
0
]
},
{
"Ident": [
"into_iter",
0
]
}
]
},
{
"key": {
"Fun": 16
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"intersperse",
0
]
}
]
},
{
"key": {
"Fun": 26
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"map_while",
0
]
}
]
},
{
"key": {
"TraitDecl": 12
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"double_ended",
0
]
},
{
"Ident": [
"DoubleEndedIterator",
0
]
}
]
},
{
"key": {
"Fun": 40
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"partition_in_place",
0
]
}
]
},
{
"key": {
"Fun": 61
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"unzip",
0
]
}
]
},
{
"key": {
"Fun": 23
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"peekable",
0
]
}
]
},
{
"key": {
"TraitDecl": 11
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"default",
0
]
},
{
"Ident": [
"Default",
0
]
}
]
},
{
"key": {
"Fun": 69
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"cmp_by",
0
]
}
]
},
{
"key": {
"TraitDecl": 9
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"ops",
0
]
},
{
"Ident": [
"try_trait",
0
]
},
{
"Ident": [
"Residual",
0
]
}
]
},
{
"key": {
"Fun": 100
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"cmp",
0
]
},
{
"Ident": [
"PartialOrd",
0
]
},
{
"Ident": [
"__chaining_ge",
0
]
}
]
},
{
"key": {
"Fun": 52
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"position",
0
]
}
]
},
{
"key": {
"Fun": 67
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"product",
0
]
}
]
},
{
"key": {
"Fun": 49
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"find",
0
]
}
]
},
{
"key": {
"Fun": 115
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"double_ended",
0
]
},
{
"Ident": [
"DoubleEndedIterator",
0
]
},
{
"Ident": [
"next_back",
0
]
}
]
},
{
"key": {
"Fun": 36
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"collect",
0
]
}
]
},
{
"key": {
"Fun": 13
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"step_by",
0
]
}
]
},
{
"key": {
"Fun": 37
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"try_collect",
0
]
}
]
},
{
"key": {
"TraitDecl": 20
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"adapters",
0
]
},
{
"Ident": [
"zip",
0
]
},
{
"Ident": [
"TrustedRandomAccessNoCoerce",
0
]
}
]
},
{
"key": {
"Fun": 116
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"double_ended",
0
]
},
{
"Ident": [
"DoubleEndedIterator",
0
]
},
{
"Ident": [
"advance_back_by",
0
]
}
]
},
{
"key": {
"TraitImpl": 0
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"slice",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Impl": [
{
"Trait": 0
},
1
]
}
]
},
{
"key": {
"Fun": 42
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"try_fold",
0
]
}
]
},
{
"key": {
"Fun": 94
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"cmp",
0
]
},
{
"Ident": [
"PartialOrd",
0
]
},
{
"Ident": [
"le",
0
]
}
]
},
{
"key": {
"Fun": 11
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"advance_by",
0
]
}
]
},
{
"key": {
"TraitDecl": 22
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"marker",
0
]
},
{
"Ident": [
"Tuple",
0
]
}
]
},
{
"key": {
"Fun": 139
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"slice",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Impl": [
{
"Trait": 1
},
182
]
},
{
"Ident": [
"position",
0
]
}
]
},
{
"key": {
"Fun": 14
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"chain",
0
]
}
]
},
{
"key": {
"Fun": 78
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"ge",
0
]
}
]
},
{
"key": {
"Fun": 29
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"scan",
0
]
}
]
},
{
"key": {
"Fun": 88
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"cmp",
0
]
},
{
"Ident": [
"Ord",
0
]
},
{
"Ident": [
"max",
0
]
}
]
},
{
"key": {
"Fun": 91
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"cmp",
0
]
},
{
"Ident": [
"Eq",
0
]
},
{
"Ident": [
"assert_receiver_is_total_eq",
0
]
}
]
},
{
"key": {
"Fun": 28
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"take",
0
]
}
]
},
{
"key": {
"Fun": 120
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"double_ended",
0
]
},
{
"Ident": [
"DoubleEndedIterator",
0
]
},
{
"Ident": [
"rfind",
0
]
}
]
},
{
"key": {
"Fun": 60
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"rev",
0
]
}
]
},
{
"key": {
"Type": 6
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"fmt",
0
]
},
{
"Ident": [
"Formatter",
0
]
}
]
},
{
"key": {
"TraitDecl": 17
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"accum",
0
]
},
{
"Ident": [
"Product",
0
]
}
]
},
{
"key": {
"Fun": 113
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"collect",
0
]
},
{
"Ident": [
"Extend",
0
]
},
{
"Ident": [
"extend_reserve",
0
]
}
]
},
{
"key": {
"Fun": 95
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"cmp",
0
]
},
{
"Ident": [
"PartialOrd",
0
]
},
{
"Ident": [
"gt",
0
]
}
]
},
{
"key": {
"Fun": 126
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"fmt",
0
]
},
{
"Impl": [
{
"Trait": 2
},
73
]
},
{
"Ident": [
"fmt",
0
]
}
]
},
{
"key": {
"Type": 5
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"ops",
0
]
},
{
"Ident": [
"control_flow",
0
]
},
{
"Ident": [
"ControlFlow",
0
]
}
]
},
{
"key": {
"Fun": 63
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"cloned",
0
]
}
]
},
{
"key": {
"Fun": 98
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"cmp",
0
]
},
{
"Ident": [
"PartialOrd",
0
]
},
{
"Ident": [
"__chaining_le",
0
]
}
]
},
{
"key": {
"Type": 7
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"result",
0
]
},
{
"Ident": [
"Result",
0
]
}
]
},
{
"key": {
"Fun": 132
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"slice",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Impl": [
{
"Trait": 1
},
182
]
},
{
"Ident": [
"nth",
0
]
}
]
},
{
"key": {
"Fun": 137
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"slice",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Impl": [
{
"Trait": 1
},
182
]
},
{
"Ident": [
"find",
0
]
}
]
},
{
"key": {
"TraitDecl": 18
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"cmp",
0
]
},
{
"Ident": [
"PartialOrd",
0
]
}
]
},
{
"key": {
"Fun": 35
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"by_ref",
0
]
}
]
},
{
"key": {
"TraitDecl": 16
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"accum",
0
]
},
{
"Ident": [
"Sum",
0
]
}
]
},
{
"key": {
"Fun": 71
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"partial_cmp_by",
0
]
}
]
},
{
"key": {
"TraitDecl": 23
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"ops",
0
]
},
{
"Ident": [
"try_trait",
0
]
},
{
"Ident": [
"FromResidual",
0
]
}
]
},
{
"key": {
"Fun": 106
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"ops",
0
]
},
{
"Ident": [
"try_trait",
0
]
},
{
"Ident": [
"FromResidual",
0
]
},
{
"Ident": [
"from_residual",
0
]
}
]
},
{
"key": {
"Fun": 131
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"slice",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Impl": [
{
"Trait": 1
},
182
]
},
{
"Ident": [
"advance_by",
0
]
}
]
},
{
"key": {
"Fun": 136
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"slice",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Impl": [
{
"Trait": 1
},
182
]
},
{
"Ident": [
"any",
0
]
}
]
},
{
"key": {
"Fun": 44
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"fold",
0
]
}
]
},
{
"key": {
"Fun": 7
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"next_chunk",
0
]
}
]
},
{
"key": {
"Fun": 39
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"partition",
0
]
}
]
},
{
"key": {
"Fun": 85
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"cmp",
0
]
},
{
"Ident": [
"PartialEq",
0
]
},
{
"Ident": [
"eq",
0
]
}
]
},
{
"key": {
"Fun": 133
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"slice",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Impl": [
{
"Trait": 1
},
182
]
},
{
"Ident": [
"for_each",
0
]
}
]
},
{
"key": {
"Fun": 114
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"collect",
0
]
},
{
"Ident": [
"Extend",
0
]
},
{
"Ident": [
"extend_one_unchecked",
0
]
}
]
},
{
"key": {
"Fun": 135
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"slice",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Impl": [
{
"Trait": 1
},
182
]
},
{
"Ident": [
"all",
0
]
}
]
},
{
"key": {
"Fun": 72
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"eq",
0
]
}
]
},
{
"key": {
"Fun": 141
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"slice",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Impl": [
{
"Trait": 1
},
182
]
},
{
"Ident": [
"is_sorted_by",
0
]
}
]
},
{
"key": {
"Fun": 142
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"slice",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Impl": [
{
"Trait": 1
},
182
]
},
{
"Ident": [
"__iterator_get_unchecked",
0
]
}
]
},
{
"key": {
"Type": 2
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"fmt",
0
]
},
{
"Ident": [
"Arguments",
0
]
}
]
},
{
"key": {
"Fun": 83
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"clone",
0
]
},
{
"Ident": [
"Clone",
0
]
},
{
"Ident": [
"clone",
0
]
}
]
},
{
"key": {
"TraitDecl": 2
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"collect",
0
]
},
{
"Ident": [
"IntoIterator",
0
]
}
]
},
{
"key": {
"Fun": 17
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"intersperse_with",
0
]
}
]
},
{
"key": {
"Fun": 15
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"zip",
0
]
}
]
},
{
"key": {
"Fun": 73
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"eq_by",
0
]
}
]
},
{
"key": {
"Fun": 87
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"cmp",
0
]
},
{
"Ident": [
"Ord",
0
]
},
{
"Ident": [
"cmp",
0
]
}
]
},
{
"key": {
"Fun": 124
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"slice",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Impl": [
{
"Trait": 0
},
1
]
},
{
"Ident": [
"into_iter",
0
]
}
]
},
{
"key": {
"Fun": 46
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"try_reduce",
0
]
}
]
},
{
"key": {
"TraitDecl": 8
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"ops",
0
]
},
{
"Ident": [
"try_trait",
0
]
},
{
"Ident": [
"Try",
0
]
}
]
},
{
"key": {
"TraitDecl": 13
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"exact_size",
0
]
},
{
"Ident": [
"ExactSizeIterator",
0
]
}
]
},
{
"key": {
"Fun": 62
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"copied",
0
]
}
]
},
{
"key": {
"Fun": 84
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"clone",
0
]
},
{
"Ident": [
"Clone",
0
]
},
{
"Ident": [
"clone_from",
0
]
}
]
},
{
"key": {
"Fun": 54
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"max",
0
]
}
]
},
{
"key": {
"Fun": 4
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"fmt",
0
]
},
{
"Ident": [
"rt",
0
]
},
{
"Impl": [
{
"Ty": {
"params": {
"regions": [
{
"index": 0,
"name": null
}
],
"types": [],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"skip_binder": {
"Adt": [
{
"Adt": 3
},
{
"regions": [
{
"Var": {
"Bound": [
0,
0
]
}
}
],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 3
}
}
}
]
},
"kind": "InherentImplBlock"
}
},
1
]
},
{
"Ident": [
"new_debug",
0
]
}
]
},
{
"key": {
"Fun": 51
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"try_find",
0
]
}
]
},
{
"key": {
"TraitDecl": 14
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"cmp",
0
]
},
{
"Ident": [
"Ord",
0
]
}
]
},
{
"key": {
"Fun": 57
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"max_by",
0
]
}
]
},
{
"key": {
"TraitDecl": 19
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"cmp",
0
]
},
{
"Ident": [
"PartialEq",
0
]
}
]
},
{
"key": {
"Fun": 93
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"cmp",
0
]
},
{
"Ident": [
"PartialOrd",
0
]
},
{
"Ident": [
"lt",
0
]
}
]
},
{
"key": {
"Fun": 90
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"cmp",
0
]
},
{
"Ident": [
"Ord",
0
]
},
{
"Ident": [
"clamp",
0
]
}
]
},
{
"key": {
"Fun": 8
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"size_hint",
0
]
}
]
},
{
"key": {
"Fun": 102
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"ops",
0
]
},
{
"Ident": [
"function",
0
]
},
{
"Ident": [
"FnMut",
0
]
},
{
"Ident": [
"call_mut",
0
]
}
]
},
{
"key": {
"Fun": 112
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"collect",
0
]
},
{
"Ident": [
"Extend",
0
]
},
{
"Ident": [
"extend_one",
0
]
}
]
},
{
"key": {
"Fun": 45
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"reduce",
0
]
}
]
},
{
"key": {
"Fun": 118
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"double_ended",
0
]
},
{
"Ident": [
"DoubleEndedIterator",
0
]
},
{
"Ident": [
"try_rfold",
0
]
}
]
},
{
"key": {
"Fun": 24
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"skip_while",
0
]
}
]
},
{
"key": {
"Fun": 22
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"enumerate",
0
]
}
]
},
{
"key": {
"Fun": 27
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"skip",
0
]
}
]
},
{
"key": {
"Fun": 58
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"min_by_key",
0
]
}
]
},
{
"key": {
"Fun": 79
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"is_sorted",
0
]
}
]
},
{
"key": {
"Fun": 129
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"slice",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Impl": [
{
"Trait": 1
},
182
]
},
{
"Ident": [
"count",
0
]
}
]
},
{
"key": {
"Fun": 10
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"last",
0
]
}
]
},
{
"key": {
"Type": 4
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"cmp",
0
]
},
{
"Ident": [
"Ordering",
0
]
}
]
},
{
"key": {
"Fun": 101
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"default",
0
]
},
{
"Ident": [
"Default",
0
]
},
{
"Ident": [
"default",
0
]
}
]
},
{
"key": {
"Type": 0
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"slice",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"Iter",
0
]
}
]
},
{
"key": {
"Fun": 20
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"filter",
0
]
}
]
},
{
"key": {
"Fun": 97
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"cmp",
0
]
},
{
"Ident": [
"PartialOrd",
0
]
},
{
"Ident": [
"__chaining_lt",
0
]
}
]
},
{
"key": {
"Fun": 55
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"min",
0
]
}
]
},
{
"key": {
"Fun": 19
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"for_each",
0
]
}
]
},
{
"key": {
"Fun": 111
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"collect",
0
]
},
{
"Ident": [
"Extend",
0
]
},
{
"Ident": [
"extend",
0
]
}
]
},
{
"key": {
"Fun": 6
},
"value": [
{
"Ident": [
"std",
0
]
},
{
"Ident": [
"io",
0
]
},
{
"Ident": [
"stdio",
0
]
},
{
"Ident": [
"_eprint",
0
]
}
]
},
{
"key": {
"Fun": 41
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"is_partitioned",
0
]
}
]
},
{
"key": {
"Fun": 77
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"gt",
0
]
}
]
},
{
"key": {
"Fun": 5
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"fmt",
0
]
},
{
"Impl": [
{
"Ty": {
"params": {
"regions": [
{
"index": 0,
"name": "'a"
}
],
"types": [],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"skip_binder": {
"Adt": [
{
"Adt": 2
},
{
"regions": [
{
"Var": {
"Bound": [
0,
0
]
}
}
],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 2
}
}
}
]
},
"kind": "InherentImplBlock"
}
},
4
]
},
{
"Ident": [
"new_v1",
0
]
}
]
},
{
"key": {
"Fun": 30
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"flat_map",
0
]
}
]
},
{
"key": {
"Fun": 48
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"any",
0
]
}
]
},
{
"key": {
"Fun": 76
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"le",
0
]
}
]
},
{
"key": {
"Fun": 108
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"accum",
0
]
},
{
"Ident": [
"Sum",
0
]
},
{
"Ident": [
"sum",
0
]
}
]
},
{
"key": {
"Fun": 104
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"ops",
0
]
},
{
"Ident": [
"try_trait",
0
]
},
{
"Ident": [
"Try",
0
]
},
{
"Ident": [
"from_output",
0
]
}
]
},
{
"key": {
"Fun": 34
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"inspect",
0
]
}
]
},
{
"key": {
"Fun": 68
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"cmp",
0
]
}
]
},
{
"key": {
"Fun": 18
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"map",
0
]
}
]
},
{
"key": {
"Fun": 75
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"lt",
0
]
}
]
},
{
"key": {
"Fun": 89
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"cmp",
0
]
},
{
"Ident": [
"Ord",
0
]
},
{
"Ident": [
"min",
0
]
}
]
},
{
"key": {
"Fun": 107
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"adapters",
0
]
},
{
"Ident": [
"zip",
0
]
},
{
"Ident": [
"TrustedRandomAccessNoCoerce",
0
]
},
{
"Ident": [
"size",
0
]
}
]
},
{
"key": {
"Fun": 122
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"exact_size",
0
]
},
{
"Ident": [
"ExactSizeIterator",
0
]
},
{
"Ident": [
"is_empty",
0
]
}
]
},
{
"key": {
"Fun": 31
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"flatten",
0
]
}
]
},
{
"key": {
"TraitImpl": 2
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"fmt",
0
]
},
{
"Impl": [
{
"Trait": 2
},
73
]
}
]
},
{
"key": {
"Fun": 70
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"partial_cmp",
0
]
}
]
},
{
"key": {
"Fun": 66
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"sum",
0
]
}
]
},
{
"key": {
"Fun": 74
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"ne",
0
]
}
]
},
{
"key": {
"Fun": 105
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"ops",
0
]
},
{
"Ident": [
"try_trait",
0
]
},
{
"Ident": [
"Try",
0
]
},
{
"Ident": [
"branch",
0
]
}
]
},
{
"key": {
"Fun": 117
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"double_ended",
0
]
},
{
"Ident": [
"DoubleEndedIterator",
0
]
},
{
"Ident": [
"nth_back",
0
]
}
]
},
{
"key": {
"Fun": 138
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"slice",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Impl": [
{
"Trait": 1
},
182
]
},
{
"Ident": [
"find_map",
0
]
}
]
},
{
"key": {
"TraitDecl": 4
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"clone",
0
]
},
{
"Ident": [
"Clone",
0
]
}
]
},
{
"key": {
"Fun": 81
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"is_sorted_by_key",
0
]
}
]
},
{
"key": {
"TraitDecl": 21
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"cmp",
0
]
},
{
"Ident": [
"Eq",
0
]
}
]
},
{
"key": {
"Fun": 65
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"array_chunks",
0
]
}
]
},
{
"key": {
"Fun": 103
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"ops",
0
]
},
{
"Ident": [
"function",
0
]
},
{
"Ident": [
"FnOnce",
0
]
},
{
"Ident": [
"call_once",
0
]
}
]
},
{
"key": {
"Fun": 110
},
"value": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"collect",
0
]
},
{
"Ident": [
"FromIterator",
0
]
},
{
"Ident": [
"from_iter",
0
]
}
]
}
],
"files": [
{
"name": {
"Local": "tests/ui/gosim-demo.rs"
},
"contents": "use std::fmt::Debug;\n\nfn debug_slice<T: Debug>(slice: &[T]) {\n for x in slice {\n eprintln!(\"- {x:?}\");\n }\n}\n\nfn main() {\n debug_slice(&[0, 1, 2]);\n}\n"
},
{
"name": {
"Virtual": "/rustc/library/core/src/lib.rs"
},
"contents": null
},
{
"name": {
"Virtual": "/rustc/library/core/src/marker.rs"
},
"contents": null
},
{
"name": {
"Virtual": "/rustc/library/core/src/fmt/mod.rs"
},
"contents": null
},
{
"name": {
"Virtual": "/rustc/library/core/src/slice/iter.rs"
},
"contents": null
},
{
"name": {
"Virtual": "/rustc/library/core/src/slice/mod.rs"
},
"contents": null
},
{
"name": {
"Virtual": "/rustc/library/core/src/option.rs"
},
"contents": null
},
{
"name": {
"Virtual": "/rustc/library/std/src/macros.rs"
},
"contents": null
},
{
"name": {
"Virtual": "/rustc/library/core/src/fmt/rt.rs"
},
"contents": null
},
{
"name": {
"Virtual": "/rustc/library/core/src/iter/traits/collect.rs"
},
"contents": null
},
{
"name": {
"Virtual": "/rustc/library/core/src/iter/mod.rs"
},
"contents": null
},
{
"name": {
"Virtual": "/rustc/library/core/src/iter/traits/mod.rs"
},
"contents": null
},
{
"name": {
"Virtual": "/rustc/library/core/src/iter/traits/iterator.rs"
},
"contents": null
},
{
"name": {
"Virtual": "/rustc/library/core/src/slice/iter/macros.rs"
},
"contents": null
},
{
"name": {
"Virtual": "/rustc/library/std/src/io/stdio.rs"
},
"contents": null
},
{
"name": {
"Virtual": "/rustc/library/std/src/lib.rs"
},
"contents": null
},
{
"name": {
"Virtual": "/rustc/library/std/src/io/mod.rs"
},
"contents": null
},
{
"name": {
"Virtual": "/rustc/library/core/src/fmt/num.rs"
},
"contents": null
},
{
"name": {
"Virtual": "/rustc/library/core/src/clone.rs"
},
"contents": null
},
{
"name": {
"Virtual": "/rustc/library/core/src/ops/mod.rs"
},
"contents": null
},
{
"name": {
"Virtual": "/rustc/library/core/src/ops/function.rs"
},
"contents": null
},
{
"name": {
"Virtual": "/rustc/library/core/src/ops/try_trait.rs"
},
"contents": null
},
{
"name": {
"Virtual": "/rustc/library/core/src/default.rs"
},
"contents": null
},
{
"name": {
"Virtual": "/rustc/library/core/src/iter/traits/double_ended.rs"
},
"contents": null
},
{
"name": {
"Virtual": "/rustc/library/core/src/iter/traits/exact_size.rs"
},
"contents": null
},
{
"name": {
"Virtual": "/rustc/library/core/src/cmp.rs"
},
"contents": null
},
{
"name": {
"Virtual": "/rustc/library/core/src/iter/traits/accum.rs"
},
"contents": null
},
{
"name": {
"Virtual": "/rustc/library/core/src/iter/adapters/mod.rs"
},
"contents": null
},
{
"name": {
"Virtual": "/rustc/library/core/src/iter/adapters/zip.rs"
},
"contents": null
},
{
"name": {
"Virtual": "/rustc/library/core/src/ops/control_flow.rs"
},
"contents": null
},
{
"name": {
"Virtual": "/rustc/library/core/src/result.rs"
},
"contents": null
}
],
"type_decls": [
{
"def_id": 0,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"slice",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"Iter",
0
]
}
],
"span": {
"span": {
"file_id": 4,
"beg": {
"line": 69,
"col": 0
},
"end": {
"line": 69,
"col": 26
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " Immutable slice iterator"
},
{
"DocComment": ""
},
{
"DocComment": " This struct is created by the [`iter`] method on [slices]."
},
{
"DocComment": ""
},
{
"DocComment": " # Examples"
},
{
"DocComment": ""
},
{
"DocComment": " Basic usage:"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " // First, we need a slice to call the `iter` method on:"
},
{
"DocComment": " let slice = &[1, 2, 3];"
},
{
"DocComment": ""
},
{
"DocComment": " // Then we call `iter` on the slice to get the `Iter` iterator,"
},
{
"DocComment": " // and iterate over it:"
},
{
"DocComment": " for element in slice.iter() {"
},
{
"DocComment": " println!(\"{element}\");"
},
{
"DocComment": " }"
},
{
"DocComment": ""
},
{
"DocComment": " // This for loop actually already works without calling `iter`:"
},
{
"DocComment": " for element in slice {"
},
{
"DocComment": " println!(\"{element}\");"
},
{
"DocComment": " }"
},
{
"DocComment": " ```"
},
{
"DocComment": ""
},
{
"DocComment": " [`iter`]: slice::iter"
},
{
"DocComment": " [slices]: slice"
},
{
"Unknown": {
"path": "must_use",
"args": null
}
},
{
"Unknown": {
"path": "rustc_diagnostic_item",
"args": null
}
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": "SliceIter"
},
"generics": {
"regions": [
{
"index": 0,
"name": "'a"
}
],
"types": [
{
"index": 0,
"name": "T"
}
],
"const_generics": [],
"trait_clauses": [
{
"clause_id": 0,
"span": {
"span": {
"file_id": 4,
"beg": {
"line": 69,
"col": 20
},
"end": {
"line": 69,
"col": 21
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnType",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"regions_outlive": [],
"types_outlive": [
{
"regions": [],
"skip_binder": [
{
"TypeVar": {
"Free": 0
}
},
{
"Var": {
"Free": 0
}
}
]
},
{
"regions": [],
"skip_binder": [
{
"TypeVar": {
"Free": 0
}
},
{
"Var": {
"Free": 0
}
}
]
}
],
"trait_type_constraints": []
},
"kind": "Opaque"
},
{
"def_id": 1,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"option",
0
]
},
{
"Ident": [
"Option",
0
]
}
],
"span": {
"span": {
"file_id": 6,
"beg": {
"line": 572,
"col": 0
},
"end": {
"line": 572,
"col": 18
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " The `Option` type. See [the module level documentation](self) for more."
},
{
"Unknown": {
"path": "doc",
"args": "search_unbox"
}
},
{
"Unknown": {
"path": "rustc_diagnostic_item",
"args": null
}
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": "Option"
},
"generics": {
"regions": [],
"types": [
{
"index": 0,
"name": "T"
}
],
"const_generics": [],
"trait_clauses": [
{
"clause_id": 0,
"span": {
"span": {
"file_id": 6,
"beg": {
"line": 572,
"col": 16
},
"end": {
"line": 572,
"col": 17
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnType",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"kind": {
"Enum": [
{
"span": {
"span": {
"file_id": 6,
"beg": {
"line": 576,
"col": 4
},
"end": {
"line": 576,
"col": 8
}
},
"generated_from_span": null
},
"attr_info": {
"attributes": [
{
"DocComment": " No value."
}
],
"inline": null,
"rename": null,
"public": true
},
"name": "None",
"fields": [],
"discriminant": {
"Isize": "0"
}
},
{
"span": {
"span": {
"file_id": 6,
"beg": {
"line": 580,
"col": 4
},
"end": {
"line": 580,
"col": 8
}
},
"generated_from_span": null
},
"attr_info": {
"attributes": [
{
"DocComment": " Some value of type `T`."
}
],
"inline": null,
"rename": null,
"public": true
},
"name": "Some",
"fields": [
{
"span": {
"span": {
"file_id": 6,
"beg": {
"line": 580,
"col": 55
},
"end": {
"line": 580,
"col": 56
}
},
"generated_from_span": null
},
"attr_info": {
"attributes": [],
"inline": null,
"rename": null,
"public": true
},
"name": null,
"ty": {
"TypeVar": {
"Free": 0
}
}
}
],
"discriminant": {
"Isize": "1"
}
}
]
}
},
{
"def_id": 2,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"fmt",
0
]
},
{
"Ident": [
"Arguments",
0
]
}
],
"span": {
"span": {
"file_id": 3,
"beg": {
"line": 613,
"col": 0
},
"end": {
"line": 613,
"col": 24
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " This structure represents a safely precompiled version of a format string"
},
{
"DocComment": " and its arguments. This cannot be generated at runtime because it cannot"
},
{
"DocComment": " safely be done, so no constructors are given and the fields are private"
},
{
"DocComment": " to prevent modification."
},
{
"DocComment": ""
},
{
"DocComment": " The [`format_args!`] macro will safely create an instance of this structure."
},
{
"DocComment": " The macro validates the format string at compile-time so usage of the"
},
{
"DocComment": " [`write()`] and [`format()`] functions can be safely performed."
},
{
"DocComment": ""
},
{
"DocComment": " You can use the `Arguments<'a>` that [`format_args!`] returns in `Debug`"
},
{
"DocComment": " and `Display` contexts as seen below. The example also shows that `Debug`"
},
{
"DocComment": " and `Display` format to the same thing: the interpolated format string"
},
{
"DocComment": " in `format_args!`."
},
{
"DocComment": ""
},
{
"DocComment": " ```rust"
},
{
"DocComment": " let debug = format!(\"{:?}\", format_args!(\"{} foo {:?}\", 1, 2));"
},
{
"DocComment": " let display = format!(\"{}\", format_args!(\"{} foo {:?}\", 1, 2));"
},
{
"DocComment": " assert_eq!(\"1 foo 2\", display);"
},
{
"DocComment": " assert_eq!(display, debug);"
},
{
"DocComment": " ```"
},
{
"DocComment": ""
},
{
"DocComment": " [`format()`]: ../../std/fmt/fn.format.html"
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": "format_arguments"
},
"generics": {
"regions": [
{
"index": 0,
"name": "'a"
}
],
"types": [],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [
{
"regions": [],
"skip_binder": [
{
"Var": {
"Free": 0
}
},
{
"Var": {
"Free": 0
}
}
]
}
],
"types_outlive": [],
"trait_type_constraints": []
},
"kind": "Opaque"
},
{
"def_id": 3,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"fmt",
0
]
},
{
"Ident": [
"rt",
0
]
},
{
"Ident": [
"Argument",
0
]
}
],
"span": {
"span": {
"file_id": 8,
"beg": {
"line": 95,
"col": 0
},
"end": {
"line": 95,
"col": 23
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": "format_argument"
},
"generics": {
"regions": [
{
"index": 0,
"name": "'a"
}
],
"types": [],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"kind": "Opaque"
},
{
"def_id": 4,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"cmp",
0
]
},
{
"Ident": [
"Ordering",
0
]
}
],
"span": {
"span": {
"file_id": 25,
"beg": {
"line": 388,
"col": 0
},
"end": {
"line": 388,
"col": 17
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " An `Ordering` is the result of a comparison between two values."
},
{
"DocComment": ""
},
{
"DocComment": " # Examples"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " use std::cmp::Ordering;"
},
{
"DocComment": ""
},
{
"DocComment": " assert_eq!(1.cmp(&2), Ordering::Less);"
},
{
"DocComment": ""
},
{
"DocComment": " assert_eq!(1.cmp(&1), Ordering::Equal);"
},
{
"DocComment": ""
},
{
"DocComment": " assert_eq!(2.cmp(&1), Ordering::Greater);"
},
{
"DocComment": " ```"
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": "Ordering"
},
"generics": {
"regions": [],
"types": [],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"kind": {
"Enum": [
{
"span": {
"span": {
"file_id": 25,
"beg": {
"line": 391,
"col": 4
},
"end": {
"line": 391,
"col": 8
}
},
"generated_from_span": null
},
"attr_info": {
"attributes": [
{
"DocComment": " An ordering where a compared value is less than another."
}
],
"inline": null,
"rename": null,
"public": true
},
"name": "Less",
"fields": [],
"discriminant": {
"I8": "-1"
}
},
{
"span": {
"span": {
"file_id": 25,
"beg": {
"line": 394,
"col": 4
},
"end": {
"line": 394,
"col": 9
}
},
"generated_from_span": null
},
"attr_info": {
"attributes": [
{
"DocComment": " An ordering where a compared value is equal to another."
}
],
"inline": null,
"rename": null,
"public": true
},
"name": "Equal",
"fields": [],
"discriminant": {
"I8": "0"
}
},
{
"span": {
"span": {
"file_id": 25,
"beg": {
"line": 397,
"col": 4
},
"end": {
"line": 397,
"col": 11
}
},
"generated_from_span": null
},
"attr_info": {
"attributes": [
{
"DocComment": " An ordering where a compared value is greater than another."
}
],
"inline": null,
"rename": null,
"public": true
},
"name": "Greater",
"fields": [],
"discriminant": {
"I8": "1"
}
}
]
}
},
{
"def_id": 5,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"ops",
0
]
},
{
"Ident": [
"control_flow",
0
]
},
{
"Ident": [
"ControlFlow",
0
]
}
],
"span": {
"span": {
"file_id": 29,
"beg": {
"line": 87,
"col": 0
},
"end": {
"line": 87,
"col": 31
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " Used to tell an operation whether it should exit early or go on as usual."
},
{
"DocComment": ""
},
{
"DocComment": " This is used when exposing things (like graph traversals or visitors) where"
},
{
"DocComment": " you want the user to be able to choose whether to exit early."
},
{
"DocComment": " Having the enum makes it clearer -- no more wondering \"wait, what did `false`"
},
{
"DocComment": " mean again?\" -- and allows including a value."
},
{
"DocComment": ""
},
{
"DocComment": " Similar to [`Option`] and [`Result`], this enum can be used with the `?` operator"
},
{
"DocComment": " to return immediately if the [`Break`] variant is present or otherwise continue normally"
},
{
"DocComment": " with the value inside the [`Continue`] variant."
},
{
"DocComment": ""
},
{
"DocComment": " # Examples"
},
{
"DocComment": ""
},
{
"DocComment": " Early-exiting from [`Iterator::try_for_each`]:"
},
{
"DocComment": " ```"
},
{
"DocComment": " use std::ops::ControlFlow;"
},
{
"DocComment": ""
},
{
"DocComment": " let r = (2..100).try_for_each(|x| {"
},
{
"DocComment": " if 403 % x == 0 {"
},
{
"DocComment": " return ControlFlow::Break(x)"
},
{
"DocComment": " }"
},
{
"DocComment": ""
},
{
"DocComment": " ControlFlow::Continue(())"
},
{
"DocComment": " });"
},
{
"DocComment": " assert_eq!(r, ControlFlow::Break(13));"
},
{
"DocComment": " ```"
},
{
"DocComment": ""
},
{
"DocComment": " A basic tree traversal:"
},
{
"DocComment": " ```"
},
{
"DocComment": " use std::ops::ControlFlow;"
},
{
"DocComment": ""
},
{
"DocComment": " pub struct TreeNode<T> {"
},
{
"DocComment": " value: T,"
},
{
"DocComment": " left: Option<Box<TreeNode<T>>>,"
},
{
"DocComment": " right: Option<Box<TreeNode<T>>>,"
},
{
"DocComment": " }"
},
{
"DocComment": ""
},
{
"DocComment": " impl<T> TreeNode<T> {"
},
{
"DocComment": " pub fn traverse_inorder<B>(&self, f: &mut impl FnMut(&T) -> ControlFlow<B>) -> ControlFlow<B> {"
},
{
"DocComment": " if let Some(left) = &self.left {"
},
{
"DocComment": " left.traverse_inorder(f)?;"
},
{
"DocComment": " }"
},
{
"DocComment": " f(&self.value)?;"
},
{
"DocComment": " if let Some(right) = &self.right {"
},
{
"DocComment": " right.traverse_inorder(f)?;"
},
{
"DocComment": " }"
},
{
"DocComment": " ControlFlow::Continue(())"
},
{
"DocComment": " }"
},
{
"DocComment": " fn leaf(value: T) -> Option<Box<TreeNode<T>>> {"
},
{
"DocComment": " Some(Box::new(Self { value, left: None, right: None }))"
},
{
"DocComment": " }"
},
{
"DocComment": " }"
},
{
"DocComment": ""
},
{
"DocComment": " let node = TreeNode {"
},
{
"DocComment": " value: 0,"
},
{
"DocComment": " left: TreeNode::leaf(1),"
},
{
"DocComment": " right: Some(Box::new(TreeNode {"
},
{
"DocComment": " value: -1,"
},
{
"DocComment": " left: TreeNode::leaf(5),"
},
{
"DocComment": " right: TreeNode::leaf(2),"
},
{
"DocComment": " }))"
},
{
"DocComment": " };"
},
{
"DocComment": " let mut sum = 0;"
},
{
"DocComment": ""
},
{
"DocComment": " let res = node.traverse_inorder(&mut |val| {"
},
{
"DocComment": " if *val < 0 {"
},
{
"DocComment": " ControlFlow::Break(*val)"
},
{
"DocComment": " } else {"
},
{
"DocComment": " sum += *val;"
},
{
"DocComment": " ControlFlow::Continue(())"
},
{
"DocComment": " }"
},
{
"DocComment": " });"
},
{
"DocComment": " assert_eq!(res, ControlFlow::Break(-1));"
},
{
"DocComment": " assert_eq!(sum, 6);"
},
{
"DocComment": " ```"
},
{
"DocComment": ""
},
{
"DocComment": " [`Break`]: ControlFlow::Break"
},
{
"DocComment": " [`Continue`]: ControlFlow::Continue"
},
{
"Unknown": {
"path": "rustc_diagnostic_item",
"args": null
}
},
{
"Unknown": {
"path": "must_use",
"args": null
}
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": "ControlFlow"
},
"generics": {
"regions": [],
"types": [
{
"index": 0,
"name": "B"
},
{
"index": 1,
"name": "C"
}
],
"const_generics": [],
"trait_clauses": [
{
"clause_id": 0,
"span": {
"span": {
"file_id": 29,
"beg": {
"line": 87,
"col": 21
},
"end": {
"line": 87,
"col": 22
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnType",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
},
{
"clause_id": 1,
"span": {
"span": {
"file_id": 29,
"beg": {
"line": 87,
"col": 24
},
"end": {
"line": 87,
"col": 30
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnType",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 1
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"kind": {
"Enum": [
{
"span": {
"span": {
"file_id": 29,
"beg": {
"line": 91,
"col": 4
},
"end": {
"line": 91,
"col": 12
}
},
"generated_from_span": null
},
"attr_info": {
"attributes": [
{
"DocComment": " Move on to the next phase of the operation as normal."
}
],
"inline": null,
"rename": null,
"public": true
},
"name": "Continue",
"fields": [
{
"span": {
"span": {
"file_id": 29,
"beg": {
"line": 91,
"col": 13
},
"end": {
"line": 91,
"col": 14
}
},
"generated_from_span": null
},
"attr_info": {
"attributes": [],
"inline": null,
"rename": null,
"public": true
},
"name": null,
"ty": {
"TypeVar": {
"Free": 1
}
}
}
],
"discriminant": {
"Isize": "0"
}
},
{
"span": {
"span": {
"file_id": 29,
"beg": {
"line": 95,
"col": 4
},
"end": {
"line": 95,
"col": 9
}
},
"generated_from_span": null
},
"attr_info": {
"attributes": [
{
"DocComment": " Exit the operation without running subsequent phases."
}
],
"inline": null,
"rename": null,
"public": true
},
"name": "Break",
"fields": [
{
"span": {
"span": {
"file_id": 29,
"beg": {
"line": 95,
"col": 10
},
"end": {
"line": 95,
"col": 11
}
},
"generated_from_span": null
},
"attr_info": {
"attributes": [],
"inline": null,
"rename": null,
"public": true
},
"name": null,
"ty": {
"TypeVar": {
"Free": 0
}
}
}
],
"discriminant": {
"Isize": "1"
}
}
]
}
},
{
"def_id": 6,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"fmt",
0
]
},
{
"Ident": [
"Formatter",
0
]
}
],
"span": {
"span": {
"file_id": 3,
"beg": {
"line": 562,
"col": 0
},
"end": {
"line": 562,
"col": 24
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " Configuration for formatting."
},
{
"DocComment": ""
},
{
"DocComment": " A `Formatter` represents various options related to formatting. Users do not"
},
{
"DocComment": " construct `Formatter`s directly; a mutable reference to one is passed to"
},
{
"DocComment": " the `fmt` method of all formatting traits, like [`Debug`] and [`Display`]."
},
{
"DocComment": ""
},
{
"DocComment": " To interact with a `Formatter`, you'll call various methods to change the"
},
{
"DocComment": " various options related to formatting. For examples, please see the"
},
{
"DocComment": " documentation of the methods defined on `Formatter` below."
},
{
"Unknown": {
"path": "rustc_diagnostic_item",
"args": null
}
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": "Formatter"
},
"generics": {
"regions": [
{
"index": 0,
"name": "'a"
}
],
"types": [],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [
{
"regions": [],
"skip_binder": [
{
"Var": {
"Free": 0
}
},
{
"Var": {
"Free": 0
}
}
]
}
],
"types_outlive": [],
"trait_type_constraints": []
},
"kind": "Opaque"
},
{
"def_id": 7,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"result",
0
]
},
{
"Ident": [
"Result",
0
]
}
],
"span": {
"span": {
"file_id": 30,
"beg": {
"line": 528,
"col": 0
},
"end": {
"line": 528,
"col": 21
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " `Result` is a type that represents either success ([`Ok`]) or failure ([`Err`])."
},
{
"DocComment": ""
},
{
"DocComment": " See the [module documentation](self) for details."
},
{
"Unknown": {
"path": "doc",
"args": "search_unbox"
}
},
{
"Unknown": {
"path": "must_use",
"args": null
}
},
{
"Unknown": {
"path": "rustc_diagnostic_item",
"args": null
}
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": "Result"
},
"generics": {
"regions": [],
"types": [
{
"index": 0,
"name": "T"
},
{
"index": 1,
"name": "E"
}
],
"const_generics": [],
"trait_clauses": [
{
"clause_id": 0,
"span": {
"span": {
"file_id": 30,
"beg": {
"line": 528,
"col": 16
},
"end": {
"line": 528,
"col": 17
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnType",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
},
{
"clause_id": 1,
"span": {
"span": {
"file_id": 30,
"beg": {
"line": 528,
"col": 19
},
"end": {
"line": 528,
"col": 20
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnType",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 1
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"kind": {
"Enum": [
{
"span": {
"span": {
"file_id": 30,
"beg": {
"line": 532,
"col": 4
},
"end": {
"line": 532,
"col": 6
}
},
"generated_from_span": null
},
"attr_info": {
"attributes": [
{
"DocComment": " Contains the success value"
}
],
"inline": null,
"rename": null,
"public": true
},
"name": "Ok",
"fields": [
{
"span": {
"span": {
"file_id": 30,
"beg": {
"line": 532,
"col": 53
},
"end": {
"line": 532,
"col": 54
}
},
"generated_from_span": null
},
"attr_info": {
"attributes": [],
"inline": null,
"rename": null,
"public": true
},
"name": null,
"ty": {
"TypeVar": {
"Free": 0
}
}
}
],
"discriminant": {
"Isize": "0"
}
},
{
"span": {
"span": {
"file_id": 30,
"beg": {
"line": 537,
"col": 4
},
"end": {
"line": 537,
"col": 7
}
},
"generated_from_span": null
},
"attr_info": {
"attributes": [
{
"DocComment": " Contains the error value"
}
],
"inline": null,
"rename": null,
"public": true
},
"name": "Err",
"fields": [
{
"span": {
"span": {
"file_id": 30,
"beg": {
"line": 537,
"col": 54
},
"end": {
"line": 537,
"col": 55
}
},
"generated_from_span": null
},
"attr_info": {
"attributes": [],
"inline": null,
"rename": null,
"public": true
},
"name": null,
"ty": {
"TypeVar": {
"Free": 1
}
}
}
],
"discriminant": {
"Isize": "1"
}
}
]
}
},
{
"def_id": 8,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"fmt",
0
]
},
{
"Ident": [
"Error",
0
]
}
],
"span": {
"span": {
"file_id": 3,
"beg": {
"line": 103,
"col": 0
},
"end": {
"line": 103,
"col": 16
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " The error type which is returned from formatting a message into a stream."
},
{
"DocComment": ""
},
{
"DocComment": " This type does not support transmission of an error other than that an error"
},
{
"DocComment": " occurred. This is because, despite the existence of this error,"
},
{
"DocComment": " string formatting is considered an infallible operation."
},
{
"DocComment": " `fmt()` implementors should not return this `Error` unless they received it from their"
},
{
"DocComment": " [`Formatter`]. The only time your code should create a new instance of this"
},
{
"DocComment": " error is when implementing `fmt::Write`, in order to cancel the formatting operation when"
},
{
"DocComment": " writing to the underlying stream fails."
},
{
"DocComment": ""
},
{
"DocComment": " Any extra information must be arranged to be transmitted through some other means,"
},
{
"DocComment": " such as storing it in a field to be consulted after the formatting operation has been"
},
{
"DocComment": " cancelled. (For example, this is how [`std::io::Write::write_fmt()`] propagates IO errors"
},
{
"DocComment": " during writing.)"
},
{
"DocComment": ""
},
{
"DocComment": " This type, `fmt::Error`, should not be"
},
{
"DocComment": " confused with [`std::io::Error`] or [`std::error::Error`], which you may also"
},
{
"DocComment": " have in scope."
},
{
"DocComment": ""
},
{
"DocComment": " [`std::io::Error`]: ../../std/io/struct.Error.html"
},
{
"DocComment": " [`std::io::Write::write_fmt()`]: ../../std/io/trait.Write.html#method.write_fmt"
},
{
"DocComment": " [`std::error::Error`]: ../../std/error/trait.Error.html"
},
{
"DocComment": ""
},
{
"DocComment": " # Examples"
},
{
"DocComment": ""
},
{
"DocComment": " ```rust"
},
{
"DocComment": " use std::fmt::{self, write};"
},
{
"DocComment": ""
},
{
"DocComment": " let mut output = String::new();"
},
{
"DocComment": " if let Err(fmt::Error) = write(&mut output, format_args!(\"Hello {}!\", \"world\")) {"
},
{
"DocComment": " panic!(\"An error occurred\");"
},
{
"DocComment": " }"
},
{
"DocComment": " ```"
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": null
},
"generics": {
"regions": [],
"types": [],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"kind": {
"Struct": []
}
}
],
"fun_decls": [
{
"def_id": 0,
"item_meta": {
"name": [
{
"Ident": [
"test_crate",
0
]
},
{
"Ident": [
"debug_slice",
0
]
}
],
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 3,
"col": 0
},
"end": {
"line": 7,
"col": 1
}
},
"generated_from_span": null
},
"source_text": "fn debug_slice<T: Debug>(slice: &[T]) {\n for x in slice {\n eprintln!(\"- {x:?}\");\n }\n}",
"attr_info": {
"attributes": [],
"inline": null,
"rename": null,
"public": false
},
"is_local": true,
"opacity": "Transparent",
"lang_item": null
},
"signature": {
"is_unsafe": false,
"is_closure": false,
"closure_info": null,
"generics": {
"regions": [
{
"index": 0,
"name": null
}
],
"types": [
{
"index": 0,
"name": "T"
}
],
"const_generics": [],
"trait_clauses": [
{
"clause_id": 0,
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 3,
"col": 15
},
"end": {
"line": 3,
"col": 16
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnFn",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
},
{
"clause_id": 1,
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 3,
"col": 18
},
"end": {
"line": 3,
"col": 23
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnFn",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 1,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 1
}
}
}
}
}
}
],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"inputs": [
{
"Ref": [
{
"Var": {
"Free": 0
}
},
{
"Adt": [
{
"Builtin": "Slice"
},
{
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
],
"output": {
"Adt": [
"Tuple",
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
}
},
"kind": "Regular",
"is_global_initializer": null,
"body": {
"Ok": {
"Structured": {
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 3,
"col": 0
},
"end": {
"line": 7,
"col": 1
}
},
"generated_from_span": null
},
"locals": {
"arg_count": 1,
"locals": [
{
"index": 0,
"name": null,
"ty": {
"Adt": [
"Tuple",
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
}
},
{
"index": 1,
"name": "slice",
"ty": {
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Slice"
},
{
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
},
{
"index": 2,
"name": null,
"ty": {
"Adt": [
{
"Adt": 0
},
{
"regions": [
"Erased"
],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [
{
"kind": {
"Clause": {
"Free": 0
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"target": {
"Item": {
"Type": 0
}
}
}
]
}
},
{
"index": 3,
"name": null,
"ty": {
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Slice"
},
{
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
},
{
"index": 4,
"name": "iter",
"ty": {
"Adt": [
{
"Adt": 0
},
{
"regions": [
"Erased"
],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [
{
"kind": {
"Clause": {
"Free": 0
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"target": {
"Item": {
"Type": 0
}
}
}
]
}
},
{
"index": 5,
"name": null,
"ty": {
"Adt": [
"Tuple",
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
}
},
{
"index": 6,
"name": null,
"ty": {
"Adt": [
{
"Adt": 1
},
{
"regions": [],
"types": [
{
"Ref": [
"Erased",
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
}
],
"const_generics": [],
"trait_refs": [
{
"kind": {
"BuiltinOrAuto": {
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"Ref": [
"Erased",
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
},
"parent_trait_refs": [],
"types": []
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"Ref": [
"Erased",
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"target": {
"Item": {
"Type": 1
}
}
}
]
}
},
{
"index": 7,
"name": null,
"ty": {
"Ref": [
"Erased",
{
"Adt": [
{
"Adt": 0
},
{
"regions": [
"Erased"
],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [
{
"kind": {
"Clause": {
"Free": 0
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"target": {
"Item": {
"Type": 0
}
}
}
]
},
"Mut"
]
}
},
{
"index": 8,
"name": null,
"ty": {
"Ref": [
"Erased",
{
"Adt": [
{
"Adt": 0
},
{
"regions": [
"Erased"
],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [
{
"kind": {
"Clause": {
"Free": 0
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"target": {
"Item": {
"Type": 0
}
}
}
]
},
"Mut"
]
}
},
{
"index": 9,
"name": "x",
"ty": {
"Ref": [
"Erased",
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
}
},
{
"index": 10,
"name": null,
"ty": {
"Adt": [
"Tuple",
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
}
},
{
"index": 11,
"name": null,
"ty": {
"Adt": [
"Tuple",
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
}
},
{
"index": 12,
"name": null,
"ty": {
"Adt": [
{
"Adt": 2
},
{
"regions": [
"Erased"
],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 2
}
}
}
]
}
},
{
"index": 13,
"name": null,
"ty": {
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Array"
},
{
"regions": [],
"types": [
{
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Str"
},
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
],
"const_generics": [
{
"Value": {
"Scalar": {
"Usize": "2"
}
}
}
],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
},
{
"index": 14,
"name": null,
"ty": {
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Array"
},
{
"regions": [],
"types": [
{
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Str"
},
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
],
"const_generics": [
{
"Value": {
"Scalar": {
"Usize": "2"
}
}
}
],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
},
{
"index": 15,
"name": null,
"ty": {
"Adt": [
{
"Builtin": "Array"
},
{
"regions": [],
"types": [
{
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Str"
},
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
],
"const_generics": [
{
"Value": {
"Scalar": {
"Usize": "2"
}
}
}
],
"trait_refs": [],
"target": "Builtin"
}
]
}
},
{
"index": 16,
"name": null,
"ty": {
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Array"
},
{
"regions": [],
"types": [
{
"Adt": [
{
"Adt": 3
},
{
"regions": [
"Erased"
],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 3
}
}
}
]
}
],
"const_generics": [
{
"Value": {
"Scalar": {
"Usize": "1"
}
}
}
],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
},
{
"index": 17,
"name": null,
"ty": {
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Array"
},
{
"regions": [],
"types": [
{
"Adt": [
{
"Adt": 3
},
{
"regions": [
"Erased"
],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 3
}
}
}
]
}
],
"const_generics": [
{
"Value": {
"Scalar": {
"Usize": "1"
}
}
}
],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
},
{
"index": 18,
"name": null,
"ty": {
"Adt": [
{
"Builtin": "Array"
},
{
"regions": [],
"types": [
{
"Adt": [
{
"Adt": 3
},
{
"regions": [
"Erased"
],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 3
}
}
}
]
}
],
"const_generics": [
{
"Value": {
"Scalar": {
"Usize": "1"
}
}
}
],
"trait_refs": [],
"target": "Builtin"
}
]
}
},
{
"index": 19,
"name": null,
"ty": {
"Adt": [
{
"Adt": 3
},
{
"regions": [
"Erased"
],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 3
}
}
}
]
}
},
{
"index": 20,
"name": null,
"ty": {
"Ref": [
"Erased",
{
"Ref": [
"Erased",
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
},
"Shared"
]
}
},
{
"index": 21,
"name": null,
"ty": {
"Ref": [
"Erased",
{
"Ref": [
"Erased",
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
},
"Shared"
]
}
}
]
},
"comments": [],
"body": {
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 4
},
"end": {
"line": 7,
"col": 1
}
},
"generated_from_span": null
},
"statements": [
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 13
},
"end": {
"line": 4,
"col": 18
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 7
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 13
},
"end": {
"line": 4,
"col": 18
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 9
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 13
},
"end": {
"line": 4,
"col": 18
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 10
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 13
},
"end": {
"line": 4,
"col": 18
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 11
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 13
},
"end": {
"line": 4,
"col": 18
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 12
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 13
},
"end": {
"line": 4,
"col": 18
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 13
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 13
},
"end": {
"line": 4,
"col": 18
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 14
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 13
},
"end": {
"line": 4,
"col": 18
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 15
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 13
},
"end": {
"line": 4,
"col": 18
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 16
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 13
},
"end": {
"line": 4,
"col": 18
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 17
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 13
},
"end": {
"line": 4,
"col": 18
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 18
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 13
},
"end": {
"line": 4,
"col": 18
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 19
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 13
},
"end": {
"line": 4,
"col": 18
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 20
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 13
},
"end": {
"line": 4,
"col": 18
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 21
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 13
},
"end": {
"line": 4,
"col": 18
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 2
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 13
},
"end": {
"line": 4,
"col": 18
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 3
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 13
},
"end": {
"line": 4,
"col": 18
}
},
"generated_from_span": null
},
"content": {
"Assign": [
{
"kind": {
"Local": 3
},
"ty": {
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Slice"
},
{
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
},
{
"Use": {
"Copy": {
"kind": {
"Local": 1
},
"ty": {
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Slice"
},
{
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
}
}
}
]
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 13
},
"end": {
"line": 4,
"col": 18
}
},
"generated_from_span": null
},
"content": {
"Call": {
"func": {
"Regular": {
"func": {
"Fun": {
"Regular": 124
}
},
"generics": {
"regions": [
"Erased"
],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [
{
"kind": {
"Clause": {
"Free": 0
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"target": {
"Item": {
"Fun": 124
}
}
}
}
},
"args": [
{
"Move": {
"kind": {
"Local": 3
},
"ty": {
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Slice"
},
{
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
}
}
],
"dest": {
"kind": {
"Local": 2
},
"ty": {
"Adt": [
{
"Adt": 0
},
{
"regions": [
"Erased"
],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [
{
"kind": {
"Clause": {
"Free": 0
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"target": {
"Item": {
"Type": 0
}
}
}
]
}
}
}
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 17
},
"end": {
"line": 4,
"col": 18
}
},
"generated_from_span": null
},
"content": {
"StorageDead": 3
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 13
},
"end": {
"line": 4,
"col": 18
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 4
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 13
},
"end": {
"line": 4,
"col": 18
}
},
"generated_from_span": null
},
"content": {
"Assign": [
{
"kind": {
"Local": 4
},
"ty": {
"Adt": [
{
"Adt": 0
},
{
"regions": [
"Erased"
],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [
{
"kind": {
"Clause": {
"Free": 0
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"target": {
"Item": {
"Type": 0
}
}
}
]
}
},
{
"Use": {
"Move": {
"kind": {
"Local": 2
},
"ty": {
"Adt": [
{
"Adt": 0
},
{
"regions": [
"Erased"
],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [
{
"kind": {
"Clause": {
"Free": 0
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"target": {
"Item": {
"Type": 0
}
}
}
]
}
}
}
}
]
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 8
},
"end": {
"line": 5,
"col": 27
}
},
"generated_from_span": null
},
"content": {
"Loop": {
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 8
},
"end": {
"line": 5,
"col": 27
}
},
"generated_from_span": null
},
"statements": [
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 13
},
"end": {
"line": 4,
"col": 18
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 5
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 13
},
"end": {
"line": 4,
"col": 18
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 6
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 13
},
"end": {
"line": 4,
"col": 18
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 7
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 13
},
"end": {
"line": 4,
"col": 18
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 8
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 13
},
"end": {
"line": 4,
"col": 18
}
},
"generated_from_span": null
},
"content": {
"Assign": [
{
"kind": {
"Local": 8
},
"ty": {
"Ref": [
"Erased",
{
"Adt": [
{
"Adt": 0
},
{
"regions": [
"Erased"
],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [
{
"kind": {
"Clause": {
"Free": 0
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"target": {
"Item": {
"Type": 0
}
}
}
]
},
"Mut"
]
}
},
{
"Ref": [
{
"kind": {
"Local": 4
},
"ty": {
"Adt": [
{
"Adt": 0
},
{
"regions": [
"Erased"
],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [
{
"kind": {
"Clause": {
"Free": 0
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"target": {
"Item": {
"Type": 0
}
}
}
]
}
},
"Mut"
]
}
]
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 13
},
"end": {
"line": 4,
"col": 18
}
},
"generated_from_span": null
},
"content": {
"Assign": [
{
"kind": {
"Local": 7
},
"ty": {
"Ref": [
"Erased",
{
"Adt": [
{
"Adt": 0
},
{
"regions": [
"Erased"
],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [
{
"kind": {
"Clause": {
"Free": 0
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"target": {
"Item": {
"Type": 0
}
}
}
]
},
"Mut"
]
}
},
{
"Ref": [
{
"kind": {
"Projection": [
{
"kind": {
"Local": 8
},
"ty": {
"Ref": [
"Erased",
{
"Adt": [
{
"Adt": 0
},
{
"regions": [
"Erased"
],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [
{
"kind": {
"Clause": {
"Free": 0
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"target": {
"Item": {
"Type": 0
}
}
}
]
},
"Mut"
]
}
},
"Deref"
]
},
"ty": {
"Adt": [
{
"Adt": 0
},
{
"regions": [
"Erased"
],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [
{
"kind": {
"Clause": {
"Free": 0
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"target": {
"Item": {
"Type": 0
}
}
}
]
}
},
"TwoPhaseMut"
]
}
]
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 13
},
"end": {
"line": 4,
"col": 18
}
},
"generated_from_span": null
},
"content": {
"Call": {
"func": {
"Regular": {
"func": {
"Fun": {
"Regular": 127
}
},
"generics": {
"regions": [
"Erased",
"Erased"
],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [
{
"kind": {
"Clause": {
"Free": 0
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"target": {
"Item": {
"Fun": 127
}
}
}
}
},
"args": [
{
"Move": {
"kind": {
"Local": 7
},
"ty": {
"Ref": [
"Erased",
{
"Adt": [
{
"Adt": 0
},
{
"regions": [
"Erased"
],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [
{
"kind": {
"Clause": {
"Free": 0
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"target": {
"Item": {
"Type": 0
}
}
}
]
},
"Mut"
]
}
}
}
],
"dest": {
"kind": {
"Local": 6
},
"ty": {
"Adt": [
{
"Adt": 1
},
{
"regions": [],
"types": [
{
"Ref": [
"Erased",
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
}
],
"const_generics": [],
"trait_refs": [
{
"kind": {
"BuiltinOrAuto": {
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"Ref": [
"Erased",
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
},
"parent_trait_refs": [],
"types": []
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"Ref": [
"Erased",
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"target": {
"Item": {
"Type": 1
}
}
}
]
}
}
}
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 17
},
"end": {
"line": 4,
"col": 18
}
},
"generated_from_span": null
},
"content": {
"StorageDead": 7
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 8
},
"end": {
"line": 5,
"col": 27
}
},
"generated_from_span": null
},
"content": {
"Switch": {
"Match": [
{
"kind": {
"Local": 6
},
"ty": {
"Adt": [
{
"Adt": 1
},
{
"regions": [],
"types": [
{
"Ref": [
"Erased",
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
}
],
"const_generics": [],
"trait_refs": [
{
"kind": {
"BuiltinOrAuto": {
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"Ref": [
"Erased",
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
},
"parent_trait_refs": [],
"types": []
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"Ref": [
"Erased",
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"target": {
"Item": {
"Type": 1
}
}
}
]
}
},
[
[
[
0
],
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 13
},
"end": {
"line": 4,
"col": 18
}
},
"generated_from_span": null
},
"statements": [
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 13
},
"end": {
"line": 4,
"col": 18
}
},
"generated_from_span": null
},
"content": {
"Break": 0
},
"comments_before": []
}
]
}
],
[
[
1
],
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 8
},
"end": {
"line": 5,
"col": 27
}
},
"generated_from_span": null
},
"statements": [
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 8
},
"end": {
"line": 4,
"col": 9
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 9
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 8
},
"end": {
"line": 4,
"col": 9
}
},
"generated_from_span": null
},
"content": {
"Assign": [
{
"kind": {
"Local": 9
},
"ty": {
"Ref": [
"Erased",
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
}
},
{
"Use": {
"Copy": {
"kind": {
"Projection": [
{
"kind": {
"Local": 6
},
"ty": {
"Adt": [
{
"Adt": 1
},
{
"regions": [],
"types": [
{
"Ref": [
"Erased",
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
}
],
"const_generics": [],
"trait_refs": [
{
"kind": {
"BuiltinOrAuto": {
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"Ref": [
"Erased",
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
},
"parent_trait_refs": [],
"types": []
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"Ref": [
"Erased",
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"target": {
"Item": {
"Type": 1
}
}
}
]
}
},
{
"Field": [
{
"Adt": [
1,
1
]
},
0
]
}
]
},
"ty": {
"Ref": [
"Erased",
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
}
}
}
}
]
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 7,
"beg": {
"line": 220,
"col": 22
},
"end": {
"line": 222,
"col": 5
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 10
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 7,
"beg": {
"line": 221,
"col": 8
},
"end": {
"line": 221,
"col": 62
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 11
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 7,
"beg": {
"line": 221,
"col": 28
},
"end": {
"line": 221,
"col": 61
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 12
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 5,
"col": 18
},
"end": {
"line": 5,
"col": 27
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 13
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 5,
"col": 18
},
"end": {
"line": 5,
"col": 27
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 14
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 5,
"col": 18
},
"end": {
"line": 5,
"col": 27
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 15
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 5,
"col": 18
},
"end": {
"line": 5,
"col": 27
}
},
"generated_from_span": null
},
"content": {
"Assign": [
{
"kind": {
"Local": 15
},
"ty": {
"Adt": [
{
"Builtin": "Array"
},
{
"regions": [],
"types": [
{
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Str"
},
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
],
"const_generics": [
{
"Value": {
"Scalar": {
"Usize": "2"
}
}
}
],
"trait_refs": [],
"target": "Builtin"
}
]
}
},
{
"Aggregate": [
{
"Array": [
{
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Str"
},
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
},
{
"Value": {
"Scalar": {
"Usize": "2"
}
}
}
]
},
[
{
"Const": {
"value": {
"Literal": {
"Str": "- "
}
},
"ty": {
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Str"
},
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
}
},
{
"Const": {
"value": {
"Literal": {
"Str": "\n"
}
},
"ty": {
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Str"
},
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
}
}
]
]
}
]
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 5,
"col": 18
},
"end": {
"line": 5,
"col": 27
}
},
"generated_from_span": null
},
"content": {
"Assign": [
{
"kind": {
"Local": 14
},
"ty": {
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Array"
},
{
"regions": [],
"types": [
{
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Str"
},
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
],
"const_generics": [
{
"Value": {
"Scalar": {
"Usize": "2"
}
}
}
],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
},
{
"Ref": [
{
"kind": {
"Local": 15
},
"ty": {
"Adt": [
{
"Builtin": "Array"
},
{
"regions": [],
"types": [
{
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Str"
},
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
],
"const_generics": [
{
"Value": {
"Scalar": {
"Usize": "2"
}
}
}
],
"trait_refs": [],
"target": "Builtin"
}
]
}
},
"Shared"
]
}
]
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 5,
"col": 18
},
"end": {
"line": 5,
"col": 27
}
},
"generated_from_span": null
},
"content": {
"Assign": [
{
"kind": {
"Local": 13
},
"ty": {
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Array"
},
{
"regions": [],
"types": [
{
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Str"
},
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
],
"const_generics": [
{
"Value": {
"Scalar": {
"Usize": "2"
}
}
}
],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
},
{
"Ref": [
{
"kind": {
"Projection": [
{
"kind": {
"Local": 14
},
"ty": {
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Array"
},
{
"regions": [],
"types": [
{
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Str"
},
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
],
"const_generics": [
{
"Value": {
"Scalar": {
"Usize": "2"
}
}
}
],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
},
"Deref"
]
},
"ty": {
"Adt": [
{
"Builtin": "Array"
},
{
"regions": [],
"types": [
{
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Str"
},
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
],
"const_generics": [
{
"Value": {
"Scalar": {
"Usize": "2"
}
}
}
],
"trait_refs": [],
"target": "Builtin"
}
]
}
},
"Shared"
]
}
]
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 7,
"beg": {
"line": 221,
"col": 28
},
"end": {
"line": 221,
"col": 61
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 16
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 7,
"beg": {
"line": 221,
"col": 28
},
"end": {
"line": 221,
"col": 61
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 17
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 7,
"beg": {
"line": 221,
"col": 28
},
"end": {
"line": 221,
"col": 61
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 18
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 5,
"col": 21
},
"end": {
"line": 5,
"col": 26
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 19
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 5,
"col": 21
},
"end": {
"line": 5,
"col": 26
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 20
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 5,
"col": 21
},
"end": {
"line": 5,
"col": 26
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 21
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 5,
"col": 21
},
"end": {
"line": 5,
"col": 26
}
},
"generated_from_span": null
},
"content": {
"Assign": [
{
"kind": {
"Local": 21
},
"ty": {
"Ref": [
"Erased",
{
"Ref": [
"Erased",
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
},
"Shared"
]
}
},
{
"Ref": [
{
"kind": {
"Local": 9
},
"ty": {
"Ref": [
"Erased",
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
}
},
"Shared"
]
}
]
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 5,
"col": 21
},
"end": {
"line": 5,
"col": 26
}
},
"generated_from_span": null
},
"content": {
"Assign": [
{
"kind": {
"Local": 20
},
"ty": {
"Ref": [
"Erased",
{
"Ref": [
"Erased",
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
},
"Shared"
]
}
},
{
"Ref": [
{
"kind": {
"Projection": [
{
"kind": {
"Local": 21
},
"ty": {
"Ref": [
"Erased",
{
"Ref": [
"Erased",
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
},
"Shared"
]
}
},
"Deref"
]
},
"ty": {
"Ref": [
"Erased",
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
}
},
"Shared"
]
}
]
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 5,
"col": 21
},
"end": {
"line": 5,
"col": 26
}
},
"generated_from_span": null
},
"content": {
"Call": {
"func": {
"Regular": {
"func": {
"Fun": {
"Regular": 4
}
},
"generics": {
"regions": [
"Erased",
"Erased"
],
"types": [
{
"Ref": [
"Erased",
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
}
],
"const_generics": [],
"trait_refs": [
{
"kind": {
"BuiltinOrAuto": {
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"Ref": [
"Erased",
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
},
"parent_trait_refs": [],
"types": []
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"Ref": [
"Erased",
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
},
{
"kind": {
"TraitImpl": [
2,
{
"regions": [
"Erased"
],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [
{
"kind": {
"Clause": {
"Free": 1
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 1,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 1
}
}
}
}
}
}
],
"target": {
"Item": {
"TraitImpl": 2
}
}
}
]
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 1,
"generics": {
"regions": [],
"types": [
{
"Ref": [
"Erased",
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 1
}
}
}
}
}
}
],
"target": {
"Item": {
"Fun": 4
}
}
}
}
},
"args": [
{
"Move": {
"kind": {
"Local": 20
},
"ty": {
"Ref": [
"Erased",
{
"Ref": [
"Erased",
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
},
"Shared"
]
}
}
}
],
"dest": {
"kind": {
"Local": 19
},
"ty": {
"Adt": [
{
"Adt": 3
},
{
"regions": [
"Erased"
],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 3
}
}
}
]
}
}
}
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 5,
"col": 25
},
"end": {
"line": 5,
"col": 26
}
},
"generated_from_span": null
},
"content": {
"StorageDead": 20
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 7,
"beg": {
"line": 221,
"col": 28
},
"end": {
"line": 221,
"col": 61
}
},
"generated_from_span": null
},
"content": {
"Assign": [
{
"kind": {
"Local": 18
},
"ty": {
"Adt": [
{
"Builtin": "Array"
},
{
"regions": [],
"types": [
{
"Adt": [
{
"Adt": 3
},
{
"regions": [
"Erased"
],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 3
}
}
}
]
}
],
"const_generics": [
{
"Value": {
"Scalar": {
"Usize": "1"
}
}
}
],
"trait_refs": [],
"target": "Builtin"
}
]
}
},
{
"Aggregate": [
{
"Array": [
{
"Adt": [
{
"Adt": 3
},
{
"regions": [
"Erased"
],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 3
}
}
}
]
},
{
"Value": {
"Scalar": {
"Usize": "1"
}
}
}
]
},
[
{
"Move": {
"kind": {
"Local": 19
},
"ty": {
"Adt": [
{
"Adt": 3
},
{
"regions": [
"Erased"
],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 3
}
}
}
]
}
}
}
]
]
}
]
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 7,
"beg": {
"line": 221,
"col": 60
},
"end": {
"line": 221,
"col": 61
}
},
"generated_from_span": null
},
"content": {
"StorageDead": 19
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 7,
"beg": {
"line": 221,
"col": 28
},
"end": {
"line": 221,
"col": 61
}
},
"generated_from_span": null
},
"content": {
"Assign": [
{
"kind": {
"Local": 17
},
"ty": {
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Array"
},
{
"regions": [],
"types": [
{
"Adt": [
{
"Adt": 3
},
{
"regions": [
"Erased"
],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 3
}
}
}
]
}
],
"const_generics": [
{
"Value": {
"Scalar": {
"Usize": "1"
}
}
}
],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
},
{
"Ref": [
{
"kind": {
"Local": 18
},
"ty": {
"Adt": [
{
"Builtin": "Array"
},
{
"regions": [],
"types": [
{
"Adt": [
{
"Adt": 3
},
{
"regions": [
"Erased"
],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 3
}
}
}
]
}
],
"const_generics": [
{
"Value": {
"Scalar": {
"Usize": "1"
}
}
}
],
"trait_refs": [],
"target": "Builtin"
}
]
}
},
"Shared"
]
}
]
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 7,
"beg": {
"line": 221,
"col": 28
},
"end": {
"line": 221,
"col": 61
}
},
"generated_from_span": null
},
"content": {
"Assign": [
{
"kind": {
"Local": 16
},
"ty": {
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Array"
},
{
"regions": [],
"types": [
{
"Adt": [
{
"Adt": 3
},
{
"regions": [
"Erased"
],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 3
}
}
}
]
}
],
"const_generics": [
{
"Value": {
"Scalar": {
"Usize": "1"
}
}
}
],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
},
{
"Ref": [
{
"kind": {
"Projection": [
{
"kind": {
"Local": 17
},
"ty": {
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Array"
},
{
"regions": [],
"types": [
{
"Adt": [
{
"Adt": 3
},
{
"regions": [
"Erased"
],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 3
}
}
}
]
}
],
"const_generics": [
{
"Value": {
"Scalar": {
"Usize": "1"
}
}
}
],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
},
"Deref"
]
},
"ty": {
"Adt": [
{
"Builtin": "Array"
},
{
"regions": [],
"types": [
{
"Adt": [
{
"Adt": 3
},
{
"regions": [
"Erased"
],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 3
}
}
}
]
}
],
"const_generics": [
{
"Value": {
"Scalar": {
"Usize": "1"
}
}
}
],
"trait_refs": [],
"target": "Builtin"
}
]
}
},
"Shared"
]
}
]
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 7,
"beg": {
"line": 221,
"col": 28
},
"end": {
"line": 221,
"col": 61
}
},
"generated_from_span": null
},
"content": {
"Call": {
"func": {
"Regular": {
"func": {
"Fun": {
"Regular": 5
}
},
"generics": {
"regions": [
"Erased"
],
"types": [],
"const_generics": [
{
"Value": {
"Scalar": {
"Usize": "2"
}
}
},
{
"Value": {
"Scalar": {
"Usize": "1"
}
}
}
],
"trait_refs": [],
"target": {
"Item": {
"Fun": 5
}
}
}
}
},
"args": [
{
"Move": {
"kind": {
"Local": 13
},
"ty": {
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Array"
},
{
"regions": [],
"types": [
{
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Str"
},
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
],
"const_generics": [
{
"Value": {
"Scalar": {
"Usize": "2"
}
}
}
],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
}
},
{
"Move": {
"kind": {
"Local": 16
},
"ty": {
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Array"
},
{
"regions": [],
"types": [
{
"Adt": [
{
"Adt": 3
},
{
"regions": [
"Erased"
],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 3
}
}
}
]
}
],
"const_generics": [
{
"Value": {
"Scalar": {
"Usize": "1"
}
}
}
],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
}
}
],
"dest": {
"kind": {
"Local": 12
},
"ty": {
"Adt": [
{
"Adt": 2
},
{
"regions": [
"Erased"
],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 2
}
}
}
]
}
}
}
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 7,
"beg": {
"line": 221,
"col": 60
},
"end": {
"line": 221,
"col": 61
}
},
"generated_from_span": null
},
"content": {
"StorageDead": 16
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 7,
"beg": {
"line": 221,
"col": 60
},
"end": {
"line": 221,
"col": 61
}
},
"generated_from_span": null
},
"content": {
"StorageDead": 13
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 7,
"beg": {
"line": 221,
"col": 8
},
"end": {
"line": 221,
"col": 62
}
},
"generated_from_span": null
},
"content": {
"Call": {
"func": {
"Regular": {
"func": {
"Fun": {
"Regular": 6
}
},
"generics": {
"regions": [
"Erased"
],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Fun": 6
}
}
}
}
},
"args": [
{
"Move": {
"kind": {
"Local": 12
},
"ty": {
"Adt": [
{
"Adt": 2
},
{
"regions": [
"Erased"
],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 2
}
}
}
]
}
}
}
],
"dest": {
"kind": {
"Local": 11
},
"ty": {
"Adt": [
"Tuple",
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
}
}
}
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 7,
"beg": {
"line": 221,
"col": 61
},
"end": {
"line": 221,
"col": 62
}
},
"generated_from_span": null
},
"content": {
"StorageDead": 12
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 7,
"beg": {
"line": 221,
"col": 62
},
"end": {
"line": 221,
"col": 63
}
},
"generated_from_span": null
},
"content": {
"StorageDead": 21
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 7,
"beg": {
"line": 221,
"col": 62
},
"end": {
"line": 221,
"col": 63
}
},
"generated_from_span": null
},
"content": {
"StorageDead": 18
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 7,
"beg": {
"line": 221,
"col": 62
},
"end": {
"line": 221,
"col": 63
}
},
"generated_from_span": null
},
"content": {
"StorageDead": 17
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 7,
"beg": {
"line": 221,
"col": 62
},
"end": {
"line": 221,
"col": 63
}
},
"generated_from_span": null
},
"content": {
"StorageDead": 15
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 7,
"beg": {
"line": 221,
"col": 62
},
"end": {
"line": 221,
"col": 63
}
},
"generated_from_span": null
},
"content": {
"StorageDead": 14
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 7,
"beg": {
"line": 221,
"col": 62
},
"end": {
"line": 221,
"col": 63
}
},
"generated_from_span": null
},
"content": {
"StorageDead": 11
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 7,
"beg": {
"line": 222,
"col": 4
},
"end": {
"line": 222,
"col": 5
}
},
"generated_from_span": null
},
"content": {
"StorageDead": 10
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 6,
"col": 4
},
"end": {
"line": 6,
"col": 5
}
},
"generated_from_span": null
},
"content": {
"StorageDead": 9
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 6,
"col": 4
},
"end": {
"line": 6,
"col": 5
}
},
"generated_from_span": null
},
"content": {
"StorageDead": 8
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 6,
"col": 4
},
"end": {
"line": 6,
"col": 5
}
},
"generated_from_span": null
},
"content": {
"StorageDead": 6
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 6,
"col": 4
},
"end": {
"line": 6,
"col": 5
}
},
"generated_from_span": null
},
"content": {
"StorageDead": 5
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 4
},
"end": {
"line": 6,
"col": 5
}
},
"generated_from_span": null
},
"content": {
"Continue": 0
},
"comments_before": []
}
]
}
]
],
null
]
}
},
"comments_before": []
}
]
}
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 4,
"col": 4
},
"end": {
"line": 6,
"col": 5
}
},
"generated_from_span": null
},
"content": {
"Assign": [
{
"kind": {
"Local": 0
},
"ty": {
"Adt": [
"Tuple",
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
}
},
{
"Aggregate": [
{
"Adt": [
"Tuple",
null,
null,
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
},
[]
]
}
]
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 6,
"col": 4
},
"end": {
"line": 6,
"col": 5
}
},
"generated_from_span": null
},
"content": {
"StorageDead": 8
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 6,
"col": 4
},
"end": {
"line": 6,
"col": 5
}
},
"generated_from_span": null
},
"content": {
"StorageDead": 6
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 6,
"col": 4
},
"end": {
"line": 6,
"col": 5
}
},
"generated_from_span": null
},
"content": {
"StorageDead": 5
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 6,
"col": 4
},
"end": {
"line": 6,
"col": 5
}
},
"generated_from_span": null
},
"content": {
"StorageDead": 4
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 6,
"col": 4
},
"end": {
"line": 6,
"col": 5
}
},
"generated_from_span": null
},
"content": {
"StorageDead": 2
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 7,
"col": 1
},
"end": {
"line": 7,
"col": 1
}
},
"generated_from_span": null
},
"content": {
"Assign": [
{
"kind": {
"Local": 0
},
"ty": {
"Adt": [
"Tuple",
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
}
},
{
"Aggregate": [
{
"Adt": [
"Tuple",
null,
null,
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
},
[]
]
}
]
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 7,
"col": 1
},
"end": {
"line": 7,
"col": 1
}
},
"generated_from_span": null
},
"content": "Return",
"comments_before": []
}
]
}
}
}
}
},
{
"def_id": 1,
"item_meta": {
"name": [
{
"Ident": [
"test_crate",
0
]
},
{
"Ident": [
"main",
0
]
}
],
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 9,
"col": 0
},
"end": {
"line": 11,
"col": 1
}
},
"generated_from_span": null
},
"source_text": "fn main() {\n debug_slice(&[0, 1, 2]);\n}",
"attr_info": {
"attributes": [],
"inline": null,
"rename": null,
"public": false
},
"is_local": true,
"opacity": "Transparent",
"lang_item": null
},
"signature": {
"is_unsafe": false,
"is_closure": false,
"closure_info": null,
"generics": {
"regions": [],
"types": [],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"inputs": [],
"output": {
"Adt": [
"Tuple",
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
}
},
"kind": "Regular",
"is_global_initializer": null,
"body": {
"Ok": {
"Structured": {
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 9,
"col": 0
},
"end": {
"line": 11,
"col": 1
}
},
"generated_from_span": null
},
"locals": {
"arg_count": 0,
"locals": [
{
"index": 0,
"name": null,
"ty": {
"Adt": [
"Tuple",
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
}
},
{
"index": 1,
"name": null,
"ty": {
"Adt": [
"Tuple",
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
}
},
{
"index": 2,
"name": null,
"ty": {
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Slice"
},
{
"regions": [],
"types": [
{
"Literal": {
"Integer": "I32"
}
}
],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
},
{
"index": 3,
"name": null,
"ty": {
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Array"
},
{
"regions": [],
"types": [
{
"Literal": {
"Integer": "I32"
}
}
],
"const_generics": [
{
"Value": {
"Scalar": {
"Usize": "3"
}
}
}
],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
},
{
"index": 4,
"name": null,
"ty": {
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Array"
},
{
"regions": [],
"types": [
{
"Literal": {
"Integer": "I32"
}
}
],
"const_generics": [
{
"Value": {
"Scalar": {
"Usize": "3"
}
}
}
],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
},
{
"index": 5,
"name": null,
"ty": {
"Adt": [
{
"Builtin": "Array"
},
{
"regions": [],
"types": [
{
"Literal": {
"Integer": "I32"
}
}
],
"const_generics": [
{
"Value": {
"Scalar": {
"Usize": "3"
}
}
}
],
"trait_refs": [],
"target": "Builtin"
}
]
}
}
]
},
"comments": [],
"body": {
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 9,
"col": 10
},
"end": {
"line": 11,
"col": 1
}
},
"generated_from_span": null
},
"statements": [
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 10,
"col": 4
},
"end": {
"line": 10,
"col": 27
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 1
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 10,
"col": 16
},
"end": {
"line": 10,
"col": 26
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 2
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 10,
"col": 16
},
"end": {
"line": 10,
"col": 26
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 3
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 10,
"col": 16
},
"end": {
"line": 10,
"col": 26
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 4
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 10,
"col": 17
},
"end": {
"line": 10,
"col": 26
}
},
"generated_from_span": null
},
"content": {
"StorageLive": 5
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 10,
"col": 17
},
"end": {
"line": 10,
"col": 26
}
},
"generated_from_span": null
},
"content": {
"Assign": [
{
"kind": {
"Local": 5
},
"ty": {
"Adt": [
{
"Builtin": "Array"
},
{
"regions": [],
"types": [
{
"Literal": {
"Integer": "I32"
}
}
],
"const_generics": [
{
"Value": {
"Scalar": {
"Usize": "3"
}
}
}
],
"trait_refs": [],
"target": "Builtin"
}
]
}
},
{
"Aggregate": [
{
"Array": [
{
"Literal": {
"Integer": "I32"
}
},
{
"Value": {
"Scalar": {
"Usize": "3"
}
}
}
]
},
[
{
"Const": {
"value": {
"Literal": {
"Scalar": {
"I32": "0"
}
}
},
"ty": {
"Literal": {
"Integer": "I32"
}
}
}
},
{
"Const": {
"value": {
"Literal": {
"Scalar": {
"I32": "1"
}
}
},
"ty": {
"Literal": {
"Integer": "I32"
}
}
}
},
{
"Const": {
"value": {
"Literal": {
"Scalar": {
"I32": "2"
}
}
},
"ty": {
"Literal": {
"Integer": "I32"
}
}
}
}
]
]
}
]
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 10,
"col": 16
},
"end": {
"line": 10,
"col": 26
}
},
"generated_from_span": null
},
"content": {
"Assign": [
{
"kind": {
"Local": 4
},
"ty": {
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Array"
},
{
"regions": [],
"types": [
{
"Literal": {
"Integer": "I32"
}
}
],
"const_generics": [
{
"Value": {
"Scalar": {
"Usize": "3"
}
}
}
],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
},
{
"Ref": [
{
"kind": {
"Local": 5
},
"ty": {
"Adt": [
{
"Builtin": "Array"
},
{
"regions": [],
"types": [
{
"Literal": {
"Integer": "I32"
}
}
],
"const_generics": [
{
"Value": {
"Scalar": {
"Usize": "3"
}
}
}
],
"trait_refs": [],
"target": "Builtin"
}
]
}
},
"Shared"
]
}
]
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 10,
"col": 16
},
"end": {
"line": 10,
"col": 26
}
},
"generated_from_span": null
},
"content": {
"Assign": [
{
"kind": {
"Local": 3
},
"ty": {
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Array"
},
{
"regions": [],
"types": [
{
"Literal": {
"Integer": "I32"
}
}
],
"const_generics": [
{
"Value": {
"Scalar": {
"Usize": "3"
}
}
}
],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
},
{
"Ref": [
{
"kind": {
"Projection": [
{
"kind": {
"Local": 4
},
"ty": {
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Array"
},
{
"regions": [],
"types": [
{
"Literal": {
"Integer": "I32"
}
}
],
"const_generics": [
{
"Value": {
"Scalar": {
"Usize": "3"
}
}
}
],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
},
"Deref"
]
},
"ty": {
"Adt": [
{
"Builtin": "Array"
},
{
"regions": [],
"types": [
{
"Literal": {
"Integer": "I32"
}
}
],
"const_generics": [
{
"Value": {
"Scalar": {
"Usize": "3"
}
}
}
],
"trait_refs": [],
"target": "Builtin"
}
]
}
},
"Shared"
]
}
]
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 10,
"col": 16
},
"end": {
"line": 10,
"col": 26
}
},
"generated_from_span": null
},
"content": {
"Call": {
"func": {
"Regular": {
"func": {
"Fun": {
"Builtin": "ArrayToSliceShared"
}
},
"generics": {
"regions": [
"Erased"
],
"types": [
{
"Literal": {
"Integer": "I32"
}
}
],
"const_generics": [
{
"Value": {
"Scalar": {
"Usize": "3"
}
}
}
],
"trait_refs": [],
"target": "Builtin"
}
}
},
"args": [
{
"Move": {
"kind": {
"Local": 3
},
"ty": {
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Array"
},
{
"regions": [],
"types": [
{
"Literal": {
"Integer": "I32"
}
}
],
"const_generics": [
{
"Value": {
"Scalar": {
"Usize": "3"
}
}
}
],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
}
}
],
"dest": {
"kind": {
"Local": 2
},
"ty": {
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Slice"
},
{
"regions": [],
"types": [
{
"Literal": {
"Integer": "I32"
}
}
],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
}
}
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 10,
"col": 25
},
"end": {
"line": 10,
"col": 26
}
},
"generated_from_span": null
},
"content": {
"StorageDead": 3
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 10,
"col": 4
},
"end": {
"line": 10,
"col": 27
}
},
"generated_from_span": null
},
"content": {
"Call": {
"func": {
"Regular": {
"func": {
"Fun": {
"Regular": 0
}
},
"generics": {
"regions": [
"Erased"
],
"types": [
{
"Literal": {
"Integer": "I32"
}
}
],
"const_generics": [],
"trait_refs": [
{
"kind": {
"BuiltinOrAuto": {
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"Literal": {
"Integer": "I32"
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
},
"parent_trait_refs": [],
"types": []
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"Literal": {
"Integer": "I32"
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
},
{
"kind": {
"TraitImpl": [
3,
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitImpl": 3
}
}
}
]
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 1,
"generics": {
"regions": [],
"types": [
{
"Literal": {
"Integer": "I32"
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 1
}
}
}
}
}
}
],
"target": {
"Item": {
"Fun": 0
}
}
}
}
},
"args": [
{
"Move": {
"kind": {
"Local": 2
},
"ty": {
"Ref": [
"Erased",
{
"Adt": [
{
"Builtin": "Slice"
},
{
"regions": [],
"types": [
{
"Literal": {
"Integer": "I32"
}
}
],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
}
}
],
"dest": {
"kind": {
"Local": 1
},
"ty": {
"Adt": [
"Tuple",
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
}
}
}
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 10,
"col": 26
},
"end": {
"line": 10,
"col": 27
}
},
"generated_from_span": null
},
"content": {
"StorageDead": 2
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 10,
"col": 27
},
"end": {
"line": 10,
"col": 28
}
},
"generated_from_span": null
},
"content": {
"StorageDead": 5
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 10,
"col": 27
},
"end": {
"line": 10,
"col": 28
}
},
"generated_from_span": null
},
"content": {
"StorageDead": 4
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 10,
"col": 27
},
"end": {
"line": 10,
"col": 28
}
},
"generated_from_span": null
},
"content": {
"StorageDead": 1
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 9,
"col": 10
},
"end": {
"line": 11,
"col": 1
}
},
"generated_from_span": null
},
"content": {
"Assign": [
{
"kind": {
"Local": 0
},
"ty": {
"Adt": [
"Tuple",
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
}
},
{
"Aggregate": [
{
"Adt": [
"Tuple",
null,
null,
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
},
[]
]
}
]
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 11,
"col": 1
},
"end": {
"line": 11,
"col": 1
}
},
"generated_from_span": null
},
"content": {
"Assign": [
{
"kind": {
"Local": 0
},
"ty": {
"Adt": [
"Tuple",
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
}
},
{
"Aggregate": [
{
"Adt": [
"Tuple",
null,
null,
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
},
[]
]
}
]
},
"comments_before": []
},
{
"span": {
"span": {
"file_id": 0,
"beg": {
"line": 11,
"col": 1
},
"end": {
"line": 11,
"col": 1
}
},
"generated_from_span": null
},
"content": "Return",
"comments_before": []
}
]
}
}
}
}
},
{
"def_id": 2,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"collect",
0
]
},
{
"Ident": [
"IntoIterator",
0
]
},
{
"Ident": [
"into_iter",
0
]
}
],
"span": {
"span": {
"file_id": 9,
"beg": {
"line": 313,
"col": 4
},
"end": {
"line": 313,
"col": 41
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " Creates an iterator from a value."
},
{
"DocComment": ""
},
{
"DocComment": " See the [module-level documentation] for more."
},
{
"DocComment": ""
},
{
"DocComment": " [module-level documentation]: crate::iter"
},
{
"DocComment": ""
},
{
"DocComment": " # Examples"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " let v = [1, 2, 3];"
},
{
"DocComment": " let mut iter = v.into_iter();"
},
{
"DocComment": ""
},
{
"DocComment": " assert_eq!(Some(1), iter.next());"
},
{
"DocComment": " assert_eq!(Some(2), iter.next());"
},
{
"DocComment": " assert_eq!(Some(3), iter.next());"
},
{
"DocComment": " assert_eq!(None, iter.next());"
},
{
"DocComment": " ```"
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": "into_iter"
},
"signature": {
"is_unsafe": false,
"is_closure": false,
"closure_info": null,
"generics": {
"regions": [],
"types": [
{
"index": 0,
"name": "Self"
}
],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"inputs": [
{
"TypeVar": {
"Free": 0
}
}
],
"output": {
"TraitType": [
{
"kind": "SelfId",
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 2,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 2
}
}
}
}
}
},
"IntoIter"
]
}
},
"kind": {
"TraitDecl": {
"trait_ref": {
"trait_id": 2,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 2
}
}
}
},
"item_name": "into_iter",
"has_default": false
}
},
"is_global_initializer": null,
"body": {
"Err": null
}
},
{
"def_id": 3,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
},
{
"Ident": [
"next",
0
]
}
],
"span": {
"span": {
"file_id": 12,
"beg": {
"line": 75,
"col": 4
},
"end": {
"line": 75,
"col": 45
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " Advances the iterator and returns the next value."
},
{
"DocComment": ""
},
{
"DocComment": " Returns [`None`] when iteration is finished. Individual iterator"
},
{
"DocComment": " implementations may choose to resume iteration, and so calling `next()`"
},
{
"DocComment": " again may or may not eventually start returning [`Some(Item)`] again at some"
},
{
"DocComment": " point."
},
{
"DocComment": ""
},
{
"DocComment": " [`Some(Item)`]: Some"
},
{
"DocComment": ""
},
{
"DocComment": " # Examples"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " let a = [1, 2, 3];"
},
{
"DocComment": ""
},
{
"DocComment": " let mut iter = a.iter();"
},
{
"DocComment": ""
},
{
"DocComment": " // A call to next() returns the next value..."
},
{
"DocComment": " assert_eq!(Some(&1), iter.next());"
},
{
"DocComment": " assert_eq!(Some(&2), iter.next());"
},
{
"DocComment": " assert_eq!(Some(&3), iter.next());"
},
{
"DocComment": ""
},
{
"DocComment": " // ... and then None once it's over."
},
{
"DocComment": " assert_eq!(None, iter.next());"
},
{
"DocComment": ""
},
{
"DocComment": " // More calls may or may not return `None`. Here, they always will."
},
{
"DocComment": " assert_eq!(None, iter.next());"
},
{
"DocComment": " assert_eq!(None, iter.next());"
},
{
"DocComment": " ```"
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": "next"
},
"signature": {
"is_unsafe": false,
"is_closure": false,
"closure_info": null,
"generics": {
"regions": [
{
"index": 0,
"name": null
}
],
"types": [
{
"index": 0,
"name": "Self"
}
],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"inputs": [
{
"Ref": [
{
"Var": {
"Free": 0
}
},
{
"TypeVar": {
"Free": 0
}
},
"Mut"
]
}
],
"output": {
"Adt": [
{
"Adt": 1
},
{
"regions": [],
"types": [
{
"TraitType": [
{
"kind": "SelfId",
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 3,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 3
}
}
}
}
}
},
"Item"
]
}
],
"const_generics": [],
"trait_refs": [
{
"kind": {
"ParentClause": [
"SelfId",
3,
0
]
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TraitType": [
{
"kind": "SelfId",
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 3,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 3
}
}
}
}
}
},
"Item"
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"target": {
"Item": {
"Type": 1
}
}
}
]
}
},
"kind": {
"TraitDecl": {
"trait_ref": {
"trait_id": 3,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 3
}
}
}
},
"item_name": "next",
"has_default": false
}
},
"is_global_initializer": null,
"body": {
"Err": null
}
},
{
"def_id": 4,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"fmt",
0
]
},
{
"Ident": [
"rt",
0
]
},
{
"Impl": [
{
"Ty": {
"params": {
"regions": [
{
"index": 0,
"name": null
}
],
"types": [],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"skip_binder": {
"Adt": [
{
"Adt": 3
},
{
"regions": [
{
"Var": {
"Bound": [
0,
0
]
}
}
],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 3
}
}
}
]
},
"kind": "InherentImplBlock"
}
},
1
]
},
{
"Ident": [
"new_debug",
0
]
}
],
"span": {
"span": {
"file_id": 8,
"beg": {
"line": 120,
"col": 4
},
"end": {
"line": 120,
"col": 53
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [],
"inline": "Hint",
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": null
},
"signature": {
"is_unsafe": false,
"is_closure": false,
"closure_info": null,
"generics": {
"regions": [
{
"index": 0,
"name": null
},
{
"index": 1,
"name": null
}
],
"types": [
{
"index": 0,
"name": "T"
}
],
"const_generics": [],
"trait_clauses": [
{
"clause_id": 0,
"span": {
"span": {
"file_id": 8,
"beg": {
"line": 120,
"col": 21
},
"end": {
"line": 120,
"col": 22
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnFn",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
},
{
"clause_id": 1,
"span": {
"span": {
"file_id": 8,
"beg": {
"line": 120,
"col": 24
},
"end": {
"line": 120,
"col": 29
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnFn",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 1,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 1
}
}
}
}
}
}
],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"inputs": [
{
"Ref": [
{
"Var": {
"Free": 1
}
},
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
}
],
"output": {
"Adt": [
{
"Adt": 3
},
{
"regions": [
{
"Var": {
"Free": 1
}
}
],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 3
}
}
}
]
}
},
"kind": "Regular",
"is_global_initializer": null,
"body": {
"Err": null
}
},
{
"def_id": 5,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"fmt",
0
]
},
{
"Impl": [
{
"Ty": {
"params": {
"regions": [
{
"index": 0,
"name": "'a"
}
],
"types": [],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"skip_binder": {
"Adt": [
{
"Adt": 2
},
{
"regions": [
{
"Var": {
"Bound": [
0,
0
]
}
}
],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 2
}
}
}
]
},
"kind": "InherentImplBlock"
}
},
4
]
},
{
"Ident": [
"new_v1",
0
]
}
],
"span": {
"span": {
"file_id": 3,
"beg": {
"line": 638,
"col": 4
},
"end": {
"line": 641,
"col": 22
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " When using the format_args!() macro, this function is used to generate the"
},
{
"DocComment": " Arguments structure."
}
],
"inline": "Hint",
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": null
},
"signature": {
"is_unsafe": false,
"is_closure": false,
"closure_info": null,
"generics": {
"regions": [
{
"index": 0,
"name": "'a"
}
],
"types": [],
"const_generics": [
{
"index": 0,
"name": "P",
"ty": {
"Integer": "Usize"
}
},
{
"index": 1,
"name": "A",
"ty": {
"Integer": "Usize"
}
}
],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"inputs": [
{
"Ref": [
{
"Var": {
"Free": 0
}
},
{
"Adt": [
{
"Builtin": "Array"
},
{
"regions": [],
"types": [
{
"Ref": [
"Static",
{
"Adt": [
{
"Builtin": "Str"
},
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
],
"const_generics": [
{
"Var": {
"Free": 0
}
}
],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
},
{
"Ref": [
{
"Var": {
"Free": 0
}
},
{
"Adt": [
{
"Builtin": "Array"
},
{
"regions": [],
"types": [
{
"Adt": [
{
"Adt": 3
},
{
"regions": [
{
"Var": {
"Free": 0
}
}
],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 3
}
}
}
]
}
],
"const_generics": [
{
"Var": {
"Free": 1
}
}
],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
],
"output": {
"Adt": [
{
"Adt": 2
},
{
"regions": [
{
"Var": {
"Free": 0
}
}
],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 2
}
}
}
]
}
},
"kind": "Regular",
"is_global_initializer": null,
"body": {
"Err": null
}
},
{
"def_id": 6,
"item_meta": {
"name": [
{
"Ident": [
"std",
0
]
},
{
"Ident": [
"io",
0
]
},
{
"Ident": [
"stdio",
0
]
},
{
"Ident": [
"_eprint",
0
]
}
],
"span": {
"span": {
"file_id": 14,
"beg": {
"line": 1285,
"col": 0
},
"end": {
"line": 1285,
"col": 40
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"Unknown": {
"path": "doc",
"args": "hidden"
}
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": null
},
"signature": {
"is_unsafe": false,
"is_closure": false,
"closure_info": null,
"generics": {
"regions": [
{
"index": 0,
"name": null
}
],
"types": [],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"inputs": [
{
"Adt": [
{
"Adt": 2
},
{
"regions": [
{
"Var": {
"Free": 0
}
}
],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 2
}
}
}
]
}
],
"output": {
"Adt": [
"Tuple",
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
}
},
"kind": "Regular",
"is_global_initializer": null,
"body": {
"Err": null
}
},
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
{
"def_id": 83,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"clone",
0
]
},
{
"Ident": [
"Clone",
0
]
},
{
"Ident": [
"clone",
0
]
}
],
"span": {
"span": {
"file_id": 18,
"beg": {
"line": 165,
"col": 4
},
"end": {
"line": 165,
"col": 28
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " Returns a copy of the value."
},
{
"DocComment": ""
},
{
"DocComment": " # Examples"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " # #![allow(noop_method_call)]"
},
{
"DocComment": " let hello = \"Hello\"; // &str implements Clone"
},
{
"DocComment": ""
},
{
"DocComment": " assert_eq!(\"Hello\", hello.clone());"
},
{
"DocComment": " ```"
},
{
"Unknown": {
"path": "must_use",
"args": null
}
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": "clone_fn"
},
"signature": {
"is_unsafe": false,
"is_closure": false,
"closure_info": null,
"generics": {
"regions": [
{
"index": 0,
"name": null
}
],
"types": [
{
"index": 0,
"name": "Self"
}
],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"inputs": [
{
"Ref": [
{
"Var": {
"Free": 0
}
},
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
}
],
"output": {
"TypeVar": {
"Free": 0
}
}
},
"kind": {
"TraitDecl": {
"trait_ref": {
"trait_id": 4,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 4
}
}
}
},
"item_name": "clone",
"has_default": false
}
},
"is_global_initializer": null,
"body": {
"Err": null
}
},
null,
{
"def_id": 85,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"cmp",
0
]
},
{
"Ident": [
"PartialEq",
0
]
},
{
"Ident": [
"eq",
0
]
}
],
"span": {
"span": {
"file_id": 25,
"beg": {
"line": 254,
"col": 4
},
"end": {
"line": 254,
"col": 38
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " Tests for `self` and `other` values to be equal, and is used by `==`."
},
{
"Unknown": {
"path": "must_use",
"args": null
}
},
{
"Unknown": {
"path": "rustc_diagnostic_item",
"args": null
}
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": "cmp_partialeq_eq"
},
"signature": {
"is_unsafe": false,
"is_closure": false,
"closure_info": null,
"generics": {
"regions": [
{
"index": 0,
"name": null
},
{
"index": 1,
"name": null
}
],
"types": [
{
"index": 0,
"name": "Self"
},
{
"index": 1,
"name": "Rhs"
}
],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"inputs": [
{
"Ref": [
{
"Var": {
"Free": 0
}
},
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
},
{
"Ref": [
{
"Var": {
"Free": 1
}
},
{
"TypeVar": {
"Free": 1
}
},
"Shared"
]
}
],
"output": {
"Literal": "Bool"
}
},
"kind": {
"TraitDecl": {
"trait_ref": {
"trait_id": 19,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
},
{
"TypeVar": {
"Free": 1
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 19
}
}
}
},
"item_name": "eq",
"has_default": false
}
},
"is_global_initializer": null,
"body": {
"Err": null
}
},
null,
{
"def_id": 87,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"cmp",
0
]
},
{
"Ident": [
"Ord",
0
]
},
{
"Ident": [
"cmp",
0
]
}
],
"span": {
"span": {
"file_id": 25,
"beg": {
"line": 975,
"col": 4
},
"end": {
"line": 975,
"col": 44
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " This method returns an [`Ordering`] between `self` and `other`."
},
{
"DocComment": ""
},
{
"DocComment": " By convention, `self.cmp(&other)` returns the ordering matching the expression"
},
{
"DocComment": " `self <operator> other` if true."
},
{
"DocComment": ""
},
{
"DocComment": " # Examples"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " use std::cmp::Ordering;"
},
{
"DocComment": ""
},
{
"DocComment": " assert_eq!(5.cmp(&10), Ordering::Less);"
},
{
"DocComment": " assert_eq!(10.cmp(&5), Ordering::Greater);"
},
{
"DocComment": " assert_eq!(5.cmp(&5), Ordering::Equal);"
},
{
"DocComment": " ```"
},
{
"Unknown": {
"path": "must_use",
"args": null
}
},
{
"Unknown": {
"path": "rustc_diagnostic_item",
"args": null
}
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": "ord_cmp_method"
},
"signature": {
"is_unsafe": false,
"is_closure": false,
"closure_info": null,
"generics": {
"regions": [
{
"index": 0,
"name": null
},
{
"index": 1,
"name": null
}
],
"types": [
{
"index": 0,
"name": "Self"
}
],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"inputs": [
{
"Ref": [
{
"Var": {
"Free": 0
}
},
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
},
{
"Ref": [
{
"Var": {
"Free": 1
}
},
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
}
],
"output": {
"Adt": [
{
"Adt": 4
},
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 4
}
}
}
]
}
},
"kind": {
"TraitDecl": {
"trait_ref": {
"trait_id": 14,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 14
}
}
}
},
"item_name": "cmp",
"has_default": false
}
},
"is_global_initializer": null,
"body": {
"Err": null
}
},
null,
null,
null,
null,
{
"def_id": 92,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"cmp",
0
]
},
{
"Ident": [
"PartialOrd",
0
]
},
{
"Ident": [
"partial_cmp",
0
]
}
],
"span": {
"span": {
"file_id": 25,
"beg": {
"line": 1367,
"col": 4
},
"end": {
"line": 1367,
"col": 59
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " This method returns an ordering between `self` and `other` values if one exists."
},
{
"DocComment": ""
},
{
"DocComment": " # Examples"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " use std::cmp::Ordering;"
},
{
"DocComment": ""
},
{
"DocComment": " let result = 1.0.partial_cmp(&2.0);"
},
{
"DocComment": " assert_eq!(result, Some(Ordering::Less));"
},
{
"DocComment": ""
},
{
"DocComment": " let result = 1.0.partial_cmp(&1.0);"
},
{
"DocComment": " assert_eq!(result, Some(Ordering::Equal));"
},
{
"DocComment": ""
},
{
"DocComment": " let result = 2.0.partial_cmp(&1.0);"
},
{
"DocComment": " assert_eq!(result, Some(Ordering::Greater));"
},
{
"DocComment": " ```"
},
{
"DocComment": ""
},
{
"DocComment": " When comparison is impossible:"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " let result = f64::NAN.partial_cmp(&1.0);"
},
{
"DocComment": " assert_eq!(result, None);"
},
{
"DocComment": " ```"
},
{
"Unknown": {
"path": "must_use",
"args": null
}
},
{
"Unknown": {
"path": "rustc_diagnostic_item",
"args": null
}
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": "cmp_partialord_cmp"
},
"signature": {
"is_unsafe": false,
"is_closure": false,
"closure_info": null,
"generics": {
"regions": [
{
"index": 0,
"name": null
},
{
"index": 1,
"name": null
}
],
"types": [
{
"index": 0,
"name": "Self"
},
{
"index": 1,
"name": "Rhs"
}
],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"inputs": [
{
"Ref": [
{
"Var": {
"Free": 0
}
},
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
},
{
"Ref": [
{
"Var": {
"Free": 1
}
},
{
"TypeVar": {
"Free": 1
}
},
"Shared"
]
}
],
"output": {
"Adt": [
{
"Adt": 1
},
{
"regions": [],
"types": [
{
"Adt": [
{
"Adt": 4
},
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 4
}
}
}
]
}
],
"const_generics": [],
"trait_refs": [
{
"kind": {
"BuiltinOrAuto": {
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"Adt": [
{
"Adt": 4
},
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 4
}
}
}
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
},
"parent_trait_refs": [],
"types": []
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"Adt": [
{
"Adt": 4
},
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 4
}
}
}
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"target": {
"Item": {
"Type": 1
}
}
}
]
}
},
"kind": {
"TraitDecl": {
"trait_ref": {
"trait_id": 18,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
},
{
"TypeVar": {
"Free": 1
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 18
}
}
}
},
"item_name": "partial_cmp",
"has_default": false
}
},
"is_global_initializer": null,
"body": {
"Err": null
}
},
null,
null,
null,
null,
null,
null,
null,
null,
{
"def_id": 101,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"default",
0
]
},
{
"Ident": [
"Default",
0
]
},
{
"Ident": [
"default",
0
]
}
],
"span": {
"span": {
"file_id": 22,
"beg": {
"line": 139,
"col": 4
},
"end": {
"line": 139,
"col": 25
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " Returns the \"default value\" for a type."
},
{
"DocComment": ""
},
{
"DocComment": " Default values are often some kind of initial value, identity value, or anything else that"
},
{
"DocComment": " may make sense as a default."
},
{
"DocComment": ""
},
{
"DocComment": " # Examples"
},
{
"DocComment": ""
},
{
"DocComment": " Using built-in default values:"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " let i: i8 = Default::default();"
},
{
"DocComment": " let (x, y): (Option<String>, f64) = Default::default();"
},
{
"DocComment": " let (a, b, (c, d)): (i32, u32, (bool, bool)) = Default::default();"
},
{
"DocComment": " ```"
},
{
"DocComment": ""
},
{
"DocComment": " Making your own:"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " # #[allow(dead_code)]"
},
{
"DocComment": " enum Kind {"
},
{
"DocComment": " A,"
},
{
"DocComment": " B,"
},
{
"DocComment": " C,"
},
{
"DocComment": " }"
},
{
"DocComment": ""
},
{
"DocComment": " impl Default for Kind {"
},
{
"DocComment": " fn default() -> Self { Kind::A }"
},
{
"DocComment": " }"
},
{
"DocComment": " ```"
},
{
"Unknown": {
"path": "rustc_diagnostic_item",
"args": null
}
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": "default_fn"
},
"signature": {
"is_unsafe": false,
"is_closure": false,
"closure_info": null,
"generics": {
"regions": [],
"types": [
{
"index": 0,
"name": "Self"
}
],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"inputs": [],
"output": {
"TypeVar": {
"Free": 0
}
}
},
"kind": {
"TraitDecl": {
"trait_ref": {
"trait_id": 11,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 11
}
}
}
},
"item_name": "default",
"has_default": false
}
},
"is_global_initializer": null,
"body": {
"Err": null
}
},
{
"def_id": 102,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"ops",
0
]
},
{
"Ident": [
"function",
0
]
},
{
"Ident": [
"FnMut",
0
]
},
{
"Ident": [
"call_mut",
0
]
}
],
"span": {
"span": {
"file_id": 20,
"beg": {
"line": 166,
"col": 4
},
"end": {
"line": 166,
"col": 74
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " Performs the call operation."
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": null
},
"signature": {
"is_unsafe": false,
"is_closure": false,
"closure_info": null,
"generics": {
"regions": [
{
"index": 0,
"name": null
}
],
"types": [
{
"index": 0,
"name": "Self"
},
{
"index": 1,
"name": "Args"
}
],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"inputs": [
{
"Ref": [
{
"Var": {
"Free": 0
}
},
{
"TypeVar": {
"Free": 0
}
},
"Mut"
]
},
{
"TypeVar": {
"Free": 1
}
}
],
"output": {
"TraitType": [
{
"kind": {
"ParentClause": [
"SelfId",
5,
0
]
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 6,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
},
{
"TypeVar": {
"Free": 1
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 6
}
}
}
}
}
},
"Output"
]
}
},
"kind": {
"TraitDecl": {
"trait_ref": {
"trait_id": 5,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
},
{
"TypeVar": {
"Free": 1
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 5
}
}
}
},
"item_name": "call_mut",
"has_default": false
}
},
"is_global_initializer": null,
"body": {
"Err": null
}
},
{
"def_id": 103,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"ops",
0
]
},
{
"Ident": [
"function",
0
]
},
{
"Ident": [
"FnOnce",
0
]
},
{
"Ident": [
"call_once",
0
]
}
],
"span": {
"span": {
"file_id": 20,
"beg": {
"line": 250,
"col": 4
},
"end": {
"line": 250,
"col": 70
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " Performs the call operation."
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": null
},
"signature": {
"is_unsafe": false,
"is_closure": false,
"closure_info": null,
"generics": {
"regions": [],
"types": [
{
"index": 0,
"name": "Self"
},
{
"index": 1,
"name": "Args"
}
],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"inputs": [
{
"TypeVar": {
"Free": 0
}
},
{
"TypeVar": {
"Free": 1
}
}
],
"output": {
"TraitType": [
{
"kind": "SelfId",
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 6,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
},
{
"TypeVar": {
"Free": 1
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 6
}
}
}
}
}
},
"Output"
]
}
},
"kind": {
"TraitDecl": {
"trait_ref": {
"trait_id": 6,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
},
{
"TypeVar": {
"Free": 1
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 6
}
}
}
},
"item_name": "call_once",
"has_default": false
}
},
"is_global_initializer": null,
"body": {
"Err": null
}
},
{
"def_id": 104,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"ops",
0
]
},
{
"Ident": [
"try_trait",
0
]
},
{
"Ident": [
"Try",
0
]
},
{
"Ident": [
"from_output",
0
]
}
],
"span": {
"span": {
"file_id": 21,
"beg": {
"line": 190,
"col": 4
},
"end": {
"line": 190,
"col": 49
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " Constructs the type from its `Output` type."
},
{
"DocComment": ""
},
{
"DocComment": " This should be implemented consistently with the `branch` method"
},
{
"DocComment": " such that applying the `?` operator will get back the original value:"
},
{
"DocComment": " `Try::from_output(x).branch() --> ControlFlow::Continue(x)`."
},
{
"DocComment": ""
},
{
"DocComment": " # Examples"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " #![feature(try_trait_v2)]"
},
{
"DocComment": " use std::ops::Try;"
},
{
"DocComment": ""
},
{
"DocComment": " assert_eq!(<Result<_, String> as Try>::from_output(3), Ok(3));"
},
{
"DocComment": " assert_eq!(<Option<_> as Try>::from_output(4), Some(4));"
},
{
"DocComment": " assert_eq!("
},
{
"DocComment": " <std::ops::ControlFlow<String, _> as Try>::from_output(5),"
},
{
"DocComment": " std::ops::ControlFlow::Continue(5),"
},
{
"DocComment": " );"
},
{
"DocComment": ""
},
{
"DocComment": " # fn make_question_mark_work() -> Option<()> {"
},
{
"DocComment": " assert_eq!(Option::from_output(4)?, 4);"
},
{
"DocComment": " # None }"
},
{
"DocComment": " # make_question_mark_work();"
},
{
"DocComment": ""
},
{
"DocComment": " // This is used, for example, on the accumulator in `try_fold`:"
},
{
"DocComment": " let r = std::iter::empty().try_fold(4, |_, ()| -> Option<_> { unreachable!() });"
},
{
"DocComment": " assert_eq!(r, Some(4));"
},
{
"DocComment": " ```"
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": "from_output"
},
"signature": {
"is_unsafe": false,
"is_closure": false,
"closure_info": null,
"generics": {
"regions": [],
"types": [
{
"index": 0,
"name": "Self"
}
],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"inputs": [
{
"TraitType": [
{
"kind": "SelfId",
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 8,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 8
}
}
}
}
}
},
"Output"
]
}
],
"output": {
"TypeVar": {
"Free": 0
}
}
},
"kind": {
"TraitDecl": {
"trait_ref": {
"trait_id": 8,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 8
}
}
}
},
"item_name": "from_output",
"has_default": false
}
},
"is_global_initializer": null,
"body": {
"Err": null
}
},
{
"def_id": 105,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"ops",
0
]
},
{
"Ident": [
"try_trait",
0
]
},
{
"Ident": [
"Try",
0
]
},
{
"Ident": [
"branch",
0
]
}
],
"span": {
"span": {
"file_id": 21,
"beg": {
"line": 217,
"col": 4
},
"end": {
"line": 217,
"col": 65
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " Used in `?` to decide whether the operator should produce a value"
},
{
"DocComment": " (because this returned [`ControlFlow::Continue`])"
},
{
"DocComment": " or propagate a value back to the caller"
},
{
"DocComment": " (because this returned [`ControlFlow::Break`])."
},
{
"DocComment": ""
},
{
"DocComment": " # Examples"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " #![feature(try_trait_v2)]"
},
{
"DocComment": " use std::ops::{ControlFlow, Try};"
},
{
"DocComment": ""
},
{
"DocComment": " assert_eq!(Ok::<_, String>(3).branch(), ControlFlow::Continue(3));"
},
{
"DocComment": " assert_eq!(Err::<String, _>(3).branch(), ControlFlow::Break(Err(3)));"
},
{
"DocComment": ""
},
{
"DocComment": " assert_eq!(Some(3).branch(), ControlFlow::Continue(3));"
},
{
"DocComment": " assert_eq!(None::<String>.branch(), ControlFlow::Break(None));"
},
{
"DocComment": ""
},
{
"DocComment": " assert_eq!(ControlFlow::<String, _>::Continue(3).branch(), ControlFlow::Continue(3));"
},
{
"DocComment": " assert_eq!("
},
{
"DocComment": " ControlFlow::<_, String>::Break(3).branch(),"
},
{
"DocComment": " ControlFlow::Break(ControlFlow::Break(3)),"
},
{
"DocComment": " );"
},
{
"DocComment": " ```"
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": "branch"
},
"signature": {
"is_unsafe": false,
"is_closure": false,
"closure_info": null,
"generics": {
"regions": [],
"types": [
{
"index": 0,
"name": "Self"
}
],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"inputs": [
{
"TypeVar": {
"Free": 0
}
}
],
"output": {
"Adt": [
{
"Adt": 5
},
{
"regions": [],
"types": [
{
"TraitType": [
{
"kind": "SelfId",
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 8,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 8
}
}
}
}
}
},
"Residual"
]
},
{
"TraitType": [
{
"kind": "SelfId",
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 8,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 8
}
}
}
}
}
},
"Output"
]
}
],
"const_generics": [],
"trait_refs": [
{
"kind": {
"ParentClause": [
{
"ParentClause": [
"SelfId",
8,
0
]
},
23,
0
]
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TraitType": [
{
"kind": "SelfId",
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 8,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 8
}
}
}
}
}
},
"Residual"
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
},
{
"kind": {
"ParentClause": [
"SelfId",
8,
1
]
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TraitType": [
{
"kind": "SelfId",
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 8,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 8
}
}
}
}
}
},
"Output"
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"target": {
"Item": {
"Type": 5
}
}
}
]
}
},
"kind": {
"TraitDecl": {
"trait_ref": {
"trait_id": 8,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 8
}
}
}
},
"item_name": "branch",
"has_default": false
}
},
"is_global_initializer": null,
"body": {
"Err": null
}
},
{
"def_id": 106,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"ops",
0
]
},
{
"Ident": [
"try_trait",
0
]
},
{
"Ident": [
"FromResidual",
0
]
},
{
"Ident": [
"from_residual",
0
]
}
],
"span": {
"span": {
"file_id": 21,
"beg": {
"line": 330,
"col": 4
},
"end": {
"line": 330,
"col": 42
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " Constructs the type from a compatible `Residual` type."
},
{
"DocComment": ""
},
{
"DocComment": " This should be implemented consistently with the `branch` method such"
},
{
"DocComment": " that applying the `?` operator will get back an equivalent residual:"
},
{
"DocComment": " `FromResidual::from_residual(r).branch() --> ControlFlow::Break(r)`."
},
{
"DocComment": " (The residual is not mandated to be *identical* when interconversion is involved.)"
},
{
"DocComment": ""
},
{
"DocComment": " # Examples"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " #![feature(try_trait_v2)]"
},
{
"DocComment": " use std::ops::{ControlFlow, FromResidual};"
},
{
"DocComment": ""
},
{
"DocComment": " assert_eq!(Result::<String, i64>::from_residual(Err(3_u8)), Err(3));"
},
{
"DocComment": " assert_eq!(Option::<String>::from_residual(None), None);"
},
{
"DocComment": " assert_eq!("
},
{
"DocComment": " ControlFlow::<_, String>::from_residual(ControlFlow::Break(5)),"
},
{
"DocComment": " ControlFlow::Break(5),"
},
{
"DocComment": " );"
},
{
"DocComment": " ```"
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": "from_residual"
},
"signature": {
"is_unsafe": false,
"is_closure": false,
"closure_info": null,
"generics": {
"regions": [],
"types": [
{
"index": 0,
"name": "Self"
},
{
"index": 1,
"name": "R"
}
],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"inputs": [
{
"TypeVar": {
"Free": 1
}
}
],
"output": {
"TypeVar": {
"Free": 0
}
}
},
"kind": {
"TraitDecl": {
"trait_ref": {
"trait_id": 23,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
},
{
"TypeVar": {
"Free": 1
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 23
}
}
}
},
"item_name": "from_residual",
"has_default": false
}
},
"is_global_initializer": null,
"body": {
"Err": null
}
},
null,
{
"def_id": 108,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"accum",
0
]
},
{
"Ident": [
"Sum",
0
]
},
{
"Ident": [
"sum",
0
]
}
],
"span": {
"span": {
"file_id": 26,
"beg": {
"line": 21,
"col": 4
},
"end": {
"line": 21,
"col": 51
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " Takes an iterator and generates `Self` from the elements by \"summing up\""
},
{
"DocComment": " the items."
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": null
},
"signature": {
"is_unsafe": false,
"is_closure": false,
"closure_info": null,
"generics": {
"regions": [],
"types": [
{
"index": 0,
"name": "Self"
},
{
"index": 1,
"name": "A"
},
{
"index": 2,
"name": "I"
}
],
"const_generics": [],
"trait_clauses": [
{
"clause_id": 0,
"span": {
"span": {
"file_id": 26,
"beg": {
"line": 21,
"col": 11
},
"end": {
"line": 21,
"col": 12
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnFn",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 2
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
},
{
"clause_id": 1,
"span": {
"span": {
"file_id": 26,
"beg": {
"line": 21,
"col": 14
},
"end": {
"line": 21,
"col": 32
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnFn",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 3,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 2
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 3
}
}
}
}
}
}
],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": [
{
"regions": [],
"skip_binder": {
"trait_ref": {
"kind": {
"Clause": {
"Free": 1
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 3,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 2
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 3
}
}
}
}
}
},
"type_name": "Item",
"ty": {
"TypeVar": {
"Free": 1
}
}
}
}
]
},
"inputs": [
{
"TypeVar": {
"Free": 2
}
}
],
"output": {
"TypeVar": {
"Free": 0
}
}
},
"kind": {
"TraitDecl": {
"trait_ref": {
"trait_id": 16,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
},
{
"TypeVar": {
"Free": 1
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 16
}
}
}
},
"item_name": "sum",
"has_default": false
}
},
"is_global_initializer": null,
"body": {
"Err": null
}
},
{
"def_id": 109,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"accum",
0
]
},
{
"Ident": [
"Product",
0
]
},
{
"Ident": [
"product",
0
]
}
],
"span": {
"span": {
"file_id": 26,
"beg": {
"line": 42,
"col": 4
},
"end": {
"line": 42,
"col": 55
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " Takes an iterator and generates `Self` from the elements by multiplying"
},
{
"DocComment": " the items."
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": null
},
"signature": {
"is_unsafe": false,
"is_closure": false,
"closure_info": null,
"generics": {
"regions": [],
"types": [
{
"index": 0,
"name": "Self"
},
{
"index": 1,
"name": "A"
},
{
"index": 2,
"name": "I"
}
],
"const_generics": [],
"trait_clauses": [
{
"clause_id": 0,
"span": {
"span": {
"file_id": 26,
"beg": {
"line": 42,
"col": 15
},
"end": {
"line": 42,
"col": 16
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnFn",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 2
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
},
{
"clause_id": 1,
"span": {
"span": {
"file_id": 26,
"beg": {
"line": 42,
"col": 18
},
"end": {
"line": 42,
"col": 36
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnFn",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 3,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 2
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 3
}
}
}
}
}
}
],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": [
{
"regions": [],
"skip_binder": {
"trait_ref": {
"kind": {
"Clause": {
"Free": 1
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 3,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 2
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 3
}
}
}
}
}
},
"type_name": "Item",
"ty": {
"TypeVar": {
"Free": 1
}
}
}
}
]
},
"inputs": [
{
"TypeVar": {
"Free": 2
}
}
],
"output": {
"TypeVar": {
"Free": 0
}
}
},
"kind": {
"TraitDecl": {
"trait_ref": {
"trait_id": 17,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
},
{
"TypeVar": {
"Free": 1
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 17
}
}
}
},
"item_name": "product",
"has_default": false
}
},
"is_global_initializer": null,
"body": {
"Err": null
}
},
{
"def_id": 110,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"collect",
0
]
},
{
"Ident": [
"FromIterator",
0
]
},
{
"Ident": [
"from_iter",
0
]
}
],
"span": {
"span": {
"file_id": 9,
"beg": {
"line": 152,
"col": 4
},
"end": {
"line": 152,
"col": 61
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " Creates a value from an iterator."
},
{
"DocComment": ""
},
{
"DocComment": " See the [module-level documentation] for more."
},
{
"DocComment": ""
},
{
"DocComment": " [module-level documentation]: crate::iter"
},
{
"DocComment": ""
},
{
"DocComment": " # Examples"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " let five_fives = std::iter::repeat(5).take(5);"
},
{
"DocComment": ""
},
{
"DocComment": " let v = Vec::from_iter(five_fives);"
},
{
"DocComment": ""
},
{
"DocComment": " assert_eq!(v, vec![5, 5, 5, 5, 5]);"
},
{
"DocComment": " ```"
},
{
"Unknown": {
"path": "rustc_diagnostic_item",
"args": null
}
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": "from_iter_fn"
},
"signature": {
"is_unsafe": false,
"is_closure": false,
"closure_info": null,
"generics": {
"regions": [],
"types": [
{
"index": 0,
"name": "Self"
},
{
"index": 1,
"name": "A"
},
{
"index": 2,
"name": "T"
}
],
"const_generics": [],
"trait_clauses": [
{
"clause_id": 0,
"span": {
"span": {
"file_id": 9,
"beg": {
"line": 152,
"col": 17
},
"end": {
"line": 152,
"col": 18
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnFn",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 2
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
},
{
"clause_id": 1,
"span": {
"span": {
"file_id": 9,
"beg": {
"line": 152,
"col": 20
},
"end": {
"line": 152,
"col": 42
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnFn",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 2,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 2
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 2
}
}
}
}
}
}
],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": [
{
"regions": [],
"skip_binder": {
"trait_ref": {
"kind": {
"Clause": {
"Free": 1
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 2,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 2
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 2
}
}
}
}
}
},
"type_name": "Item",
"ty": {
"TypeVar": {
"Free": 1
}
}
}
}
]
},
"inputs": [
{
"TypeVar": {
"Free": 2
}
}
],
"output": {
"TypeVar": {
"Free": 0
}
}
},
"kind": {
"TraitDecl": {
"trait_ref": {
"trait_id": 7,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
},
{
"TypeVar": {
"Free": 1
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 7
}
}
}
},
"item_name": "from_iter",
"has_default": false
}
},
"is_global_initializer": null,
"body": {
"Err": null
}
},
{
"def_id": 111,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"collect",
0
]
},
{
"Ident": [
"Extend",
0
]
},
{
"Ident": [
"extend",
0
]
}
],
"span": {
"span": {
"file_id": 9,
"beg": {
"line": 416,
"col": 4
},
"end": {
"line": 416,
"col": 61
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " Extends a collection with the contents of an iterator."
},
{
"DocComment": ""
},
{
"DocComment": " As this is the only required method for this trait, the [trait-level] docs"
},
{
"DocComment": " contain more details."
},
{
"DocComment": ""
},
{
"DocComment": " [trait-level]: Extend"
},
{
"DocComment": ""
},
{
"DocComment": " # Examples"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " // You can extend a String with some chars:"
},
{
"DocComment": " let mut message = String::from(\"abc\");"
},
{
"DocComment": ""
},
{
"DocComment": " message.extend(['d', 'e', 'f'].iter());"
},
{
"DocComment": ""
},
{
"DocComment": " assert_eq!(\"abcdef\", &message);"
},
{
"DocComment": " ```"
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": null
},
"signature": {
"is_unsafe": false,
"is_closure": false,
"closure_info": null,
"generics": {
"regions": [
{
"index": 0,
"name": null
}
],
"types": [
{
"index": 0,
"name": "Self"
},
{
"index": 1,
"name": "A"
},
{
"index": 2,
"name": "T"
}
],
"const_generics": [],
"trait_clauses": [
{
"clause_id": 0,
"span": {
"span": {
"file_id": 9,
"beg": {
"line": 416,
"col": 14
},
"end": {
"line": 416,
"col": 15
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnFn",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 2
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
},
{
"clause_id": 1,
"span": {
"span": {
"file_id": 9,
"beg": {
"line": 416,
"col": 17
},
"end": {
"line": 416,
"col": 39
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnFn",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 2,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 2
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 2
}
}
}
}
}
}
],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": [
{
"regions": [],
"skip_binder": {
"trait_ref": {
"kind": {
"Clause": {
"Free": 1
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 2,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 2
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 2
}
}
}
}
}
},
"type_name": "Item",
"ty": {
"TypeVar": {
"Free": 1
}
}
}
}
]
},
"inputs": [
{
"Ref": [
{
"Var": {
"Free": 0
}
},
{
"TypeVar": {
"Free": 0
}
},
"Mut"
]
},
{
"TypeVar": {
"Free": 2
}
}
],
"output": {
"Adt": [
"Tuple",
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
}
},
"kind": {
"TraitDecl": {
"trait_ref": {
"trait_id": 10,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
},
{
"TypeVar": {
"Free": 1
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 10
}
}
}
},
"item_name": "extend",
"has_default": false
}
},
"is_global_initializer": null,
"body": {
"Err": null
}
},
null,
null,
null,
{
"def_id": 115,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"double_ended",
0
]
},
{
"Ident": [
"DoubleEndedIterator",
0
]
},
{
"Ident": [
"next_back",
0
]
}
],
"span": {
"span": {
"file_id": 23,
"beg": {
"line": 94,
"col": 4
},
"end": {
"line": 94,
"col": 50
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " Removes and returns an element from the end of the iterator."
},
{
"DocComment": ""
},
{
"DocComment": " Returns `None` when there are no more elements."
},
{
"DocComment": ""
},
{
"DocComment": " The [trait-level] docs contain more details."
},
{
"DocComment": ""
},
{
"DocComment": " [trait-level]: DoubleEndedIterator"
},
{
"DocComment": ""
},
{
"DocComment": " # Examples"
},
{
"DocComment": ""
},
{
"DocComment": " Basic usage:"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " let numbers = vec![1, 2, 3, 4, 5, 6];"
},
{
"DocComment": ""
},
{
"DocComment": " let mut iter = numbers.iter();"
},
{
"DocComment": ""
},
{
"DocComment": " assert_eq!(Some(&1), iter.next());"
},
{
"DocComment": " assert_eq!(Some(&6), iter.next_back());"
},
{
"DocComment": " assert_eq!(Some(&5), iter.next_back());"
},
{
"DocComment": " assert_eq!(Some(&2), iter.next());"
},
{
"DocComment": " assert_eq!(Some(&3), iter.next());"
},
{
"DocComment": " assert_eq!(Some(&4), iter.next());"
},
{
"DocComment": " assert_eq!(None, iter.next());"
},
{
"DocComment": " assert_eq!(None, iter.next_back());"
},
{
"DocComment": " ```"
},
{
"DocComment": ""
},
{
"DocComment": " # Remarks"
},
{
"DocComment": ""
},
{
"DocComment": " The elements yielded by `DoubleEndedIterator`'s methods may differ from"
},
{
"DocComment": " the ones yielded by [`Iterator`]'s methods:"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " let vec = vec![(1, 'a'), (1, 'b'), (1, 'c'), (2, 'a'), (2, 'b')];"
},
{
"DocComment": " let uniq_by_fst_comp = || {"
},
{
"DocComment": " let mut seen = std::collections::HashSet::new();"
},
{
"DocComment": " vec.iter().copied().filter(move |x| seen.insert(x.0))"
},
{
"DocComment": " };"
},
{
"DocComment": ""
},
{
"DocComment": " assert_eq!(uniq_by_fst_comp().last(), Some((2, 'a')));"
},
{
"DocComment": " assert_eq!(uniq_by_fst_comp().next_back(), Some((2, 'b')));"
},
{
"DocComment": ""
},
{
"DocComment": " assert_eq!("
},
{
"DocComment": " uniq_by_fst_comp().fold(vec![], |mut v, x| {v.push(x); v}),"
},
{
"DocComment": " vec![(1, 'a'), (2, 'a')]"
},
{
"DocComment": " );"
},
{
"DocComment": " assert_eq!("
},
{
"DocComment": " uniq_by_fst_comp().rfold(vec![], |mut v, x| {v.push(x); v}),"
},
{
"DocComment": " vec![(2, 'b'), (1, 'c')]"
},
{
"DocComment": " );"
},
{
"DocComment": " ```"
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": null
},
"signature": {
"is_unsafe": false,
"is_closure": false,
"closure_info": null,
"generics": {
"regions": [
{
"index": 0,
"name": null
}
],
"types": [
{
"index": 0,
"name": "Self"
}
],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"inputs": [
{
"Ref": [
{
"Var": {
"Free": 0
}
},
{
"TypeVar": {
"Free": 0
}
},
"Mut"
]
}
],
"output": {
"Adt": [
{
"Adt": 1
},
{
"regions": [],
"types": [
{
"TraitType": [
{
"kind": {
"ParentClause": [
"SelfId",
12,
0
]
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 3,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 3
}
}
}
}
}
},
"Item"
]
}
],
"const_generics": [],
"trait_refs": [
{
"kind": {
"ParentClause": [
{
"ParentClause": [
"SelfId",
12,
0
]
},
3,
0
]
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TraitType": [
{
"kind": {
"ParentClause": [
"SelfId",
12,
0
]
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 3,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 3
}
}
}
}
}
},
"Item"
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"target": {
"Item": {
"Type": 1
}
}
}
]
}
},
"kind": {
"TraitDecl": {
"trait_ref": {
"trait_id": 12,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 12
}
}
}
},
"item_name": "next_back",
"has_default": false
}
},
"is_global_initializer": null,
"body": {
"Err": null
}
},
null,
null,
null,
null,
null,
null,
null,
{
"def_id": 123,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"fmt",
0
]
},
{
"Ident": [
"Debug",
0
]
},
{
"Ident": [
"fmt",
0
]
}
],
"span": {
"span": {
"file_id": 3,
"beg": {
"line": 932,
"col": 4
},
"end": {
"line": 932,
"col": 51
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"Unknown": {
"path": "doc",
"args": null
}
},
{
"DocComment": ""
},
{
"DocComment": " # Examples"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " use std::fmt;"
},
{
"DocComment": ""
},
{
"DocComment": " struct Position {"
},
{
"DocComment": " longitude: f32,"
},
{
"DocComment": " latitude: f32,"
},
{
"DocComment": " }"
},
{
"DocComment": ""
},
{
"DocComment": " impl fmt::Debug for Position {"
},
{
"DocComment": " fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {"
},
{
"DocComment": " f.debug_tuple(\"\")"
},
{
"DocComment": " .field(&self.longitude)"
},
{
"DocComment": " .field(&self.latitude)"
},
{
"DocComment": " .finish()"
},
{
"DocComment": " }"
},
{
"DocComment": " }"
},
{
"DocComment": ""
},
{
"DocComment": " let position = Position { longitude: 1.987, latitude: 2.983 };"
},
{
"DocComment": " assert_eq!(format!(\"{position:?}\"), \"(1.987, 2.983)\");"
},
{
"DocComment": ""
},
{
"DocComment": " assert_eq!(format!(\"{position:#?}\"), \"("
},
{
"DocComment": " 1.987,"
},
{
"DocComment": " 2.983,"
},
{
"DocComment": " )\");"
},
{
"DocComment": " ```"
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": null
},
"signature": {
"is_unsafe": false,
"is_closure": false,
"closure_info": null,
"generics": {
"regions": [
{
"index": 0,
"name": null
},
{
"index": 1,
"name": null
},
{
"index": 2,
"name": null
}
],
"types": [
{
"index": 0,
"name": "Self"
}
],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"inputs": [
{
"Ref": [
{
"Var": {
"Free": 0
}
},
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
},
{
"Ref": [
{
"Var": {
"Free": 1
}
},
{
"Adt": [
{
"Adt": 6
},
{
"regions": [
{
"Var": {
"Free": 2
}
}
],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 6
}
}
}
]
},
"Mut"
]
}
],
"output": {
"Adt": [
{
"Adt": 7
},
{
"regions": [],
"types": [
{
"Adt": [
"Tuple",
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
},
{
"Adt": [
{
"Adt": 8
},
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 8
}
}
}
]
}
],
"const_generics": [],
"trait_refs": [
{
"kind": {
"BuiltinOrAuto": {
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"Adt": [
"Tuple",
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
},
"parent_trait_refs": [],
"types": []
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"Adt": [
"Tuple",
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
},
{
"kind": {
"BuiltinOrAuto": {
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"Adt": [
{
"Adt": 8
},
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 8
}
}
}
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
},
"parent_trait_refs": [],
"types": []
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"Adt": [
{
"Adt": 8
},
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 8
}
}
}
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"target": {
"Item": {
"Type": 7
}
}
}
]
}
},
"kind": {
"TraitDecl": {
"trait_ref": {
"trait_id": 1,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 1
}
}
}
},
"item_name": "fmt",
"has_default": false
}
},
"is_global_initializer": null,
"body": {
"Err": null
}
},
{
"def_id": 124,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"slice",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Impl": [
{
"Trait": 0
},
1
]
},
{
"Ident": [
"into_iter",
0
]
}
],
"span": {
"span": {
"file_id": 4,
"beg": {
"line": 25,
"col": 4
},
"end": {
"line": 25,
"col": 37
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": null
},
"signature": {
"is_unsafe": false,
"is_closure": false,
"closure_info": null,
"generics": {
"regions": [
{
"index": 0,
"name": "'a"
}
],
"types": [
{
"index": 0,
"name": "T"
}
],
"const_generics": [],
"trait_clauses": [
{
"clause_id": 0,
"span": {
"span": {
"file_id": 4,
"beg": {
"line": 21,
"col": 9
},
"end": {
"line": 21,
"col": 10
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnImpl",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"inputs": [
{
"Ref": [
{
"Var": {
"Free": 0
}
},
{
"Adt": [
{
"Builtin": "Slice"
},
{
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
],
"output": {
"Adt": [
{
"Adt": 0
},
{
"regions": [
{
"Var": {
"Free": 0
}
}
],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [
{
"kind": {
"Clause": {
"Free": 0
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"target": {
"Item": {
"Type": 0
}
}
}
]
}
},
"kind": {
"TraitImpl": {
"impl_ref": {
"impl_id": 0,
"generics": {
"regions": [
{
"Var": {
"Free": 0
}
}
],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [
{
"kind": {
"Clause": {
"Free": 0
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"target": {
"Item": {
"TraitImpl": 0
}
}
}
},
"trait_ref": {
"trait_id": 2,
"generics": {
"regions": [],
"types": [
{
"Ref": [
{
"Var": {
"Free": 0
}
},
{
"Adt": [
{
"Builtin": "Slice"
},
{
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
},
"Shared"
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 2
}
}
}
},
"item_name": "into_iter",
"reuses_default": true
}
},
"is_global_initializer": null,
"body": {
"Err": null
}
},
{
"def_id": 125,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"fmt",
0
]
},
{
"Ident": [
"num",
0
]
},
{
"Impl": [
{
"Trait": 3
},
80
]
},
{
"Ident": [
"fmt",
0
]
}
],
"span": {
"span": {
"file_id": 17,
"beg": {
"line": 180,
"col": 16
},
"end": {
"line": 180,
"col": 72
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [],
"inline": "Hint",
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": null
},
"signature": {
"is_unsafe": false,
"is_closure": false,
"closure_info": null,
"generics": {
"regions": [
{
"index": 0,
"name": null
},
{
"index": 1,
"name": null
},
{
"index": 2,
"name": null
}
],
"types": [],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"inputs": [
{
"Ref": [
{
"Var": {
"Free": 0
}
},
{
"Literal": {
"Integer": "I32"
}
},
"Shared"
]
},
{
"Ref": [
{
"Var": {
"Free": 1
}
},
{
"Adt": [
{
"Adt": 6
},
{
"regions": [
{
"Var": {
"Free": 2
}
}
],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 6
}
}
}
]
},
"Mut"
]
}
],
"output": {
"Adt": [
{
"Adt": 7
},
{
"regions": [],
"types": [
{
"Adt": [
"Tuple",
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
},
{
"Adt": [
{
"Adt": 8
},
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 8
}
}
}
]
}
],
"const_generics": [],
"trait_refs": [
{
"kind": {
"BuiltinOrAuto": {
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"Adt": [
"Tuple",
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
},
"parent_trait_refs": [],
"types": []
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"Adt": [
"Tuple",
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
},
{
"kind": {
"BuiltinOrAuto": {
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"Adt": [
{
"Adt": 8
},
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 8
}
}
}
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
},
"parent_trait_refs": [],
"types": []
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"Adt": [
{
"Adt": 8
},
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 8
}
}
}
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"target": {
"Item": {
"Type": 7
}
}
}
]
}
},
"kind": {
"TraitImpl": {
"impl_ref": {
"impl_id": 3,
"generics": {
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitImpl": 3
}
}
}
},
"trait_ref": {
"trait_id": 1,
"generics": {
"regions": [],
"types": [
{
"Literal": {
"Integer": "I32"
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 1
}
}
}
},
"item_name": "fmt",
"reuses_default": true
}
},
"is_global_initializer": null,
"body": {
"Err": null
}
},
{
"def_id": 126,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"fmt",
0
]
},
{
"Impl": [
{
"Trait": 2
},
73
]
},
{
"Ident": [
"fmt",
0
]
}
],
"span": {
"span": {
"file_id": 3,
"beg": {
"line": 2698,
"col": 12
},
"end": {
"line": 2698,
"col": 58
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": null
},
"signature": {
"is_unsafe": false,
"is_closure": false,
"closure_info": null,
"generics": {
"regions": [
{
"index": 0,
"name": null
},
{
"index": 1,
"name": null
},
{
"index": 2,
"name": null
},
{
"index": 3,
"name": null
}
],
"types": [
{
"index": 0,
"name": "T"
}
],
"const_generics": [],
"trait_clauses": [
{
"clause_id": 0,
"span": {
"span": {
"file_id": 3,
"beg": {
"line": 2697,
"col": 25
},
"end": {
"line": 2697,
"col": 28
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnImpl",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 1,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 1
}
}
}
}
}
}
],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"inputs": [
{
"Ref": [
{
"Var": {
"Free": 1
}
},
{
"Ref": [
{
"Var": {
"Free": 0
}
},
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
},
"Shared"
]
},
{
"Ref": [
{
"Var": {
"Free": 2
}
},
{
"Adt": [
{
"Adt": 6
},
{
"regions": [
{
"Var": {
"Free": 3
}
}
],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 6
}
}
}
]
},
"Mut"
]
}
],
"output": {
"Adt": [
{
"Adt": 7
},
{
"regions": [],
"types": [
{
"Adt": [
"Tuple",
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
},
{
"Adt": [
{
"Adt": 8
},
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 8
}
}
}
]
}
],
"const_generics": [],
"trait_refs": [
{
"kind": {
"BuiltinOrAuto": {
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"Adt": [
"Tuple",
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
},
"parent_trait_refs": [],
"types": []
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"Adt": [
"Tuple",
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": "Builtin"
}
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
},
{
"kind": {
"BuiltinOrAuto": {
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"Adt": [
{
"Adt": 8
},
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 8
}
}
}
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
},
"parent_trait_refs": [],
"types": []
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"Adt": [
{
"Adt": 8
},
{
"regions": [],
"types": [],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Type": 8
}
}
}
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"target": {
"Item": {
"Type": 7
}
}
}
]
}
},
"kind": {
"TraitImpl": {
"impl_ref": {
"impl_id": 2,
"generics": {
"regions": [
{
"Var": {
"Free": 0
}
}
],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [
{
"kind": {
"Clause": {
"Free": 0
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 1,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 1
}
}
}
}
}
}
],
"target": {
"Item": {
"TraitImpl": 2
}
}
}
},
"trait_ref": {
"trait_id": 1,
"generics": {
"regions": [],
"types": [
{
"Ref": [
{
"Var": {
"Free": 0
}
},
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 1
}
}
}
},
"item_name": "fmt",
"reuses_default": true
}
},
"is_global_initializer": null,
"body": {
"Err": null
}
},
{
"def_id": 127,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"slice",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Impl": [
{
"Trait": 1
},
182
]
},
{
"Ident": [
"next",
0
]
}
],
"span": {
"span": {
"file_id": 13,
"beg": {
"line": 156,
"col": 12
},
"end": {
"line": 156,
"col": 47
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [],
"inline": "Hint",
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": null
},
"signature": {
"is_unsafe": false,
"is_closure": false,
"closure_info": null,
"generics": {
"regions": [
{
"index": 0,
"name": "'a"
},
{
"index": 1,
"name": null
}
],
"types": [
{
"index": 0,
"name": "T"
}
],
"const_generics": [],
"trait_clauses": [
{
"clause_id": 0,
"span": {
"span": {
"file_id": 13,
"beg": {
"line": 152,
"col": 17
},
"end": {
"line": 152,
"col": 18
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnImpl",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"inputs": [
{
"Ref": [
{
"Var": {
"Free": 1
}
},
{
"Adt": [
{
"Adt": 0
},
{
"regions": [
{
"Var": {
"Free": 0
}
}
],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [
{
"kind": {
"Clause": {
"Free": 0
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"target": {
"Item": {
"Type": 0
}
}
}
]
},
"Mut"
]
}
],
"output": {
"Adt": [
{
"Adt": 1
},
{
"regions": [],
"types": [
{
"Ref": [
{
"Var": {
"Free": 0
}
},
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
}
],
"const_generics": [],
"trait_refs": [
{
"kind": {
"BuiltinOrAuto": {
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"Ref": [
"Erased",
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
},
"parent_trait_refs": [],
"types": []
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"Ref": [
"Erased",
{
"TypeVar": {
"Free": 0
}
},
"Shared"
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"target": {
"Item": {
"Type": 1
}
}
}
]
}
},
"kind": {
"TraitImpl": {
"impl_ref": {
"impl_id": 1,
"generics": {
"regions": [
{
"Var": {
"Free": 0
}
}
],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [
{
"kind": {
"Clause": {
"Free": 0
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"target": {
"Item": {
"TraitImpl": 1
}
}
}
},
"trait_ref": {
"trait_id": 3,
"generics": {
"regions": [],
"types": [
{
"Adt": [
{
"Adt": 0
},
{
"regions": [
{
"Var": {
"Free": 0
}
}
],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [
{
"kind": {
"Clause": {
"Free": 0
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"target": {
"Item": {
"Type": 0
}
}
}
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 3
}
}
}
},
"item_name": "next",
"reuses_default": true
}
},
"is_global_initializer": null,
"body": {
"Err": null
}
},
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
],
"global_decls": [],
"trait_decls": [
{
"def_id": 0,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"marker",
0
]
},
{
"Ident": [
"Sized",
0
]
}
],
"span": {
"span": {
"file_id": 2,
"beg": {
"line": 154,
"col": 0
},
"end": {
"line": 154,
"col": 15
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " Types with a constant size known at compile time."
},
{
"DocComment": ""
},
{
"DocComment": " All type parameters have an implicit bound of `Sized`. The special syntax"
},
{
"DocComment": " `?Sized` can be used to remove this bound if it's not appropriate."
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " # #![allow(dead_code)]"
},
{
"DocComment": " struct Foo<T>(T);"
},
{
"DocComment": " struct Bar<T: ?Sized>(T);"
},
{
"DocComment": ""
},
{
"DocComment": " // struct FooUse(Foo<[i32]>); // error: Sized is not implemented for [i32]"
},
{
"DocComment": " struct BarUse(Bar<[i32]>); // OK"
},
{
"DocComment": " ```"
},
{
"DocComment": ""
},
{
"DocComment": " The one exception is the implicit `Self` type of a trait. A trait does not"
},
{
"DocComment": " have an implicit `Sized` bound as this is incompatible with [trait object]s"
},
{
"DocComment": " where, by definition, the trait needs to work with all possible implementors,"
},
{
"DocComment": " and thus could be any size."
},
{
"DocComment": ""
},
{
"DocComment": " Although Rust will let you bind `Sized` to a trait, you won't"
},
{
"DocComment": " be able to use it to form a trait object later:"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " # #![allow(unused_variables)]"
},
{
"DocComment": " trait Foo { }"
},
{
"DocComment": " trait Bar: Sized { }"
},
{
"DocComment": ""
},
{
"DocComment": " struct Impl;"
},
{
"DocComment": " impl Foo for Impl { }"
},
{
"DocComment": " impl Bar for Impl { }"
},
{
"DocComment": ""
},
{
"DocComment": " let x: &dyn Foo = &Impl; // OK"
},
{
"DocComment": " // let y: &dyn Bar = &Impl; // error: the trait `Bar` cannot"
},
{
"DocComment": " // be made into an object"
},
{
"DocComment": " ```"
},
{
"DocComment": ""
},
{
"DocComment": " [trait object]: ../../book/ch17-02-trait-objects.html"
},
{
"Unknown": {
"path": "doc",
"args": "alias = \"?\", alias = \"?Sized\""
}
},
{
"Unknown": {
"path": "diagnostic::on_unimplemented",
"args": "message =\n\"the size for values of type `{Self}` cannot be known at compilation time\",\nlabel = \"doesn't have a size known at compile-time\""
}
},
{
"Unknown": {
"path": "fundamental",
"args": null
}
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": "sized"
},
"generics": {
"regions": [],
"types": [
{
"index": 0,
"name": "Self"
}
],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"parent_clauses": [],
"consts": [],
"const_defaults": {},
"types": [],
"type_defaults": {},
"type_clauses": [],
"methods": []
},
{
"def_id": 1,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"fmt",
0
]
},
{
"Ident": [
"Debug",
0
]
}
],
"span": {
"span": {
"file_id": 3,
"beg": {
"line": 901,
"col": 0
},
"end": {
"line": 901,
"col": 15
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " `?` formatting."
},
{
"DocComment": ""
},
{
"DocComment": " `Debug` should format the output in a programmer-facing, debugging context."
},
{
"DocComment": ""
},
{
"DocComment": " Generally speaking, you should just `derive` a `Debug` implementation."
},
{
"DocComment": ""
},
{
"DocComment": " When used with the alternate format specifier `#?`, the output is pretty-printed."
},
{
"DocComment": ""
},
{
"DocComment": " For more information on formatters, see [the module-level documentation][module]."
},
{
"DocComment": ""
},
{
"DocComment": " [module]: ../../std/fmt/index.html"
},
{
"DocComment": ""
},
{
"DocComment": " This trait can be used with `#[derive]` if all fields implement `Debug`. When"
},
{
"DocComment": " `derive`d for structs, it will use the name of the `struct`, then `{`, then a"
},
{
"DocComment": " comma-separated list of each field's name and `Debug` value, then `}`. For"
},
{
"DocComment": " `enum`s, it will use the name of the variant and, if applicable, `(`, then the"
},
{
"DocComment": " `Debug` values of the fields, then `)`."
},
{
"DocComment": ""
},
{
"DocComment": " # Stability"
},
{
"DocComment": ""
},
{
"DocComment": " Derived `Debug` formats are not stable, and so may change with future Rust"
},
{
"DocComment": " versions. Additionally, `Debug` implementations of types provided by the"
},
{
"DocComment": " standard library (`std`, `core`, `alloc`, etc.) are not stable, and"
},
{
"DocComment": " may also change with future Rust versions."
},
{
"DocComment": ""
},
{
"DocComment": " # Examples"
},
{
"DocComment": ""
},
{
"DocComment": " Deriving an implementation:"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " #[derive(Debug)]"
},
{
"DocComment": " struct Point {"
},
{
"DocComment": " x: i32,"
},
{
"DocComment": " y: i32,"
},
{
"DocComment": " }"
},
{
"DocComment": ""
},
{
"DocComment": " let origin = Point { x: 0, y: 0 };"
},
{
"DocComment": ""
},
{
"DocComment": " assert_eq!("
},
{
"DocComment": " format!(\"The origin is: {origin:?}\"),"
},
{
"DocComment": " \"The origin is: Point { x: 0, y: 0 }\","
},
{
"DocComment": " );"
},
{
"DocComment": " ```"
},
{
"DocComment": ""
},
{
"DocComment": " Manually implementing:"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " use std::fmt;"
},
{
"DocComment": ""
},
{
"DocComment": " struct Point {"
},
{
"DocComment": " x: i32,"
},
{
"DocComment": " y: i32,"
},
{
"DocComment": " }"
},
{
"DocComment": ""
},
{
"DocComment": " impl fmt::Debug for Point {"
},
{
"DocComment": " fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {"
},
{
"DocComment": " f.debug_struct(\"Point\")"
},
{
"DocComment": " .field(\"x\", &self.x)"
},
{
"DocComment": " .field(\"y\", &self.y)"
},
{
"DocComment": " .finish()"
},
{
"DocComment": " }"
},
{
"DocComment": " }"
},
{
"DocComment": ""
},
{
"DocComment": " let origin = Point { x: 0, y: 0 };"
},
{
"DocComment": ""
},
{
"DocComment": " assert_eq!("
},
{
"DocComment": " format!(\"The origin is: {origin:?}\"),"
},
{
"DocComment": " \"The origin is: Point { x: 0, y: 0 }\","
},
{
"DocComment": " );"
},
{
"DocComment": " ```"
},
{
"DocComment": ""
},
{
"DocComment": " There are a number of helper methods on the [`Formatter`] struct to help you with manual"
},
{
"DocComment": " implementations, such as [`debug_struct`]."
},
{
"DocComment": ""
},
{
"DocComment": " [`debug_struct`]: Formatter::debug_struct"
},
{
"DocComment": ""
},
{
"DocComment": " Types that do not wish to use the standard suite of debug representations"
},
{
"DocComment": " provided by the `Formatter` trait (`debug_struct`, `debug_tuple`,"
},
{
"DocComment": " `debug_list`, `debug_set`, `debug_map`) can do something totally custom by"
},
{
"DocComment": " manually writing an arbitrary representation to the `Formatter`."
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " # use std::fmt;"
},
{
"DocComment": " # struct Point {"
},
{
"DocComment": " # x: i32,"
},
{
"DocComment": " # y: i32,"
},
{
"DocComment": " # }"
},
{
"DocComment": " #"
},
{
"DocComment": " impl fmt::Debug for Point {"
},
{
"DocComment": " fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {"
},
{
"DocComment": " write!(f, \"Point [{} {}]\", self.x, self.y)"
},
{
"DocComment": " }"
},
{
"DocComment": " }"
},
{
"DocComment": " ```"
},
{
"DocComment": ""
},
{
"DocComment": " `Debug` implementations using either `derive` or the debug builder API"
},
{
"DocComment": " on [`Formatter`] support pretty-printing using the alternate flag: `{:#?}`."
},
{
"DocComment": ""
},
{
"DocComment": " Pretty-printing with `#?`:"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " #[derive(Debug)]"
},
{
"DocComment": " struct Point {"
},
{
"DocComment": " x: i32,"
},
{
"DocComment": " y: i32,"
},
{
"DocComment": " }"
},
{
"DocComment": ""
},
{
"DocComment": " let origin = Point { x: 0, y: 0 };"
},
{
"DocComment": ""
},
{
"DocComment": " let expected = \"The origin is: Point {"
},
{
"DocComment": " x: 0,"
},
{
"DocComment": " y: 0,"
},
{
"DocComment": " }\";"
},
{
"DocComment": " assert_eq!(format!(\"The origin is: {origin:#?}\"), expected);"
},
{
"DocComment": " ```"
},
{
"Unknown": {
"path": "rustc_on_unimplemented",
"args": "on(crate_local, label = \"`{Self}` cannot be formatted using `{{:?}}`\", note =\n\"add `#[derive(Debug)]` to `{Self}` or manually `impl {Debug} for {Self}`\"),\nmessage = \"`{Self}` doesn't implement `{Debug}`\", label =\n\"`{Self}` cannot be formatted using `{{:?}}` because it doesn't implement `{Debug}`\""
}
},
{
"Unknown": {
"path": "doc",
"args": "alias = \"{:?}\""
}
},
{
"Unknown": {
"path": "rustc_diagnostic_item",
"args": null
}
},
{
"Unknown": {
"path": "rustc_trivial_field_reads",
"args": null
}
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": "Debug"
},
"generics": {
"regions": [],
"types": [
{
"index": 0,
"name": "Self"
}
],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"parent_clauses": [],
"consts": [],
"const_defaults": {},
"types": [],
"type_defaults": {},
"type_clauses": [],
"methods": [
[
"fmt",
{
"params": {
"regions": [
{
"index": 0,
"name": null
},
{
"index": 1,
"name": null
},
{
"index": 2,
"name": null
}
],
"types": [],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"skip_binder": {
"id": 123,
"generics": {
"regions": [
{
"Var": {
"Bound": [
0,
0
]
}
},
{
"Var": {
"Bound": [
0,
1
]
}
},
{
"Var": {
"Bound": [
0,
2
]
}
}
],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Fun": 123
}
}
}
},
"kind": {
"TraitMethod": [
1,
"fmt"
]
}
}
]
]
},
{
"def_id": 2,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"collect",
0
]
},
{
"Ident": [
"IntoIterator",
0
]
}
],
"span": {
"span": {
"file_id": 9,
"beg": {
"line": 285,
"col": 0
},
"end": {
"line": 285,
"col": 22
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " Conversion into an [`Iterator`]."
},
{
"DocComment": ""
},
{
"DocComment": " By implementing `IntoIterator` for a type, you define how it will be"
},
{
"DocComment": " converted to an iterator. This is common for types which describe a"
},
{
"DocComment": " collection of some kind."
},
{
"DocComment": ""
},
{
"DocComment": " One benefit of implementing `IntoIterator` is that your type will [work"
},
{
"DocComment": " with Rust's `for` loop syntax](crate::iter#for-loops-and-intoiterator)."
},
{
"DocComment": ""
},
{
"DocComment": " See also: [`FromIterator`]."
},
{
"DocComment": ""
},
{
"DocComment": " # Examples"
},
{
"DocComment": ""
},
{
"DocComment": " Basic usage:"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " let v = [1, 2, 3];"
},
{
"DocComment": " let mut iter = v.into_iter();"
},
{
"DocComment": ""
},
{
"DocComment": " assert_eq!(Some(1), iter.next());"
},
{
"DocComment": " assert_eq!(Some(2), iter.next());"
},
{
"DocComment": " assert_eq!(Some(3), iter.next());"
},
{
"DocComment": " assert_eq!(None, iter.next());"
},
{
"DocComment": " ```"
},
{
"DocComment": " Implementing `IntoIterator` for your type:"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " // A sample collection, that's just a wrapper over Vec<T>"
},
{
"DocComment": " #[derive(Debug)]"
},
{
"DocComment": " struct MyCollection(Vec<i32>);"
},
{
"DocComment": ""
},
{
"DocComment": " // Let's give it some methods so we can create one and add things"
},
{
"DocComment": " // to it."
},
{
"DocComment": " impl MyCollection {"
},
{
"DocComment": " fn new() -> MyCollection {"
},
{
"DocComment": " MyCollection(Vec::new())"
},
{
"DocComment": " }"
},
{
"DocComment": ""
},
{
"DocComment": " fn add(&mut self, elem: i32) {"
},
{
"DocComment": " self.0.push(elem);"
},
{
"DocComment": " }"
},
{
"DocComment": " }"
},
{
"DocComment": ""
},
{
"DocComment": " // and we'll implement IntoIterator"
},
{
"DocComment": " impl IntoIterator for MyCollection {"
},
{
"DocComment": " type Item = i32;"
},
{
"DocComment": " type IntoIter = std::vec::IntoIter<Self::Item>;"
},
{
"DocComment": ""
},
{
"DocComment": " fn into_iter(self) -> Self::IntoIter {"
},
{
"DocComment": " self.0.into_iter()"
},
{
"DocComment": " }"
},
{
"DocComment": " }"
},
{
"DocComment": ""
},
{
"DocComment": " // Now we can make a new collection..."
},
{
"DocComment": " let mut c = MyCollection::new();"
},
{
"DocComment": ""
},
{
"DocComment": " // ... add some stuff to it ..."
},
{
"DocComment": " c.add(0);"
},
{
"DocComment": " c.add(1);"
},
{
"DocComment": " c.add(2);"
},
{
"DocComment": ""
},
{
"DocComment": " // ... and then turn it into an Iterator:"
},
{
"DocComment": " for (i, n) in c.into_iter().enumerate() {"
},
{
"DocComment": " assert_eq!(i as i32, n);"
},
{
"DocComment": " }"
},
{
"DocComment": " ```"
},
{
"DocComment": ""
},
{
"DocComment": " It is common to use `IntoIterator` as a trait bound. This allows"
},
{
"DocComment": " the input collection type to change, so long as it is still an"
},
{
"DocComment": " iterator. Additional bounds can be specified by restricting on"
},
{
"DocComment": " `Item`:"
},
{
"DocComment": ""
},
{
"DocComment": " ```rust"
},
{
"DocComment": " fn collect_as_strings<T>(collection: T) -> Vec<String>"
},
{
"DocComment": " where"
},
{
"DocComment": " T: IntoIterator,"
},
{
"DocComment": " T::Item: std::fmt::Debug,"
},
{
"DocComment": " {"
},
{
"DocComment": " collection"
},
{
"DocComment": " .into_iter()"
},
{
"DocComment": " .map(|item| format!(\"{item:?}\"))"
},
{
"DocComment": " .collect()"
},
{
"DocComment": " }"
},
{
"DocComment": " ```"
},
{
"Unknown": {
"path": "rustc_diagnostic_item",
"args": null
}
},
{
"Unknown": {
"path": "rustc_on_unimplemented",
"args": "on(_Self = \"core::ops::range::RangeTo<Idx>\", label =\n\"if you meant to iterate until a value, add a starting value\", note =\n\"`..end` is a `RangeTo`, which cannot be iterated on; you might have meant to have a \\\n bounded `Range`: `0..end`\"),\non(_Self = \"core::ops::range::RangeToInclusive<Idx>\", label =\n\"if you meant to iterate until a value (including it), add a starting value\",\nnote =\n\"`..=end` is a `RangeToInclusive`, which cannot be iterated on; you might have meant \\\n to have a bounded `RangeInclusive`: `0..=end`\"),\non(_Self = \"[]\", label =\n\"`{Self}` is not an iterator; try calling `.into_iter()` or `.iter()`\"),\non(_Self = \"&[]\", label =\n\"`{Self}` is not an iterator; try calling `.iter()`\"),\non(_Self = \"alloc::vec::Vec<T, A>\", label =\n\"`{Self}` is not an iterator; try calling `.into_iter()` or `.iter()`\"),\non(_Self = \"&str\", label =\n\"`{Self}` is not an iterator; try calling `.chars()` or `.bytes()`\"),\non(_Self = \"alloc::string::String\", label =\n\"`{Self}` is not an iterator; try calling `.chars()` or `.bytes()`\"),\non(_Self = \"{integral}\", note =\n\"if you want to iterate between `start` until a value `end`, use the exclusive range \\\n syntax `start..end` or the inclusive range syntax `start..=end`\"),\non(_Self = \"{float}\", note =\n\"if you want to iterate between `start` until a value `end`, use the exclusive range \\\n syntax `start..end` or the inclusive range syntax `start..=end`\"),\nlabel = \"`{Self}` is not an iterator\", message = \"`{Self}` is not an iterator\""
}
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": "IntoIterator"
},
"generics": {
"regions": [],
"types": [
{
"index": 0,
"name": "Self"
}
],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": [
{
"regions": [],
"skip_binder": {
"trait_ref": {
"kind": {
"ParentClause": [
"SelfId",
2,
2
]
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 3,
"generics": {
"regions": [],
"types": [
{
"TraitType": [
{
"kind": "SelfId",
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 2,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 2
}
}
}
}
}
},
"IntoIter"
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 3
}
}
}
}
}
},
"type_name": "Item",
"ty": {
"TraitType": [
{
"kind": "SelfId",
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 2,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 2
}
}
}
}
}
},
"Item"
]
}
}
}
]
},
"parent_clauses": [
{
"clause_id": 0,
"span": {
"span": {
"file_id": 9,
"beg": {
"line": 288,
"col": 4
},
"end": {
"line": 288,
"col": 14
}
},
"generated_from_span": null
},
"origin": {
"TraitItem": "Item"
},
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TraitType": [
{
"kind": "SelfId",
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 2,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 2
}
}
}
}
}
},
"Item"
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
},
{
"clause_id": 1,
"span": {
"span": {
"file_id": 9,
"beg": {
"line": 292,
"col": 4
},
"end": {
"line": 292,
"col": 47
}
},
"generated_from_span": null
},
"origin": {
"TraitItem": "IntoIter"
},
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TraitType": [
{
"kind": "SelfId",
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 2,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 2
}
}
}
}
}
},
"IntoIter"
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
},
{
"clause_id": 2,
"span": {
"span": {
"file_id": 9,
"beg": {
"line": 292,
"col": 19
},
"end": {
"line": 292,
"col": 46
}
},
"generated_from_span": null
},
"origin": {
"TraitItem": "IntoIter"
},
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 3,
"generics": {
"regions": [],
"types": [
{
"TraitType": [
{
"kind": "SelfId",
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 2,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 2
}
}
}
}
}
},
"IntoIter"
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 3
}
}
}
}
}
}
],
"consts": [],
"const_defaults": {},
"types": [
"Item",
"IntoIter"
],
"type_defaults": {},
"type_clauses": [],
"methods": [
[
"into_iter",
{
"params": {
"regions": [],
"types": [],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"skip_binder": {
"id": 2,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Fun": 2
}
}
}
},
"kind": {
"TraitMethod": [
2,
"into_iter"
]
}
}
]
]
},
{
"def_id": 3,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"iterator",
0
]
},
{
"Ident": [
"Iterator",
0
]
}
],
"span": {
"span": {
"file_id": 12,
"beg": {
"line": 39,
"col": 0
},
"end": {
"line": 39,
"col": 18
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " A trait for dealing with iterators."
},
{
"DocComment": ""
},
{
"DocComment": " This is the main iterator trait. For more about the concept of iterators"
},
{
"DocComment": " generally, please see the [module-level documentation]. In particular, you"
},
{
"DocComment": " may want to know how to [implement `Iterator`][impl]."
},
{
"DocComment": ""
},
{
"DocComment": " [module-level documentation]: crate::iter"
},
{
"DocComment": " [impl]: crate::iter#implementing-iterator"
},
{
"Unknown": {
"path": "rustc_on_unimplemented",
"args": "on(_Self = \"core::ops::range::RangeTo<Idx>\", note =\n\"you might have meant to use a bounded `Range`\"),\non(_Self = \"core::ops::range::RangeToInclusive<Idx>\", note =\n\"you might have meant to use a bounded `RangeInclusive`\"), label =\n\"`{Self}` is not an iterator\", message = \"`{Self}` is not an iterator\""
}
},
{
"Unknown": {
"path": "doc",
"args": "notable_trait"
}
},
{
"Unknown": {
"path": "rustc_diagnostic_item",
"args": null
}
},
{
"Unknown": {
"path": "must_use",
"args": null
}
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": "iterator"
},
"generics": {
"regions": [],
"types": [
{
"index": 0,
"name": "Self"
}
],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"parent_clauses": [
{
"clause_id": 0,
"span": {
"span": {
"file_id": 12,
"beg": {
"line": 43,
"col": 4
},
"end": {
"line": 43,
"col": 14
}
},
"generated_from_span": null
},
"origin": {
"TraitItem": "Item"
},
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TraitType": [
{
"kind": "SelfId",
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 3,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 3
}
}
}
}
}
},
"Item"
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"consts": [],
"const_defaults": {},
"types": [
"Item"
],
"type_defaults": {},
"type_clauses": [],
"methods": [
[
"next",
{
"params": {
"regions": [
{
"index": 0,
"name": null
}
],
"types": [],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"skip_binder": {
"id": 3,
"generics": {
"regions": [
{
"Var": {
"Bound": [
0,
0
]
}
}
],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Fun": 3
}
}
}
},
"kind": {
"TraitMethod": [
3,
"next"
]
}
}
]
]
},
{
"def_id": 4,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"clone",
0
]
},
{
"Ident": [
"Clone",
0
]
}
],
"span": {
"span": {
"file_id": 18,
"beg": {
"line": 149,
"col": 0
},
"end": {
"line": 149,
"col": 22
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " A common trait for the ability to explicitly duplicate an object."
},
{
"DocComment": ""
},
{
"DocComment": " Differs from [`Copy`] in that [`Copy`] is implicit and an inexpensive bit-wise copy, while"
},
{
"DocComment": " `Clone` is always explicit and may or may not be expensive. In order to enforce"
},
{
"DocComment": " these characteristics, Rust does not allow you to reimplement [`Copy`], but you"
},
{
"DocComment": " may reimplement `Clone` and run arbitrary code."
},
{
"DocComment": ""
},
{
"DocComment": " Since `Clone` is more general than [`Copy`], you can automatically make anything"
},
{
"DocComment": " [`Copy`] be `Clone` as well."
},
{
"DocComment": ""
},
{
"DocComment": " ## Derivable"
},
{
"DocComment": ""
},
{
"DocComment": " This trait can be used with `#[derive]` if all fields are `Clone`. The `derive`d"
},
{
"DocComment": " implementation of [`Clone`] calls [`clone`] on each field."
},
{
"DocComment": ""
},
{
"DocComment": " [`clone`]: Clone::clone"
},
{
"DocComment": ""
},
{
"DocComment": " For a generic struct, `#[derive]` implements `Clone` conditionally by adding bound `Clone` on"
},
{
"DocComment": " generic parameters."
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " // `derive` implements Clone for Reading<T> when T is Clone."
},
{
"DocComment": " #[derive(Clone)]"
},
{
"DocComment": " struct Reading<T> {"
},
{
"DocComment": " frequency: T,"
},
{
"DocComment": " }"
},
{
"DocComment": " ```"
},
{
"DocComment": ""
},
{
"DocComment": " ## How can I implement `Clone`?"
},
{
"DocComment": ""
},
{
"DocComment": " Types that are [`Copy`] should have a trivial implementation of `Clone`. More formally:"
},
{
"DocComment": " if `T: Copy`, `x: T`, and `y: &T`, then `let x = y.clone();` is equivalent to `let x = *y;`."
},
{
"DocComment": " Manual implementations should be careful to uphold this invariant; however, unsafe code"
},
{
"DocComment": " must not rely on it to ensure memory safety."
},
{
"DocComment": ""
},
{
"DocComment": " An example is a generic struct holding a function pointer. In this case, the"
},
{
"DocComment": " implementation of `Clone` cannot be `derive`d, but can be implemented as:"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " struct Generate<T>(fn() -> T);"
},
{
"DocComment": ""
},
{
"DocComment": " impl<T> Copy for Generate<T> {}"
},
{
"DocComment": ""
},
{
"DocComment": " impl<T> Clone for Generate<T> {"
},
{
"DocComment": " fn clone(&self) -> Self {"
},
{
"DocComment": " *self"
},
{
"DocComment": " }"
},
{
"DocComment": " }"
},
{
"DocComment": " ```"
},
{
"DocComment": ""
},
{
"DocComment": " If we `derive`:"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " #[derive(Copy, Clone)]"
},
{
"DocComment": " struct Generate<T>(fn() -> T);"
},
{
"DocComment": " ```"
},
{
"DocComment": ""
},
{
"DocComment": " the auto-derived implementations will have unnecessary `T: Copy` and `T: Clone` bounds:"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " # struct Generate<T>(fn() -> T);"
},
{
"DocComment": ""
},
{
"DocComment": " // Automatically derived"
},
{
"DocComment": " impl<T: Copy> Copy for Generate<T> { }"
},
{
"DocComment": ""
},
{
"DocComment": " // Automatically derived"
},
{
"DocComment": " impl<T: Clone> Clone for Generate<T> {"
},
{
"DocComment": " fn clone(&self) -> Generate<T> {"
},
{
"DocComment": " Generate(Clone::clone(&self.0))"
},
{
"DocComment": " }"
},
{
"DocComment": " }"
},
{
"DocComment": " ```"
},
{
"DocComment": ""
},
{
"DocComment": " The bounds are unnecessary because clearly the function itself should be"
},
{
"DocComment": " copy- and cloneable even if its return type is not:"
},
{
"DocComment": ""
},
{
"DocComment": " ```compile_fail,E0599"
},
{
"DocComment": " #[derive(Copy, Clone)]"
},
{
"DocComment": " struct Generate<T>(fn() -> T);"
},
{
"DocComment": ""
},
{
"DocComment": " struct NotCloneable;"
},
{
"DocComment": ""
},
{
"DocComment": " fn generate_not_cloneable() -> NotCloneable {"
},
{
"DocComment": " NotCloneable"
},
{
"DocComment": " }"
},
{
"DocComment": ""
},
{
"DocComment": " Generate(generate_not_cloneable).clone(); // error: trait bounds were not satisfied"
},
{
"DocComment": " // Note: With the manual implementations the above line will compile."
},
{
"DocComment": " ```"
},
{
"DocComment": ""
},
{
"DocComment": " ## Additional implementors"
},
{
"DocComment": ""
},
{
"DocComment": " In addition to the [implementors listed below][impls],"
},
{
"DocComment": " the following types also implement `Clone`:"
},
{
"DocComment": ""
},
{
"DocComment": " * Function item types (i.e., the distinct types defined for each function)"
},
{
"DocComment": " * Function pointer types (e.g., `fn() -> i32`)"
},
{
"DocComment": " * Closure types, if they capture no value from the environment"
},
{
"DocComment": " or if all such captured values implement `Clone` themselves."
},
{
"DocComment": " Note that variables captured by shared reference always implement `Clone`"
},
{
"DocComment": " (even if the referent doesn't),"
},
{
"DocComment": " while variables captured by mutable reference never implement `Clone`."
},
{
"DocComment": ""
},
{
"DocComment": " [impls]: #implementors"
},
{
"Unknown": {
"path": "rustc_diagnostic_item",
"args": null
}
},
{
"Unknown": {
"path": "rustc_trivial_field_reads",
"args": null
}
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": "clone"
},
"generics": {
"regions": [],
"types": [
{
"index": 0,
"name": "Self"
}
],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"parent_clauses": [
{
"clause_id": 0,
"span": {
"span": {
"file_id": 18,
"beg": {
"line": 149,
"col": 17
},
"end": {
"line": 149,
"col": 22
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnTrait",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"consts": [],
"const_defaults": {},
"types": [],
"type_defaults": {},
"type_clauses": [],
"methods": [
[
"clone",
{
"params": {
"regions": [
{
"index": 0,
"name": null
}
],
"types": [],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"skip_binder": {
"id": 83,
"generics": {
"regions": [
{
"Var": {
"Bound": [
0,
0
]
}
}
],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Fun": 83
}
}
}
},
"kind": {
"TraitMethod": [
4,
"clone"
]
}
}
]
]
},
{
"def_id": 5,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"ops",
0
]
},
{
"Ident": [
"function",
0
]
},
{
"Ident": [
"FnMut",
0
]
}
],
"span": {
"span": {
"file_id": 20,
"beg": {
"line": 163,
"col": 0
},
"end": {
"line": 163,
"col": 42
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " The version of the call operator that takes a mutable receiver."
},
{
"DocComment": ""
},
{
"DocComment": " Instances of `FnMut` can be called repeatedly and may mutate state."
},
{
"DocComment": ""
},
{
"DocComment": " `FnMut` is implemented automatically by closures which take mutable"
},
{
"DocComment": " references to captured variables, as well as all types that implement"
},
{
"DocComment": " [`Fn`], e.g., (safe) [function pointers] (since `FnMut` is a supertrait of"
},
{
"DocComment": " [`Fn`]). Additionally, for any type `F` that implements `FnMut`, `&mut F`"
},
{
"DocComment": " implements `FnMut`, too."
},
{
"DocComment": ""
},
{
"DocComment": " Since [`FnOnce`] is a supertrait of `FnMut`, any instance of `FnMut` can be"
},
{
"DocComment": " used where a [`FnOnce`] is expected, and since [`Fn`] is a subtrait of"
},
{
"DocComment": " `FnMut`, any instance of [`Fn`] can be used where `FnMut` is expected."
},
{
"DocComment": ""
},
{
"DocComment": " Use `FnMut` as a bound when you want to accept a parameter of function-like"
},
{
"DocComment": " type and need to call it repeatedly, while allowing it to mutate state."
},
{
"DocComment": " If you don't want the parameter to mutate state, use [`Fn`] as a"
},
{
"DocComment": " bound; if you don't need to call it repeatedly, use [`FnOnce`]."
},
{
"DocComment": ""
},
{
"DocComment": " See the [chapter on closures in *The Rust Programming Language*][book] for"
},
{
"DocComment": " some more information on this topic."
},
{
"DocComment": ""
},
{
"DocComment": " Also of note is the special syntax for `Fn` traits (e.g."
},
{
"DocComment": " `Fn(usize, bool) -> usize`). Those interested in the technical details of"
},
{
"DocComment": " this can refer to [the relevant section in the *Rustonomicon*][nomicon]."
},
{
"DocComment": ""
},
{
"DocComment": " [book]: ../../book/ch13-01-closures.html"
},
{
"DocComment": " [function pointers]: fn"
},
{
"DocComment": " [nomicon]: ../../nomicon/hrtb.html"
},
{
"DocComment": ""
},
{
"DocComment": " # Examples"
},
{
"DocComment": ""
},
{
"DocComment": " ## Calling a mutably capturing closure"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " let mut x = 5;"
},
{
"DocComment": " {"
},
{
"DocComment": " let mut square_x = || x *= x;"
},
{
"DocComment": " square_x();"
},
{
"DocComment": " }"
},
{
"DocComment": " assert_eq!(x, 25);"
},
{
"DocComment": " ```"
},
{
"DocComment": ""
},
{
"DocComment": " ## Using a `FnMut` parameter"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " fn do_twice<F>(mut func: F)"
},
{
"DocComment": " where F: FnMut()"
},
{
"DocComment": " {"
},
{
"DocComment": " func();"
},
{
"DocComment": " func();"
},
{
"DocComment": " }"
},
{
"DocComment": ""
},
{
"DocComment": " let mut x: usize = 1;"
},
{
"DocComment": " {"
},
{
"DocComment": " let add_two_to_x = || x += 2;"
},
{
"DocComment": " do_twice(add_two_to_x);"
},
{
"DocComment": " }"
},
{
"DocComment": ""
},
{
"DocComment": " assert_eq!(x, 5);"
},
{
"DocComment": " ```"
},
{
"Unknown": {
"path": "rustc_on_unimplemented",
"args": "on(Args = \"()\", note =\n\"wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}`\"),\non(_Self = \"unsafe fn\", note =\n\"unsafe function cannot be called generically without an unsafe block\", label\n= \"call the function in a closure: `|| unsafe {{ /* code */ }}`\"), message =\n\"expected a `{Trait}` closure, found `{Self}`\", label =\n\"expected an `{Trait}` closure, found `{Self}`\""
}
},
{
"Unknown": {
"path": "fundamental",
"args": null
}
},
{
"Unknown": {
"path": "must_use",
"args": null
}
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": "fn_mut"
},
"generics": {
"regions": [],
"types": [
{
"index": 0,
"name": "Self"
},
{
"index": 1,
"name": "Args"
}
],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"parent_clauses": [
{
"clause_id": 0,
"span": {
"span": {
"file_id": 20,
"beg": {
"line": 163,
"col": 30
},
"end": {
"line": 163,
"col": 42
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnTrait",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 6,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
},
{
"TypeVar": {
"Free": 1
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 6
}
}
}
}
}
},
{
"clause_id": 1,
"span": {
"span": {
"file_id": 20,
"beg": {
"line": 163,
"col": 16
},
"end": {
"line": 163,
"col": 20
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnTrait",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 1
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
},
{
"clause_id": 2,
"span": {
"span": {
"file_id": 20,
"beg": {
"line": 163,
"col": 22
},
"end": {
"line": 163,
"col": 27
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnTrait",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 22,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 1
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 22
}
}
}
}
}
}
],
"consts": [],
"const_defaults": {},
"types": [],
"type_defaults": {},
"type_clauses": [],
"methods": [
[
"call_mut",
{
"params": {
"regions": [
{
"index": 0,
"name": null
}
],
"types": [],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"skip_binder": {
"id": 102,
"generics": {
"regions": [
{
"Var": {
"Bound": [
0,
0
]
}
}
],
"types": [
{
"TypeVar": {
"Free": 0
}
},
{
"TypeVar": {
"Free": 1
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Fun": 102
}
}
}
},
"kind": {
"TraitMethod": [
5,
"call_mut"
]
}
}
]
]
},
{
"def_id": 6,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"ops",
0
]
},
{
"Ident": [
"function",
0
]
},
{
"Ident": [
"FnOnce",
0
]
}
],
"span": {
"span": {
"file_id": 20,
"beg": {
"line": 242,
"col": 0
},
"end": {
"line": 242,
"col": 29
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " The version of the call operator that takes a by-value receiver."
},
{
"DocComment": ""
},
{
"DocComment": " Instances of `FnOnce` can be called, but might not be callable multiple"
},
{
"DocComment": " times. Because of this, if the only thing known about a type is that it"
},
{
"DocComment": " implements `FnOnce`, it can only be called once."
},
{
"DocComment": ""
},
{
"DocComment": " `FnOnce` is implemented automatically by closures that might consume captured"
},
{
"DocComment": " variables, as well as all types that implement [`FnMut`], e.g., (safe)"
},
{
"DocComment": " [function pointers] (since `FnOnce` is a supertrait of [`FnMut`])."
},
{
"DocComment": ""
},
{
"DocComment": " Since both [`Fn`] and [`FnMut`] are subtraits of `FnOnce`, any instance of"
},
{
"DocComment": " [`Fn`] or [`FnMut`] can be used where a `FnOnce` is expected."
},
{
"DocComment": ""
},
{
"DocComment": " Use `FnOnce` as a bound when you want to accept a parameter of function-like"
},
{
"DocComment": " type and only need to call it once. If you need to call the parameter"
},
{
"DocComment": " repeatedly, use [`FnMut`] as a bound; if you also need it to not mutate"
},
{
"DocComment": " state, use [`Fn`]."
},
{
"DocComment": ""
},
{
"DocComment": " See the [chapter on closures in *The Rust Programming Language*][book] for"
},
{
"DocComment": " some more information on this topic."
},
{
"DocComment": ""
},
{
"DocComment": " Also of note is the special syntax for `Fn` traits (e.g."
},
{
"DocComment": " `Fn(usize, bool) -> usize`). Those interested in the technical details of"
},
{
"DocComment": " this can refer to [the relevant section in the *Rustonomicon*][nomicon]."
},
{
"DocComment": ""
},
{
"DocComment": " [book]: ../../book/ch13-01-closures.html"
},
{
"DocComment": " [function pointers]: fn"
},
{
"DocComment": " [nomicon]: ../../nomicon/hrtb.html"
},
{
"DocComment": ""
},
{
"DocComment": " # Examples"
},
{
"DocComment": ""
},
{
"DocComment": " ## Using a `FnOnce` parameter"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " fn consume_with_relish<F>(func: F)"
},
{
"DocComment": " where F: FnOnce() -> String"
},
{
"DocComment": " {"
},
{
"DocComment": " // `func` consumes its captured variables, so it cannot be run more"
},
{
"DocComment": " // than once."
},
{
"DocComment": " println!(\"Consumed: {}\", func());"
},
{
"DocComment": ""
},
{
"DocComment": " println!(\"Delicious!\");"
},
{
"DocComment": ""
},
{
"DocComment": " // Attempting to invoke `func()` again will throw a `use of moved"
},
{
"DocComment": " // value` error for `func`."
},
{
"DocComment": " }"
},
{
"DocComment": ""
},
{
"DocComment": " let x = String::from(\"x\");"
},
{
"DocComment": " let consume_and_return_x = move || x;"
},
{
"DocComment": " consume_with_relish(consume_and_return_x);"
},
{
"DocComment": ""
},
{
"DocComment": " // `consume_and_return_x` can no longer be invoked at this point"
},
{
"DocComment": " ```"
},
{
"Unknown": {
"path": "rustc_on_unimplemented",
"args": "on(Args = \"()\", note =\n\"wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}`\"),\non(_Self = \"unsafe fn\", note =\n\"unsafe function cannot be called generically without an unsafe block\", label\n= \"call the function in a closure: `|| unsafe {{ /* code */ }}`\"), message =\n\"expected a `{Trait}` closure, found `{Self}`\", label =\n\"expected an `{Trait}` closure, found `{Self}`\""
}
},
{
"Unknown": {
"path": "fundamental",
"args": null
}
},
{
"Unknown": {
"path": "must_use",
"args": null
}
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": "fn_once"
},
"generics": {
"regions": [],
"types": [
{
"index": 0,
"name": "Self"
},
{
"index": 1,
"name": "Args"
}
],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"parent_clauses": [
{
"clause_id": 0,
"span": {
"span": {
"file_id": 20,
"beg": {
"line": 242,
"col": 17
},
"end": {
"line": 242,
"col": 21
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnTrait",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 1
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
},
{
"clause_id": 1,
"span": {
"span": {
"file_id": 20,
"beg": {
"line": 242,
"col": 23
},
"end": {
"line": 242,
"col": 28
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnTrait",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 22,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 1
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 22
}
}
}
}
}
},
{
"clause_id": 2,
"span": {
"span": {
"file_id": 20,
"beg": {
"line": 246,
"col": 4
},
"end": {
"line": 246,
"col": 16
}
},
"generated_from_span": null
},
"origin": {
"TraitItem": "Output"
},
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TraitType": [
{
"kind": "SelfId",
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 6,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
},
{
"TypeVar": {
"Free": 1
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 6
}
}
}
}
}
},
"Output"
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"consts": [],
"const_defaults": {},
"types": [
"Output"
],
"type_defaults": {},
"type_clauses": [],
"methods": [
[
"call_once",
{
"params": {
"regions": [],
"types": [],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"skip_binder": {
"id": 103,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
},
{
"TypeVar": {
"Free": 1
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Fun": 103
}
}
}
},
"kind": {
"TraitMethod": [
6,
"call_once"
]
}
}
]
]
},
{
"def_id": 7,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"collect",
0
]
},
{
"Ident": [
"FromIterator",
0
]
}
],
"span": {
"span": {
"file_id": 9,
"beg": {
"line": 134,
"col": 0
},
"end": {
"line": 134,
"col": 32
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " Conversion from an [`Iterator`]."
},
{
"DocComment": ""
},
{
"DocComment": " By implementing `FromIterator` for a type, you define how it will be"
},
{
"DocComment": " created from an iterator. This is common for types which describe a"
},
{
"DocComment": " collection of some kind."
},
{
"DocComment": ""
},
{
"DocComment": " If you want to create a collection from the contents of an iterator, the"
},
{
"DocComment": " [`Iterator::collect()`] method is preferred. However, when you need to"
},
{
"DocComment": " specify the container type, [`FromIterator::from_iter()`] can be more"
},
{
"DocComment": " readable than using a turbofish (e.g. `::<Vec<_>>()`). See the"
},
{
"DocComment": " [`Iterator::collect()`] documentation for more examples of its use."
},
{
"DocComment": ""
},
{
"DocComment": " See also: [`IntoIterator`]."
},
{
"DocComment": ""
},
{
"DocComment": " # Examples"
},
{
"DocComment": ""
},
{
"DocComment": " Basic usage:"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " let five_fives = std::iter::repeat(5).take(5);"
},
{
"DocComment": ""
},
{
"DocComment": " let v = Vec::from_iter(five_fives);"
},
{
"DocComment": ""
},
{
"DocComment": " assert_eq!(v, vec![5, 5, 5, 5, 5]);"
},
{
"DocComment": " ```"
},
{
"DocComment": ""
},
{
"DocComment": " Using [`Iterator::collect()`] to implicitly use `FromIterator`:"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " let five_fives = std::iter::repeat(5).take(5);"
},
{
"DocComment": ""
},
{
"DocComment": " let v: Vec<i32> = five_fives.collect();"
},
{
"DocComment": ""
},
{
"DocComment": " assert_eq!(v, vec![5, 5, 5, 5, 5]);"
},
{
"DocComment": " ```"
},
{
"DocComment": ""
},
{
"DocComment": " Using [`FromIterator::from_iter()`] as a more readable alternative to"
},
{
"DocComment": " [`Iterator::collect()`]:"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " use std::collections::VecDeque;"
},
{
"DocComment": " let first = (0..10).collect::<VecDeque<i32>>();"
},
{
"DocComment": " let second = VecDeque::from_iter(0..10);"
},
{
"DocComment": ""
},
{
"DocComment": " assert_eq!(first, second);"
},
{
"DocComment": " ```"
},
{
"DocComment": ""
},
{
"DocComment": " Implementing `FromIterator` for your type:"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " // A sample collection, that's just a wrapper over Vec<T>"
},
{
"DocComment": " #[derive(Debug)]"
},
{
"DocComment": " struct MyCollection(Vec<i32>);"
},
{
"DocComment": ""
},
{
"DocComment": " // Let's give it some methods so we can create one and add things"
},
{
"DocComment": " // to it."
},
{
"DocComment": " impl MyCollection {"
},
{
"DocComment": " fn new() -> MyCollection {"
},
{
"DocComment": " MyCollection(Vec::new())"
},
{
"DocComment": " }"
},
{
"DocComment": ""
},
{
"DocComment": " fn add(&mut self, elem: i32) {"
},
{
"DocComment": " self.0.push(elem);"
},
{
"DocComment": " }"
},
{
"DocComment": " }"
},
{
"DocComment": ""
},
{
"DocComment": " // and we'll implement FromIterator"
},
{
"DocComment": " impl FromIterator<i32> for MyCollection {"
},
{
"DocComment": " fn from_iter<I: IntoIterator<Item=i32>>(iter: I) -> Self {"
},
{
"DocComment": " let mut c = MyCollection::new();"
},
{
"DocComment": ""
},
{
"DocComment": " for i in iter {"
},
{
"DocComment": " c.add(i);"
},
{
"DocComment": " }"
},
{
"DocComment": ""
},
{
"DocComment": " c"
},
{
"DocComment": " }"
},
{
"DocComment": " }"
},
{
"DocComment": ""
},
{
"DocComment": " // Now we can make a new iterator..."
},
{
"DocComment": " let iter = (0..5).into_iter();"
},
{
"DocComment": ""
},
{
"DocComment": " // ... and make a MyCollection out of it"
},
{
"DocComment": " let c = MyCollection::from_iter(iter);"
},
{
"DocComment": ""
},
{
"DocComment": " assert_eq!(c.0, vec![0, 1, 2, 3, 4]);"
},
{
"DocComment": ""
},
{
"DocComment": " // collect works too!"
},
{
"DocComment": ""
},
{
"DocComment": " let iter = (0..5).into_iter();"
},
{
"DocComment": " let c: MyCollection = iter.collect();"
},
{
"DocComment": ""
},
{
"DocComment": " assert_eq!(c.0, vec![0, 1, 2, 3, 4]);"
},
{
"DocComment": " ```"
},
{
"Unknown": {
"path": "rustc_on_unimplemented",
"args": "on(_Self = \"&[{A}]\", message =\n\"a slice of type `{Self}` cannot be built since we need to store the elements somewhere\",\nlabel = \"try explicitly collecting into a `Vec<{A}>`\",),\non(all(A = \"{integer}\", any(_Self = \"&[{integral}]\",)), message =\n\"a slice of type `{Self}` cannot be built since we need to store the elements somewhere\",\nlabel = \"try explicitly collecting into a `Vec<{A}>`\",),\non(_Self = \"[{A}]\", message =\n\"a slice of type `{Self}` cannot be built since `{Self}` has no definite size\",\nlabel = \"try explicitly collecting into a `Vec<{A}>`\",),\non(all(A = \"{integer}\", any(_Self = \"[{integral}]\",)), message =\n\"a slice of type `{Self}` cannot be built since `{Self}` has no definite size\",\nlabel = \"try explicitly collecting into a `Vec<{A}>`\",),\non(_Self = \"[{A}; _]\", message =\n\"an array of type `{Self}` cannot be built directly from an iterator\", label =\n\"try collecting into a `Vec<{A}>`, then using `.try_into()`\",),\non(all(A = \"{integer}\", any(_Self = \"[{integral}; _]\",)), message =\n\"an array of type `{Self}` cannot be built directly from an iterator\", label =\n\"try collecting into a `Vec<{A}>`, then using `.try_into()`\",), message =\n\"a value of type `{Self}` cannot be built from an iterator \\\n over elements of type `{A}`\",\nlabel =\n\"value of type `{Self}` cannot be built from `std::iter::Iterator<Item={A}>`\""
}
},
{
"Unknown": {
"path": "rustc_diagnostic_item",
"args": null
}
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": "FromIterator"
},
"generics": {
"regions": [],
"types": [
{
"index": 0,
"name": "Self"
},
{
"index": 1,
"name": "A"
}
],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"parent_clauses": [
{
"clause_id": 0,
"span": {
"span": {
"file_id": 9,
"beg": {
"line": 134,
"col": 27
},
"end": {
"line": 134,
"col": 32
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnTrait",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
},
{
"clause_id": 1,
"span": {
"span": {
"file_id": 9,
"beg": {
"line": 134,
"col": 23
},
"end": {
"line": 134,
"col": 24
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnTrait",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 1
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"consts": [],
"const_defaults": {},
"types": [],
"type_defaults": {},
"type_clauses": [],
"methods": [
[
"from_iter",
{
"params": {
"regions": [],
"types": [
{
"index": 0,
"name": "T"
}
],
"const_generics": [],
"trait_clauses": [
{
"clause_id": 0,
"span": {
"span": {
"file_id": 9,
"beg": {
"line": 152,
"col": 17
},
"end": {
"line": 152,
"col": 18
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnFn",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Bound": [
1,
0
]
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
},
{
"clause_id": 1,
"span": {
"span": {
"file_id": 9,
"beg": {
"line": 152,
"col": 20
},
"end": {
"line": 152,
"col": 42
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnFn",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 2,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Bound": [
1,
0
]
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 2
}
}
}
}
}
}
],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": [
{
"regions": [],
"skip_binder": {
"trait_ref": {
"kind": {
"Clause": {
"Bound": [
1,
1
]
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 2,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Bound": [
2,
0
]
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 2
}
}
}
}
}
},
"type_name": "Item",
"ty": {
"TypeVar": {
"Free": 1
}
}
}
}
]
},
"skip_binder": {
"id": 110,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
},
{
"TypeVar": {
"Free": 1
}
},
{
"TypeVar": {
"Bound": [
0,
0
]
}
}
],
"const_generics": [],
"trait_refs": [
{
"kind": {
"Clause": {
"Bound": [
0,
0
]
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Bound": [
1,
0
]
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
},
{
"kind": {
"Clause": {
"Bound": [
0,
1
]
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 2,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Bound": [
1,
0
]
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 2
}
}
}
}
}
}
],
"target": {
"Item": {
"Fun": 110
}
}
}
},
"kind": {
"TraitMethod": [
7,
"from_iter"
]
}
}
]
]
},
{
"def_id": 8,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"ops",
0
]
},
{
"Ident": [
"try_trait",
0
]
},
{
"Ident": [
"Try",
0
]
}
],
"span": {
"span": {
"file_id": 21,
"beg": {
"line": 131,
"col": 0
},
"end": {
"line": 131,
"col": 27
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " The `?` operator and `try {}` blocks."
},
{
"DocComment": ""
},
{
"DocComment": " `try_*` methods typically involve a type implementing this trait. For"
},
{
"DocComment": " example, the closures passed to [`Iterator::try_fold`] and"
},
{
"DocComment": " [`Iterator::try_for_each`] must return such a type."
},
{
"DocComment": ""
},
{
"DocComment": " `Try` types are typically those containing two or more categories of values,"
},
{
"DocComment": " some subset of which are so commonly handled via early returns that it's"
},
{
"DocComment": " worth providing a terse (but still visible) syntax to make that easy."
},
{
"DocComment": ""
},
{
"DocComment": " This is most often seen for error handling with [`Result`] and [`Option`]."
},
{
"DocComment": " The quintessential implementation of this trait is on [`ControlFlow`]."
},
{
"DocComment": ""
},
{
"DocComment": " # Using `Try` in Generic Code"
},
{
"DocComment": ""
},
{
"DocComment": " `Iterator::try_fold` was stabilized to call back in Rust 1.27, but"
},
{
"DocComment": " this trait is much newer. To illustrate the various associated types and"
},
{
"DocComment": " methods, let's implement our own version."
},
{
"DocComment": ""
},
{
"DocComment": " As a reminder, an infallible version of a fold looks something like this:"
},
{
"DocComment": " ```"
},
{
"DocComment": " fn simple_fold<A, T>("
},
{
"DocComment": " iter: impl Iterator<Item = T>,"
},
{
"DocComment": " mut accum: A,"
},
{
"DocComment": " mut f: impl FnMut(A, T) -> A,"
},
{
"DocComment": " ) -> A {"
},
{
"DocComment": " for x in iter {"
},
{
"DocComment": " accum = f(accum, x);"
},
{
"DocComment": " }"
},
{
"DocComment": " accum"
},
{
"DocComment": " }"
},
{
"DocComment": " ```"
},
{
"DocComment": ""
},
{
"DocComment": " So instead of `f` returning just an `A`, we'll need it to return some other"
},
{
"DocComment": " type that produces an `A` in the \"don't short circuit\" path. Conveniently,"
},
{
"DocComment": " that's also the type we need to return from the function."
},
{
"DocComment": ""
},
{
"DocComment": " Let's add a new generic parameter `R` for that type, and bound it to the"
},
{
"DocComment": " output type that we want:"
},
{
"DocComment": " ```"
},
{
"DocComment": " # #![feature(try_trait_v2)]"
},
{
"DocComment": " # use std::ops::Try;"
},
{
"DocComment": " fn simple_try_fold_1<A, T, R: Try<Output = A>>("
},
{
"DocComment": " iter: impl Iterator<Item = T>,"
},
{
"DocComment": " mut accum: A,"
},
{
"DocComment": " mut f: impl FnMut(A, T) -> R,"
},
{
"DocComment": " ) -> R {"
},
{
"DocComment": " todo!()"
},
{
"DocComment": " }"
},
{
"DocComment": " ```"
},
{
"DocComment": ""
},
{
"DocComment": " If we get through the entire iterator, we need to wrap up the accumulator"
},
{
"DocComment": " into the return type using [`Try::from_output`]:"
},
{
"DocComment": " ```"
},
{
"DocComment": " # #![feature(try_trait_v2)]"
},
{
"DocComment": " # use std::ops::{ControlFlow, Try};"
},
{
"DocComment": " fn simple_try_fold_2<A, T, R: Try<Output = A>>("
},
{
"DocComment": " iter: impl Iterator<Item = T>,"
},
{
"DocComment": " mut accum: A,"
},
{
"DocComment": " mut f: impl FnMut(A, T) -> R,"
},
{
"DocComment": " ) -> R {"
},
{
"DocComment": " for x in iter {"
},
{
"DocComment": " let cf = f(accum, x).branch();"
},
{
"DocComment": " match cf {"
},
{
"DocComment": " ControlFlow::Continue(a) => accum = a,"
},
{
"DocComment": " ControlFlow::Break(_) => todo!(),"
},
{
"DocComment": " }"
},
{
"DocComment": " }"
},
{
"DocComment": " R::from_output(accum)"
},
{
"DocComment": " }"
},
{
"DocComment": " ```"
},
{
"DocComment": ""
},
{
"DocComment": " We'll also need [`FromResidual::from_residual`] to turn the residual back"
},
{
"DocComment": " into the original type. But because it's a supertrait of `Try`, we don't"
},
{
"DocComment": " need to mention it in the bounds. All types which implement `Try` can be"
},
{
"DocComment": " recreated from their corresponding residual, so we'll just call it:"
},
{
"DocComment": " ```"
},
{
"DocComment": " # #![feature(try_trait_v2)]"
},
{
"DocComment": " # use std::ops::{ControlFlow, Try};"
},
{
"DocComment": " pub fn simple_try_fold_3<A, T, R: Try<Output = A>>("
},
{
"DocComment": " iter: impl Iterator<Item = T>,"
},
{
"DocComment": " mut accum: A,"
},
{
"DocComment": " mut f: impl FnMut(A, T) -> R,"
},
{
"DocComment": " ) -> R {"
},
{
"DocComment": " for x in iter {"
},
{
"DocComment": " let cf = f(accum, x).branch();"
},
{
"DocComment": " match cf {"
},
{
"DocComment": " ControlFlow::Continue(a) => accum = a,"
},
{
"DocComment": " ControlFlow::Break(r) => return R::from_residual(r),"
},
{
"DocComment": " }"
},
{
"DocComment": " }"
},
{
"DocComment": " R::from_output(accum)"
},
{
"DocComment": " }"
},
{
"DocComment": " ```"
},
{
"DocComment": ""
},
{
"DocComment": " But this \"call `branch`, then `match` on it, and `return` if it was a"
},
{
"DocComment": " `Break`\" is exactly what happens inside the `?` operator. So rather than"
},
{
"DocComment": " do all this manually, we can just use `?` instead:"
},
{
"DocComment": " ```"
},
{
"DocComment": " # #![feature(try_trait_v2)]"
},
{
"DocComment": " # use std::ops::Try;"
},
{
"DocComment": " fn simple_try_fold<A, T, R: Try<Output = A>>("
},
{
"DocComment": " iter: impl Iterator<Item = T>,"
},
{
"DocComment": " mut accum: A,"
},
{
"DocComment": " mut f: impl FnMut(A, T) -> R,"
},
{
"DocComment": " ) -> R {"
},
{
"DocComment": " for x in iter {"
},
{
"DocComment": " accum = f(accum, x)?;"
},
{
"DocComment": " }"
},
{
"DocComment": " R::from_output(accum)"
},
{
"DocComment": " }"
},
{
"DocComment": " ```"
},
{
"Unknown": {
"path": "rustc_on_unimplemented",
"args": "on(all(from_desugaring = \"TryBlock\"), message =\n\"a `try` block must return `Result` or `Option` \\\n (or another type that implements `{Try}`)\",\nlabel =\n\"could not wrap the final value of the block as `{Self}` doesn't implement `Try`\",),\non(all(from_desugaring = \"QuestionMark\"), message =\n\"the `?` operator can only be applied to values that implement `{Try}`\", label\n= \"the `?` operator cannot be applied to type `{Self}`\")"
}
},
{
"Unknown": {
"path": "doc",
"args": "alias = \"?\""
}
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": "Try"
},
"generics": {
"regions": [],
"types": [
{
"index": 0,
"name": "Self"
}
],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"parent_clauses": [
{
"clause_id": 0,
"span": {
"span": {
"file_id": 21,
"beg": {
"line": 131,
"col": 15
},
"end": {
"line": 131,
"col": 27
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnTrait",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 23,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
},
{
"TraitType": [
{
"kind": "SelfId",
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 8,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 8
}
}
}
}
}
},
"Residual"
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 23
}
}
}
}
}
},
{
"clause_id": 1,
"span": {
"span": {
"file_id": 21,
"beg": {
"line": 134,
"col": 4
},
"end": {
"line": 134,
"col": 16
}
},
"generated_from_span": null
},
"origin": {
"TraitItem": "Output"
},
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TraitType": [
{
"kind": "SelfId",
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 8,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 8
}
}
}
}
}
},
"Output"
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
},
{
"clause_id": 2,
"span": {
"span": {
"file_id": 21,
"beg": {
"line": 158,
"col": 4
},
"end": {
"line": 158,
"col": 18
}
},
"generated_from_span": null
},
"origin": {
"TraitItem": "Residual"
},
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TraitType": [
{
"kind": "SelfId",
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 8,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 8
}
}
}
}
}
},
"Residual"
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"consts": [],
"const_defaults": {},
"types": [
"Output",
"Residual"
],
"type_defaults": {},
"type_clauses": [],
"methods": [
[
"from_output",
{
"params": {
"regions": [],
"types": [],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"skip_binder": {
"id": 104,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Fun": 104
}
}
}
},
"kind": {
"TraitMethod": [
8,
"from_output"
]
}
}
],
[
"branch",
{
"params": {
"regions": [],
"types": [],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"skip_binder": {
"id": 105,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Fun": 105
}
}
}
},
"kind": {
"TraitMethod": [
8,
"branch"
]
}
}
]
]
},
{
"def_id": 9,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"ops",
0
]
},
{
"Ident": [
"try_trait",
0
]
},
{
"Ident": [
"Residual",
0
]
}
],
"span": {
"span": {
"file_id": 21,
"beg": {
"line": 360,
"col": 0
},
"end": {
"line": 360,
"col": 21
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " Allows retrieving the canonical type implementing [`Try`] that has this type"
},
{
"DocComment": " as its residual and allows it to hold an `O` as its output."
},
{
"DocComment": ""
},
{
"DocComment": " If you think of the `Try` trait as splitting a type into its [`Try::Output`]"
},
{
"DocComment": " and [`Try::Residual`] components, this allows putting them back together."
},
{
"DocComment": ""
},
{
"DocComment": " For example,"
},
{
"DocComment": " `Result<T, E>: Try<Output = T, Residual = Result<Infallible, E>>`,"
},
{
"DocComment": " and in the other direction,"
},
{
"DocComment": " `<Result<Infallible, E> as Residual<T>>::TryType = Result<T, E>`."
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": null
},
"generics": {
"regions": [],
"types": [
{
"index": 0,
"name": "Self"
},
{
"index": 1,
"name": "O"
}
],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": [
{
"regions": [],
"skip_binder": {
"trait_ref": {
"kind": {
"ParentClause": [
"SelfId",
9,
2
]
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 8,
"generics": {
"regions": [],
"types": [
{
"TraitType": [
{
"kind": "SelfId",
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 9,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
},
{
"TypeVar": {
"Free": 1
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 9
}
}
}
}
}
},
"TryType"
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 8
}
}
}
}
}
},
"type_name": "Output",
"ty": {
"TypeVar": {
"Free": 1
}
}
}
},
{
"regions": [],
"skip_binder": {
"trait_ref": {
"kind": {
"ParentClause": [
"SelfId",
9,
2
]
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 8,
"generics": {
"regions": [],
"types": [
{
"TraitType": [
{
"kind": "SelfId",
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 9,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
},
{
"TypeVar": {
"Free": 1
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 9
}
}
}
}
}
},
"TryType"
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 8
}
}
}
}
}
},
"type_name": "Residual",
"ty": {
"TypeVar": {
"Free": 0
}
}
}
}
]
},
"parent_clauses": [
{
"clause_id": 0,
"span": {
"span": {
"file_id": 21,
"beg": {
"line": 360,
"col": 19
},
"end": {
"line": 360,
"col": 20
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnTrait",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 1
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
},
{
"clause_id": 1,
"span": {
"span": {
"file_id": 21,
"beg": {
"line": 363,
"col": 4
},
"end": {
"line": 363,
"col": 51
}
},
"generated_from_span": null
},
"origin": {
"TraitItem": "TryType"
},
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TraitType": [
{
"kind": "SelfId",
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 9,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
},
{
"TypeVar": {
"Free": 1
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 9
}
}
}
}
}
},
"TryType"
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
},
{
"clause_id": 2,
"span": {
"span": {
"file_id": 21,
"beg": {
"line": 363,
"col": 18
},
"end": {
"line": 363,
"col": 50
}
},
"generated_from_span": null
},
"origin": {
"TraitItem": "TryType"
},
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 8,
"generics": {
"regions": [],
"types": [
{
"TraitType": [
{
"kind": "SelfId",
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 9,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
},
{
"TypeVar": {
"Free": 1
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 9
}
}
}
}
}
},
"TryType"
]
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 8
}
}
}
}
}
}
],
"consts": [],
"const_defaults": {},
"types": [
"TryType"
],
"type_defaults": {},
"type_clauses": [],
"methods": []
},
{
"def_id": 10,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"collect",
0
]
},
{
"Ident": [
"Extend",
0
]
}
],
"span": {
"span": {
"file_id": 9,
"beg": {
"line": 397,
"col": 0
},
"end": {
"line": 397,
"col": 19
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " Extend a collection with the contents of an iterator."
},
{
"DocComment": ""
},
{
"DocComment": " Iterators produce a series of values, and collections can also be thought"
},
{
"DocComment": " of as a series of values. The `Extend` trait bridges this gap, allowing you"
},
{
"DocComment": " to extend a collection by including the contents of that iterator. When"
},
{
"DocComment": " extending a collection with an already existing key, that entry is updated"
},
{
"DocComment": " or, in the case of collections that permit multiple entries with equal"
},
{
"DocComment": " keys, that entry is inserted."
},
{
"DocComment": ""
},
{
"DocComment": " # Examples"
},
{
"DocComment": ""
},
{
"DocComment": " Basic usage:"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " // You can extend a String with some chars:"
},
{
"DocComment": " let mut message = String::from(\"The first three letters are: \");"
},
{
"DocComment": ""
},
{
"DocComment": " message.extend(&['a', 'b', 'c']);"
},
{
"DocComment": ""
},
{
"DocComment": " assert_eq!(\"abc\", &message[29..32]);"
},
{
"DocComment": " ```"
},
{
"DocComment": ""
},
{
"DocComment": " Implementing `Extend`:"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " // A sample collection, that's just a wrapper over Vec<T>"
},
{
"DocComment": " #[derive(Debug)]"
},
{
"DocComment": " struct MyCollection(Vec<i32>);"
},
{
"DocComment": ""
},
{
"DocComment": " // Let's give it some methods so we can create one and add things"
},
{
"DocComment": " // to it."
},
{
"DocComment": " impl MyCollection {"
},
{
"DocComment": " fn new() -> MyCollection {"
},
{
"DocComment": " MyCollection(Vec::new())"
},
{
"DocComment": " }"
},
{
"DocComment": ""
},
{
"DocComment": " fn add(&mut self, elem: i32) {"
},
{
"DocComment": " self.0.push(elem);"
},
{
"DocComment": " }"
},
{
"DocComment": " }"
},
{
"DocComment": ""
},
{
"DocComment": " // since MyCollection has a list of i32s, we implement Extend for i32"
},
{
"DocComment": " impl Extend<i32> for MyCollection {"
},
{
"DocComment": ""
},
{
"DocComment": " // This is a bit simpler with the concrete type signature: we can call"
},
{
"DocComment": " // extend on anything which can be turned into an Iterator which gives"
},
{
"DocComment": " // us i32s. Because we need i32s to put into MyCollection."
},
{
"DocComment": " fn extend<T: IntoIterator<Item=i32>>(&mut self, iter: T) {"
},
{
"DocComment": ""
},
{
"DocComment": " // The implementation is very straightforward: loop through the"
},
{
"DocComment": " // iterator, and add() each element to ourselves."
},
{
"DocComment": " for elem in iter {"
},
{
"DocComment": " self.add(elem);"
},
{
"DocComment": " }"
},
{
"DocComment": " }"
},
{
"DocComment": " }"
},
{
"DocComment": ""
},
{
"DocComment": " let mut c = MyCollection::new();"
},
{
"DocComment": ""
},
{
"DocComment": " c.add(5);"
},
{
"DocComment": " c.add(6);"
},
{
"DocComment": " c.add(7);"
},
{
"DocComment": ""
},
{
"DocComment": " // let's extend our collection with three more numbers"
},
{
"DocComment": " c.extend(vec![1, 2, 3]);"
},
{
"DocComment": ""
},
{
"DocComment": " // we've added these elements onto the end"
},
{
"DocComment": " assert_eq!(\"MyCollection([5, 6, 7, 1, 2, 3])\", format!(\"{c:?}\"));"
},
{
"DocComment": " ```"
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": null
},
"generics": {
"regions": [],
"types": [
{
"index": 0,
"name": "Self"
},
{
"index": 1,
"name": "A"
}
],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"parent_clauses": [
{
"clause_id": 0,
"span": {
"span": {
"file_id": 9,
"beg": {
"line": 397,
"col": 17
},
"end": {
"line": 397,
"col": 18
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnTrait",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 1
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"consts": [],
"const_defaults": {},
"types": [],
"type_defaults": {},
"type_clauses": [],
"methods": [
[
"extend",
{
"params": {
"regions": [
{
"index": 0,
"name": null
}
],
"types": [
{
"index": 0,
"name": "T"
}
],
"const_generics": [],
"trait_clauses": [
{
"clause_id": 0,
"span": {
"span": {
"file_id": 9,
"beg": {
"line": 416,
"col": 14
},
"end": {
"line": 416,
"col": 15
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnFn",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Bound": [
1,
0
]
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
},
{
"clause_id": 1,
"span": {
"span": {
"file_id": 9,
"beg": {
"line": 416,
"col": 17
},
"end": {
"line": 416,
"col": 39
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnFn",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 2,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Bound": [
1,
0
]
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 2
}
}
}
}
}
}
],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": [
{
"regions": [],
"skip_binder": {
"trait_ref": {
"kind": {
"Clause": {
"Bound": [
1,
1
]
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 2,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Bound": [
2,
0
]
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 2
}
}
}
}
}
},
"type_name": "Item",
"ty": {
"TypeVar": {
"Free": 1
}
}
}
}
]
},
"skip_binder": {
"id": 111,
"generics": {
"regions": [
{
"Var": {
"Bound": [
0,
0
]
}
}
],
"types": [
{
"TypeVar": {
"Free": 0
}
},
{
"TypeVar": {
"Free": 1
}
},
{
"TypeVar": {
"Bound": [
0,
0
]
}
}
],
"const_generics": [],
"trait_refs": [
{
"kind": {
"Clause": {
"Bound": [
0,
0
]
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Bound": [
1,
0
]
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
},
{
"kind": {
"Clause": {
"Bound": [
0,
1
]
}
},
"trait_decl_ref": {
"regions": [],
"skip_binder": {
"trait_id": 2,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Bound": [
1,
0
]
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 2
}
}
}
}
}
}
],
"target": {
"Item": {
"Fun": 111
}
}
}
},
"kind": {
"TraitMethod": [
10,
"extend"
]
}
}
]
]
},
{
"def_id": 11,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"default",
0
]
},
{
"Ident": [
"Default",
0
]
}
],
"span": {
"span": {
"file_id": 22,
"beg": {
"line": 107,
"col": 0
},
"end": {
"line": 107,
"col": 24
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " A trait for giving a type a useful default value."
},
{
"DocComment": ""
},
{
"DocComment": " Sometimes, you want to fall back to some kind of default value, and"
},
{
"DocComment": " don't particularly care what it is. This comes up often with `struct`s"
},
{
"DocComment": " that define a set of options:"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " # #[allow(dead_code)]"
},
{
"DocComment": " struct SomeOptions {"
},
{
"DocComment": " foo: i32,"
},
{
"DocComment": " bar: f32,"
},
{
"DocComment": " }"
},
{
"DocComment": " ```"
},
{
"DocComment": ""
},
{
"DocComment": " How can we define some default values? You can use `Default`:"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " # #[allow(dead_code)]"
},
{
"DocComment": " #[derive(Default)]"
},
{
"DocComment": " struct SomeOptions {"
},
{
"DocComment": " foo: i32,"
},
{
"DocComment": " bar: f32,"
},
{
"DocComment": " }"
},
{
"DocComment": ""
},
{
"DocComment": " fn main() {"
},
{
"DocComment": " let options: SomeOptions = Default::default();"
},
{
"DocComment": " }"
},
{
"DocComment": " ```"
},
{
"DocComment": ""
},
{
"DocComment": " Now, you get all of the default values. Rust implements `Default` for various primitives types."
},
{
"DocComment": ""
},
{
"DocComment": " If you want to override a particular option, but still retain the other defaults:"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " # #[allow(dead_code)]"
},
{
"DocComment": " # #[derive(Default)]"
},
{
"DocComment": " # struct SomeOptions {"
},
{
"DocComment": " # foo: i32,"
},
{
"DocComment": " # bar: f32,"
},
{
"DocComment": " # }"
},
{
"DocComment": " fn main() {"
},
{
"DocComment": " let options = SomeOptions { foo: 42, ..Default::default() };"
},
{
"DocComment": " }"
},
{
"DocComment": " ```"
},
{
"DocComment": ""
},
{
"DocComment": " ## Derivable"
},
{
"DocComment": ""
},
{
"DocComment": " This trait can be used with `#[derive]` if all of the type's fields implement"
},
{
"DocComment": " `Default`. When `derive`d, it will use the default value for each field's type."
},
{
"DocComment": ""
},
{
"DocComment": " ### `enum`s"
},
{
"DocComment": ""
},
{
"DocComment": " When using `#[derive(Default)]` on an `enum`, you need to choose which unit variant will be"
},
{
"DocComment": " default. You do this by placing the `#[default]` attribute on the variant."
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " #[derive(Default)]"
},
{
"DocComment": " enum Kind {"
},
{
"DocComment": " #[default]"
},
{
"DocComment": " A,"
},
{
"DocComment": " B,"
},
{
"DocComment": " C,"
},
{
"DocComment": " }"
},
{
"DocComment": " ```"
},
{
"DocComment": ""
},
{
"DocComment": " You cannot use the `#[default]` attribute on non-unit or non-exhaustive variants."
},
{
"DocComment": ""
},
{
"DocComment": " The `#[default]` attribute was stabilized in Rust 1.62.0."
},
{
"DocComment": ""
},
{
"DocComment": " ## How can I implement `Default`?"
},
{
"DocComment": ""
},
{
"DocComment": " Provide an implementation for the `default()` method that returns the value of"
},
{
"DocComment": " your type that should be the default:"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " # #![allow(dead_code)]"
},
{
"DocComment": " enum Kind {"
},
{
"DocComment": " A,"
},
{
"DocComment": " B,"
},
{
"DocComment": " C,"
},
{
"DocComment": " }"
},
{
"DocComment": ""
},
{
"DocComment": " impl Default for Kind {"
},
{
"DocComment": " fn default() -> Self { Kind::A }"
},
{
"DocComment": " }"
},
{
"DocComment": " ```"
},
{
"DocComment": ""
},
{
"DocComment": " # Examples"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " # #[allow(dead_code)]"
},
{
"DocComment": " #[derive(Default)]"
},
{
"DocComment": " struct SomeOptions {"
},
{
"DocComment": " foo: i32,"
},
{
"DocComment": " bar: f32,"
},
{
"DocComment": " }"
},
{
"DocComment": " ```"
},
{
"Unknown": {
"path": "rustc_diagnostic_item",
"args": null
}
},
{
"Unknown": {
"path": "rustc_trivial_field_reads",
"args": null
}
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": "Default"
},
"generics": {
"regions": [],
"types": [
{
"index": 0,
"name": "Self"
}
],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"parent_clauses": [
{
"clause_id": 0,
"span": {
"span": {
"file_id": 22,
"beg": {
"line": 107,
"col": 19
},
"end": {
"line": 107,
"col": 24
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnTrait",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 0,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 0
}
}
}
}
}
}
],
"consts": [],
"const_defaults": {},
"types": [],
"type_defaults": {},
"type_clauses": [],
"methods": [
[
"default",
{
"params": {
"regions": [],
"types": [],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"skip_binder": {
"id": 101,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Fun": 101
}
}
}
},
"kind": {
"TraitMethod": [
11,
"default"
]
}
}
]
]
},
{
"def_id": 12,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"double_ended",
0
]
},
{
"Ident": [
"DoubleEndedIterator",
0
]
}
],
"span": {
"span": {
"file_id": 23,
"beg": {
"line": 41,
"col": 0
},
"end": {
"line": 41,
"col": 39
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " An iterator able to yield elements from both ends."
},
{
"DocComment": ""
},
{
"DocComment": " Something that implements `DoubleEndedIterator` has one extra capability"
},
{
"DocComment": " over something that implements [`Iterator`]: the ability to also take"
},
{
"DocComment": " `Item`s from the back, as well as the front."
},
{
"DocComment": ""
},
{
"DocComment": " It is important to note that both back and forth work on the same range,"
},
{
"DocComment": " and do not cross: iteration is over when they meet in the middle."
},
{
"DocComment": ""
},
{
"DocComment": " In a similar fashion to the [`Iterator`] protocol, once a"
},
{
"DocComment": " `DoubleEndedIterator` returns [`None`] from a [`next_back()`], calling it"
},
{
"DocComment": " again may or may not ever return [`Some`] again. [`next()`] and"
},
{
"DocComment": " [`next_back()`] are interchangeable for this purpose."
},
{
"DocComment": ""
},
{
"DocComment": " [`next_back()`]: DoubleEndedIterator::next_back"
},
{
"DocComment": " [`next()`]: Iterator::next"
},
{
"DocComment": ""
},
{
"DocComment": " # Examples"
},
{
"DocComment": ""
},
{
"DocComment": " Basic usage:"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " let numbers = vec![1, 2, 3, 4, 5, 6];"
},
{
"DocComment": ""
},
{
"DocComment": " let mut iter = numbers.iter();"
},
{
"DocComment": ""
},
{
"DocComment": " assert_eq!(Some(&1), iter.next());"
},
{
"DocComment": " assert_eq!(Some(&6), iter.next_back());"
},
{
"DocComment": " assert_eq!(Some(&5), iter.next_back());"
},
{
"DocComment": " assert_eq!(Some(&2), iter.next());"
},
{
"DocComment": " assert_eq!(Some(&3), iter.next());"
},
{
"DocComment": " assert_eq!(Some(&4), iter.next());"
},
{
"DocComment": " assert_eq!(None, iter.next());"
},
{
"DocComment": " assert_eq!(None, iter.next_back());"
},
{
"DocComment": " ```"
},
{
"Unknown": {
"path": "rustc_diagnostic_item",
"args": null
}
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": "DoubleEndedIterator"
},
"generics": {
"regions": [],
"types": [
{
"index": 0,
"name": "Self"
}
],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"parent_clauses": [
{
"clause_id": 0,
"span": {
"span": {
"file_id": 23,
"beg": {
"line": 41,
"col": 31
},
"end": {
"line": 41,
"col": 39
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnTrait",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 3,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 3
}
}
}
}
}
}
],
"consts": [],
"const_defaults": {},
"types": [],
"type_defaults": {},
"type_clauses": [],
"methods": [
[
"next_back",
{
"params": {
"regions": [
{
"index": 0,
"name": null
}
],
"types": [],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"skip_binder": {
"id": 115,
"generics": {
"regions": [
{
"Var": {
"Bound": [
0,
0
]
}
}
],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"Fun": 115
}
}
}
},
"kind": {
"TraitMethod": [
12,
"next_back"
]
}
}
]
]
},
{
"def_id": 13,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"iter",
0
]
},
{
"Ident": [
"traits",
0
]
},
{
"Ident": [
"exact_size",
0
]
},
{
"Ident": [
"ExactSizeIterator",
0
]
}
],
"span": {
"span": {
"file_id": 24,
"beg": {
"line": 86,
"col": 0
},
"end": {
"line": 86,
"col": 37
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " An iterator that knows its exact length."
},
{
"DocComment": ""
},
{
"DocComment": " Many [`Iterator`]s don't know how many times they will iterate, but some do."
},
{
"DocComment": " If an iterator knows how many times it can iterate, providing access to"
},
{
"DocComment": " that information can be useful. For example, if you want to iterate"
},
{
"DocComment": " backwards, a good start is to know where the end is."
},
{
"DocComment": ""
},
{
"DocComment": " When implementing an `ExactSizeIterator`, you must also implement"
},
{
"DocComment": " [`Iterator`]. When doing so, the implementation of [`Iterator::size_hint`]"
},
{
"DocComment": " *must* return the exact size of the iterator."
},
{
"DocComment": ""
},
{
"DocComment": " The [`len`] method has a default implementation, so you usually shouldn't"
},
{
"DocComment": " implement it. However, you may be able to provide a more performant"
},
{
"DocComment": " implementation than the default, so overriding it in this case makes sense."
},
{
"DocComment": ""
},
{
"DocComment": " Note that this trait is a safe trait and as such does *not* and *cannot*"
},
{
"DocComment": " guarantee that the returned length is correct. This means that `unsafe`"
},
{
"DocComment": " code **must not** rely on the correctness of [`Iterator::size_hint`]. The"
},
{
"DocComment": " unstable and unsafe [`TrustedLen`](super::marker::TrustedLen) trait gives"
},
{
"DocComment": " this additional guarantee."
},
{
"DocComment": ""
},
{
"DocComment": " [`len`]: ExactSizeIterator::len"
},
{
"DocComment": ""
},
{
"DocComment": " # When *shouldn't* an adapter be `ExactSizeIterator`?"
},
{
"DocComment": ""
},
{
"DocComment": " If an adapter makes an iterator *longer*, then it's usually incorrect for"
},
{
"DocComment": " that adapter to implement `ExactSizeIterator`. The inner exact-sized"
},
{
"DocComment": " iterator might already be `usize::MAX`-long, and thus the length of the"
},
{
"DocComment": " longer adapted iterator would no longer be exactly representable in `usize`."
},
{
"DocComment": ""
},
{
"DocComment": " This is why [`Chain<A, B>`](crate::iter::Chain) isn't `ExactSizeIterator`,"
},
{
"DocComment": " even when `A` and `B` are both `ExactSizeIterator`."
},
{
"DocComment": ""
},
{
"DocComment": " # Examples"
},
{
"DocComment": ""
},
{
"DocComment": " Basic usage:"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " // a finite range knows exactly how many times it will iterate"
},
{
"DocComment": " let five = 0..5;"
},
{
"DocComment": ""
},
{
"DocComment": " assert_eq!(5, five.len());"
},
{
"DocComment": " ```"
},
{
"DocComment": ""
},
{
"DocComment": " In the [module-level docs], we implemented an [`Iterator`], `Counter`."
},
{
"DocComment": " Let's implement `ExactSizeIterator` for it as well:"
},
{
"DocComment": ""
},
{
"DocComment": " [module-level docs]: crate::iter"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " # struct Counter {"
},
{
"DocComment": " # count: usize,"
},
{
"DocComment": " # }"
},
{
"DocComment": " # impl Counter {"
},
{
"DocComment": " # fn new() -> Counter {"
},
{
"DocComment": " # Counter { count: 0 }"
},
{
"DocComment": " # }"
},
{
"DocComment": " # }"
},
{
"DocComment": " # impl Iterator for Counter {"
},
{
"DocComment": " # type Item = usize;"
},
{
"DocComment": " # fn next(&mut self) -> Option<Self::Item> {"
},
{
"DocComment": " # self.count += 1;"
},
{
"DocComment": " # if self.count < 6 {"
},
{
"DocComment": " # Some(self.count)"
},
{
"DocComment": " # } else {"
},
{
"DocComment": " # None"
},
{
"DocComment": " # }"
},
{
"DocComment": " # }"
},
{
"DocComment": " # }"
},
{
"DocComment": " impl ExactSizeIterator for Counter {"
},
{
"DocComment": " // We can easily calculate the remaining number of iterations."
},
{
"DocComment": " fn len(&self) -> usize {"
},
{
"DocComment": " 5 - self.count"
},
{
"DocComment": " }"
},
{
"DocComment": " }"
},
{
"DocComment": ""
},
{
"DocComment": " // And now we can use it!"
},
{
"DocComment": ""
},
{
"DocComment": " let mut counter = Counter::new();"
},
{
"DocComment": ""
},
{
"DocComment": " assert_eq!(5, counter.len());"
},
{
"DocComment": " let _ = counter.next();"
},
{
"DocComment": " assert_eq!(4, counter.len());"
},
{
"DocComment": " ```"
}
],
"inline": null,
"rename": null,
"public": true
},
"is_local": false,
"opacity": "Foreign",
"lang_item": null
},
"generics": {
"regions": [],
"types": [
{
"index": 0,
"name": "Self"
}
],
"const_generics": [],
"trait_clauses": [],
"regions_outlive": [],
"types_outlive": [],
"trait_type_constraints": []
},
"parent_clauses": [
{
"clause_id": 0,
"span": {
"span": {
"file_id": 24,
"beg": {
"line": 86,
"col": 29
},
"end": {
"line": 86,
"col": 37
}
},
"generated_from_span": null
},
"origin": "WhereClauseOnTrait",
"trait_": {
"regions": [],
"skip_binder": {
"trait_id": 3,
"generics": {
"regions": [],
"types": [
{
"TypeVar": {
"Free": 0
}
}
],
"const_generics": [],
"trait_refs": [],
"target": {
"Item": {
"TraitDecl": 3
}
}
}
}
}
}
],
"consts": [],
"const_defaults": {},
"types": [],
"type_defaults": {},
"type_clauses": [],
"methods": []
},
{
"def_id": 14,
"item_meta": {
"name": [
{
"Ident": [
"core",
0
]
},
{
"Ident": [
"cmp",
0
]
},
{
"Ident": [
"Ord",
0
]
}
],
"span": {
"span": {
"file_id": 25,
"beg": {
"line": 957,
"col": 0
},
"end": {
"line": 957,
"col": 36
}
},
"generated_from_span": null
},
"source_text": null,
"attr_info": {
"attributes": [
{
"DocComment": " Trait for types that form a [total order](https://en.wikipedia.org/wiki/Total_order)."
},
{
"DocComment": ""
},
{
"DocComment": " Implementations must be consistent with the [`PartialOrd`] implementation, and ensure `max`,"
},
{
"DocComment": " `min`, and `clamp` are consistent with `cmp`:"
},
{
"DocComment": ""
},
{
"DocComment": " - `partial_cmp(a, b) == Some(cmp(a, b))`."
},
{
"DocComment": " - `max(a, b) == max_by(a, b, cmp)` (ensured by the default implementation)."
},
{
"DocComment": " - `min(a, b) == min_by(a, b, cmp)` (ensured by the default implementation)."
},
{
"DocComment": " - For `a.clamp(min, max)`, see the [method docs](#method.clamp) (ensured by the default"
},
{
"DocComment": " implementation)."
},
{
"DocComment": ""
},
{
"DocComment": " Violating these requirements is a logic error. The behavior resulting from a logic error is not"
},
{
"DocComment": " specified, but users of the trait must ensure that such logic errors do *not* result in"
},
{
"DocComment": " undefined behavior. This means that `unsafe` code **must not** rely on the correctness of these"
},
{
"DocComment": " methods."
},
{
"DocComment": ""
},
{
"DocComment": " ## Corollaries"
},
{
"DocComment": ""
},
{
"DocComment": " From the above and the requirements of `PartialOrd`, it follows that for all `a`, `b` and `c`:"
},
{
"DocComment": ""
},
{
"DocComment": " - exactly one of `a < b`, `a == b` or `a > b` is true; and"
},
{
"DocComment": " - `<` is transitive: `a < b` and `b < c` implies `a < c`. The same must hold for both `==` and"
},
{
"DocComment": " `>`."
},
{
"DocComment": ""
},
{
"DocComment": " Mathematically speaking, the `<` operator defines a strict [weak order]. In cases where `==`"
},
{
"DocComment": " conforms to mathematical equality, it also defines a strict [total order]."
},
{
"DocComment": ""
},
{
"DocComment": " [weak order]: https://en.wikipedia.org/wiki/Weak_ordering"
},
{
"DocComment": " [total order]: https://en.wikipedia.org/wiki/Total_order"
},
{
"DocComment": ""
},
{
"DocComment": " ## Derivable"
},
{
"DocComment": ""
},
{
"DocComment": " This trait can be used with `#[derive]`."
},
{
"DocComment": ""
},
{
"DocComment": " When `derive`d on structs, it will produce a"
},
{
"DocComment": " [lexicographic](https://en.wikipedia.org/wiki/Lexicographic_order) ordering based on the"
},
{
"DocComment": " top-to-bottom declaration order of the struct's members."
},
{
"DocComment": ""
},
{
"DocComment": " When `derive`d on enums, variants are ordered primarily by their discriminants. Secondarily,"
},
{
"DocComment": " they are ordered by their fields. By default, the discriminant is smallest for variants at the"
},
{
"DocComment": " top, and largest for variants at the bottom. Here's an example:"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " #[derive(PartialEq, Eq, PartialOrd, Ord)]"
},
{
"DocComment": " enum E {"
},
{
"DocComment": " Top,"
},
{
"DocComment": " Bottom,"
},
{
"DocComment": " }"
},
{
"DocComment": ""
},
{
"DocComment": " assert!(E::Top < E::Bottom);"
},
{
"DocComment": " ```"
},
{
"DocComment": ""
},
{
"DocComment": " However, manually setting the discriminants can override this default behavior:"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " #[derive(PartialEq, Eq, PartialOrd, Ord)]"
},
{
"DocComment": " enum E {"
},
{
"DocComment": " Top = 2,"
},
{
"DocComment": " Bottom = 1,"
},
{
"DocComment": " }"
},
{
"DocComment": ""
},
{
"DocComment": " assert!(E::Bottom < E::Top);"
},
{
"DocComment": " ```"
},
{
"DocComment": ""
},
{
"DocComment": " ## Lexicographical comparison"
},
{
"DocComment": ""
},
{
"DocComment": " Lexicographical comparison is an operation with the following properties:"
},
{
"DocComment": " - Two sequences are compared element by element."
},
{
"DocComment": " - The first mismatching element defines which sequence is lexicographically less or greater"
},
{
"DocComment": " than the other."
},
{
"DocComment": " - If one sequence is a prefix of another, the shorter sequence is lexicographically less than"
},
{
"DocComment": " the other."
},
{
"DocComment": " - If two sequences have equivalent elements and are of the same length, then the sequences are"
},
{
"DocComment": " lexicographically equal."
},
{
"DocComment": " - An empty sequence is lexicographically less than any non-empty sequence."
},
{
"DocComment": " - Two empty sequences are lexicographically equal."
},
{
"DocComment": ""
},
{
"DocComment": " ## How can I implement `Ord`?"
},
{
"DocComment": ""
},
{
"DocComment": " `Ord` requires that the type also be [`PartialOrd`], [`PartialEq`], and [`Eq`]."
},
{
"DocComment": ""
},
{
"DocComment": " Because `Ord` implies a stronger ordering relationship than [`PartialOrd`], and both `Ord` and"
},
{
"DocComment": " [`PartialOrd`] must agree, you must choose how to implement `Ord` **first**. You can choose to"
},
{
"DocComment": " derive it, or implement it manually. If you derive it, you should derive all four traits. If you"
},
{
"DocComment": " implement it manually, you should manually implement all four traits, based on the"
},
{
"DocComment": " implementation of `Ord`."
},
{
"DocComment": ""
},
{
"DocComment": " Here's an example where you want to define the `Character` comparison by `health` and"
},
{
"DocComment": " `experience` only, disregarding the field `mana`:"
},
{
"DocComment": ""
},
{
"DocComment": " ```"
},
{
"DocComment": " use std::cmp::Ordering;"
},
{
"DocComment": ""
},
{
"DocComment": " struct Character {"
},
{
"DocComment": " health: u32,"
},
{
"DocComment": " experience: u32,"
},
{
"DocComment": " mana: f32,"
},
{
"DocComment": " }"
},
{
"DocComment": ""
},
{
"DocComment": " impl Ord for Character {"
},
{
"DocComment": " fn cmp(&self, other: &Self) -> Ordering {"
},
{
"DocComment": " self.experience"
},
{
"DocComment": " .cmp(&other.experience)"
},
{
"DocComment": " .then(self.health.cmp(&other.health))"
},
{
"DocComment": " }"
},
{
"DocComment": " }"
},
{
"DocComment": ""
},
{
"Do
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment