New Rust
This commit is contained in:
		
							
								
								
									
										
											BIN
										
									
								
								Common-Use/hashmap.exe
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Common-Use/hashmap.exe
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Common-Use/hashmap.pdb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Common-Use/hashmap.pdb
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										26
									
								
								Common-Use/hashmap.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								Common-Use/hashmap.rs
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,26 @@
 | 
			
		||||
use std::collections::HashMap;
 | 
			
		||||
 | 
			
		||||
fn thereisnoerror() {
 | 
			
		||||
    let mut map = std::collections::HashMap::new();
 | 
			
		||||
    map.insert("key1", "value1");
 | 
			
		||||
    map.insert("key2", "value2");
 | 
			
		||||
    println!("{:?}", map);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
fn main(){
 | 
			
		||||
    let mut h = HashMap::new();
 | 
			
		||||
    h.insert(1, "one");
 | 
			
		||||
    h.insert(2, "two");
 | 
			
		||||
    h.insert(3, "three");
 | 
			
		||||
    h.insert(4, "four");
 | 
			
		||||
    h.insert(5, "five");
 | 
			
		||||
    print!("{:?} ", h);
 | 
			
		||||
    //println!("{0}", *h.count(4));
 | 
			
		||||
    let mut a = |y: i64| -> i64 { return 1 + y; };
 | 
			
		||||
    let result = a(3);
 | 
			
		||||
    println!("{}", result);
 | 
			
		||||
    match h.get(&4) {
 | 
			
		||||
        Some(v) => println!("Found: {}", v),
 | 
			
		||||
        None => println!("Not Found"),
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										290
									
								
								Common-Use/readme.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										290
									
								
								Common-Use/readme.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,290 @@
 | 
			
		||||
非常好的问题 👏
 | 
			
		||||
`Option<&V>` 是 Rust 中非常核心的类型之一,理解它对你掌握 **Rust 的所有权系统** 和 **安全编程哲学** 都至关重要。
 | 
			
		||||
我们来一步步深入讲清楚,从原理到底层实现、再到各种用法与技巧。
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
# 🧩 一、什么是 `Option<T>`
 | 
			
		||||
 | 
			
		||||
## ✅ 定义
 | 
			
		||||
 | 
			
		||||
`Option<T>` 是一个**枚举类型**,定义在标准库中:
 | 
			
		||||
 | 
			
		||||
```rust
 | 
			
		||||
enum Option<T> {
 | 
			
		||||
    Some(T),
 | 
			
		||||
    None,
 | 
			
		||||
}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
也就是说,它是一个「可能有值,也可能没有值」的容器。
 | 
			
		||||
 | 
			
		||||
* `Some(T)` 表示存在一个值;
 | 
			
		||||
* `None` 表示值不存在。
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
## 🧠 为什么要有 `Option<T>`
 | 
			
		||||
 | 
			
		||||
在很多语言(如 C/C++、Java)中,缺失值通常用 `NULL` 或 `None`,但容易出错。
 | 
			
		||||
Rust 用 `Option<T>` 代替「空指针」,**在类型层面上强制你处理缺失的情况**。
 | 
			
		||||
这样编译器就能帮你防止空指针错误(`null pointer dereference`)。
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
# 🔍 二、`Option<&V>` 是什么?
 | 
			
		||||
 | 
			
		||||
在 `HashMap::get()` 等函数中,你会看到返回类型是:
 | 
			
		||||
 | 
			
		||||
```rust
 | 
			
		||||
Option<&V>
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
意思是:
 | 
			
		||||
 | 
			
		||||
> “可能返回一个指向值 `V` 的引用,如果 key 不存在,则返回 None。”
 | 
			
		||||
 | 
			
		||||
举个例子:
 | 
			
		||||
 | 
			
		||||
```rust
 | 
			
		||||
use std::collections::HashMap;
 | 
			
		||||
 | 
			
		||||
fn main() {
 | 
			
		||||
    let mut map = HashMap::new();
 | 
			
		||||
    map.insert("apple", 3);
 | 
			
		||||
 | 
			
		||||
    let v1 = map.get("apple"); // Some(&3)
 | 
			
		||||
    let v2 = map.get("banana"); // None
 | 
			
		||||
 | 
			
		||||
    println!("{:?} {:?}", v1, v2);
 | 
			
		||||
}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
输出:
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
Some(3) None
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
# 🧩 三、匹配(模式匹配)方式
 | 
			
		||||
 | 
			
		||||
最常见的处理方式是 **match**:
 | 
			
		||||
 | 
			
		||||
```rust
 | 
			
		||||
match map.get("apple") {
 | 
			
		||||
    Some(value) => println!("Found: {}", value),
 | 
			
		||||
    None => println!("Not found"),
 | 
			
		||||
}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
这种写法非常直观,但略显冗长,于是 Rust 提供了更优雅的写法👇
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
# ⚙️ 四、常见用法大全
 | 
			
		||||
 | 
			
		||||
## 1️⃣ `is_some()` / `is_none()`
 | 
			
		||||
 | 
			
		||||
判断是否存在值:
 | 
			
		||||
 | 
			
		||||
```rust
 | 
			
		||||
if map.get("apple").is_some() {
 | 
			
		||||
    println!("存在 apple");
 | 
			
		||||
}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
## 2️⃣ `unwrap()` / `unwrap_or()` / `unwrap_or_default()`
 | 
			
		||||
 | 
			
		||||
提取值:
 | 
			
		||||
 | 
			
		||||
```rust
 | 
			
		||||
let v = map.get("apple").unwrap();          // 若 None 则 panic!
 | 
			
		||||
let v = map.get("apple").unwrap_or(&0);     // 若 None 则返回 &0
 | 
			
		||||
let v = map.get("apple").unwrap_or_default(); // 若 None 则返回默认值
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
> ⚠️ 不建议随意使用 `unwrap()`,除非你确信一定有值。
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
## 3️⃣ `if let` 简写匹配
 | 
			
		||||
 | 
			
		||||
```rust
 | 
			
		||||
if let Some(v) = map.get("apple") {
 | 
			
		||||
    println!("数量: {}", v);
 | 
			
		||||
}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
比 `match` 简洁,常用于只关心 `Some` 的情况。
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
## 4️⃣ `map()` —— 映射转换
 | 
			
		||||
 | 
			
		||||
`map()` 能把 `Option` 内的值加工成另一个类型:
 | 
			
		||||
 | 
			
		||||
```rust
 | 
			
		||||
let length = map.get("apple").map(|v| v * 2);
 | 
			
		||||
println!("{:?}", length); // Some(6)
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
若为 `None`,则结果仍是 `None`。
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
## 5️⃣ `and_then()` —— 链式调用
 | 
			
		||||
 | 
			
		||||
用于多层 Option 嵌套场景:
 | 
			
		||||
 | 
			
		||||
```rust
 | 
			
		||||
let result = map.get("apple")
 | 
			
		||||
                .and_then(|v| Some(v * 10))
 | 
			
		||||
                .and_then(|x| Some(x + 1));
 | 
			
		||||
println!("{:?}", result); // Some(31)
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
## 6️⃣ `unwrap_or_else()` —— 延迟计算默认值
 | 
			
		||||
 | 
			
		||||
```rust
 | 
			
		||||
let v = map.get("banana").unwrap_or_else(|| {
 | 
			
		||||
    println!("key 不存在,使用默认值");
 | 
			
		||||
    &0
 | 
			
		||||
});
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
如果 key 不存在,执行闭包生成默认值。
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
## 7️⃣ `as_ref()` / `as_mut()`
 | 
			
		||||
 | 
			
		||||
将 `Option<T>` 转换为 `Option<&T>` 或 `Option<&mut T>`:
 | 
			
		||||
 | 
			
		||||
```rust
 | 
			
		||||
let opt = Some(String::from("hi"));
 | 
			
		||||
let ref_opt = opt.as_ref();    // Option<&String>
 | 
			
		||||
let mut_opt = opt.as_ref();    // Option<&mut String>
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
这在借用时非常实用,尤其是嵌套结构。
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
## 8️⃣ `expect()` —— 自定义 panic 信息
 | 
			
		||||
 | 
			
		||||
```rust
 | 
			
		||||
let v = map.get("apple").expect("apple 不存在!");
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
如果是 `None`,会 panic 并显示 `"apple 不存在!"`。
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
## 9️⃣ `copied()` / `cloned()`
 | 
			
		||||
 | 
			
		||||
如果你要从 `Option<&T>` 提取出 `Option<T>`(复制/克隆),可以这样:
 | 
			
		||||
 | 
			
		||||
```rust
 | 
			
		||||
let map = HashMap::from([("a", 10)]);
 | 
			
		||||
let val = map.get("a").copied(); // Option<i32>
 | 
			
		||||
println!("{:?}", val);           // Some(10)
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
区别:
 | 
			
		||||
 | 
			
		||||
* `.copied()` 要求 `T: Copy`
 | 
			
		||||
* `.cloned()` 要求 `T: Clone`
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
## 🔟 `unwrap_or_default()`
 | 
			
		||||
 | 
			
		||||
对简单类型(如 `i32`、`bool`)非常方便:
 | 
			
		||||
 | 
			
		||||
```rust
 | 
			
		||||
let map = HashMap::new();
 | 
			
		||||
let v: i32 = *map.get("x").unwrap_or_default(); // None -> 默认0
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
# 🧠 五、内部机制(零成本抽象)
 | 
			
		||||
 | 
			
		||||
Rust 的 `Option<T>` 在底层通常会被 **编译器优化为“无额外开销”** 的形式。
 | 
			
		||||
 | 
			
		||||
举个例子:
 | 
			
		||||
`Option<&T>` 通常和 `*const T` 的大小完全一样。
 | 
			
		||||
因为:
 | 
			
		||||
 | 
			
		||||
* `None` 会用空指针 `0` 表示;
 | 
			
		||||
* `Some(x)` 则用非零指针。
 | 
			
		||||
 | 
			
		||||
所以:
 | 
			
		||||
 | 
			
		||||
```rust
 | 
			
		||||
std::mem::size_of::<Option<&i32>>() == std::mem::size_of::<&i32>()
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
✅ 成立,说明 `Option<&T>` 没有额外开销。
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
# 🧩 六、总结表格
 | 
			
		||||
 | 
			
		||||
| 方法                    | 作用                               | 示例                        |   |             |
 | 
			
		||||
| --------------------- | -------------------------------- | ------------------------- | - | ----------- |
 | 
			
		||||
| `is_some()`           | 是否有值                             | `opt.is_some()`           |   |             |
 | 
			
		||||
| `is_none()`           | 是否为空                             | `opt.is_none()`           |   |             |
 | 
			
		||||
| `unwrap()`            | 直接取值(危险)                         | `opt.unwrap()`            |   |             |
 | 
			
		||||
| `unwrap_or(x)`        | 无值时返回 x                          | `opt.unwrap_or(0)`        |   |             |
 | 
			
		||||
| `unwrap_or_default()` | 无值时返回默认值                         | `opt.unwrap_or_default()` |   |             |
 | 
			
		||||
| `unwrap_or_else(f)`   | 无值时调用函数生成                        | `opt.unwrap_or_else(      |   | 0)`         |
 | 
			
		||||
| `expect(msg)`         | 无值时 panic,带信息                    | `opt.expect("错误")`        |   |             |
 | 
			
		||||
| `map(f)`              | 处理 Some 中的值                      | `opt.map(                 | x | x+1)`       |
 | 
			
		||||
| `and_then(f)`         | 链式 Option 处理                     | `opt.and_then(            | x | Some(x+1))` |
 | 
			
		||||
| `as_ref()`            | 转换为 Option<&T>                   | `opt.as_ref()`            |   |             |
 | 
			
		||||
| `as_mut()`            | 转换为 Option<&mut T>               | `opt.as_mut()`            |   |             |
 | 
			
		||||
| `copied()`            | Option<&T> → Option<T>(T: Copy)  | `opt.copied()`            |   |             |
 | 
			
		||||
| `cloned()`            | Option<&T> → Option<T>(T: Clone) | `opt.cloned()`            |   |             |
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
# 🔚 七、一个综合示例
 | 
			
		||||
 | 
			
		||||
```rust
 | 
			
		||||
use std::collections::HashMap;
 | 
			
		||||
 | 
			
		||||
fn main() {
 | 
			
		||||
    let mut scores = HashMap::new();
 | 
			
		||||
    scores.insert("Alice", 90);
 | 
			
		||||
    scores.insert("Bob", 85);
 | 
			
		||||
 | 
			
		||||
    let name = "Charlie";
 | 
			
		||||
    let score = scores.get(name)
 | 
			
		||||
                      .copied()               // Option<i32>
 | 
			
		||||
                      .unwrap_or_else(|| {
 | 
			
		||||
                          println!("{name} 不存在,使用默认分数");
 | 
			
		||||
                          60
 | 
			
		||||
                      });
 | 
			
		||||
 | 
			
		||||
    println!("{name} 的分数是 {score}");
 | 
			
		||||
}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
输出:
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
Charlie 不存在,使用默认分数
 | 
			
		||||
Charlie 的分数是 60
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
是否希望我接着帮你画一张「`Option<T>` 方法调用关系图(功能导图)」?
 | 
			
		||||
那张图能直观看出各种方法如何互相转换,非常适合记忆和快速查阅。
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								Common-Use/vec.exe
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Common-Use/vec.exe
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Common-Use/vec.pdb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Common-Use/vec.pdb
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										18
									
								
								Common-Use/vec.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								Common-Use/vec.rs
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,18 @@
 | 
			
		||||
fn sum(list:&Vec<i64>) -> i64 {
 | 
			
		||||
    let mut total = 0;
 | 
			
		||||
    for i in list {
 | 
			
		||||
        total += i;
 | 
			
		||||
    }
 | 
			
		||||
    total
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
fn main(){
 | 
			
		||||
    let mut v: Vec<i64> = Vec::new();
 | 
			
		||||
    v.push(1);
 | 
			
		||||
    v.push(2);
 | 
			
		||||
    v.push(3);
 | 
			
		||||
    for i in &v {
 | 
			
		||||
        println!("{}", i);
 | 
			
		||||
    }
 | 
			
		||||
    println!("Sum: {}", sum(&v));
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								Macro/macrotest.exe
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Macro/macrotest.exe
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Macro/macrotest.pdb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Macro/macrotest.pdb
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										10
									
								
								Macro/macrotest.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								Macro/macrotest.rs
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,10 @@
 | 
			
		||||
macro_rules! double_and_add_one {
 | 
			
		||||
    ($x : expr) => {
 | 
			
		||||
        $x * 2 + 1;
 | 
			
		||||
    };
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
fn main(){
 | 
			
		||||
    let result = double_and_add_one!(5);
 | 
			
		||||
    println!("Result: {}", result); // This will print "Result: 11"
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										124
									
								
								Macro/readme.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										124
									
								
								Macro/readme.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,124 @@
 | 
			
		||||
完全可以,我们来系统讲一下 `macro_rules!` 中 **宏变量匹配类型**,也就是你说的除了 `expr` 还能匹配什么。
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
## 1️⃣ 基本宏变量语法
 | 
			
		||||
 | 
			
		||||
```rust
 | 
			
		||||
$变量名:匹配类型
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
* `$` → 宏变量前缀
 | 
			
		||||
* `变量名` → 自己命名
 | 
			
		||||
* `匹配类型` → Rust 定义的一些匹配规则,告诉宏要匹配什么类型的语法单元
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
## 2️⃣ 常用匹配类型
 | 
			
		||||
 | 
			
		||||
| 匹配类型      | 描述              | 示例                                      |
 | 
			
		||||
| --------- | --------------- | --------------------------------------- |
 | 
			
		||||
| `expr`    | 表达式             | `5 + 3`, `a * b`, `func(1)`             |
 | 
			
		||||
| `ident`   | 标识符             | `x`, `my_var`                           |
 | 
			
		||||
| `ty`      | 类型              | `i32`, `Vec<String>`                    |
 | 
			
		||||
| `pat`     | 模式              | `Some(x)`, `(a, b)`                     |
 | 
			
		||||
| `stmt`    | 语句              | `let x = 1;`                            |
 | 
			
		||||
| `block`   | 代码块             | `{ let x = 1; x+2 }`                    |
 | 
			
		||||
| `meta`    | 元属性             | `derive(Debug)`                         |
 | 
			
		||||
| `tt`      | Token Tree(最通用) | 单个标记或标记组,几乎可以匹配任何东西                     |
 | 
			
		||||
| `path`    | 路径              | `std::io::Result`, `crate::module::Foo` |
 | 
			
		||||
| `literal` | 字面量             | `"hello"`, `42`, `3.14`                 |
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
### 3️⃣ 示例
 | 
			
		||||
 | 
			
		||||
#### 表达式匹配
 | 
			
		||||
 | 
			
		||||
```rust
 | 
			
		||||
macro_rules! add {
 | 
			
		||||
    ($a:expr, $b:expr) => {
 | 
			
		||||
        $a + $b
 | 
			
		||||
    };
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
let x = add!(1 + 2, 3 * 4); // 匹配复杂表达式
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
#### 类型匹配
 | 
			
		||||
 | 
			
		||||
```rust
 | 
			
		||||
macro_rules! make_default {
 | 
			
		||||
    ($t:ty) => {
 | 
			
		||||
        <$t>::default()
 | 
			
		||||
    };
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
let v: Vec<i32> = make_default!(Vec<i32>);
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
#### 标识符匹配
 | 
			
		||||
 | 
			
		||||
```rust
 | 
			
		||||
macro_rules! create_var {
 | 
			
		||||
    ($name:ident) => {
 | 
			
		||||
        let $name = 42;
 | 
			
		||||
    };
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
create_var!(my_var);
 | 
			
		||||
println!("{}", my_var); // 输出 42
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
#### 语句匹配
 | 
			
		||||
 | 
			
		||||
```rust
 | 
			
		||||
macro_rules! repeat_stmt {
 | 
			
		||||
    ($s:stmt) => {
 | 
			
		||||
        $s
 | 
			
		||||
        $s
 | 
			
		||||
    };
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
repeat_stmt!(println!("Hi");) // 会打印两次 Hi
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
#### 代码块匹配
 | 
			
		||||
 | 
			
		||||
```rust
 | 
			
		||||
macro_rules! run_block {
 | 
			
		||||
    ($b:block) => {
 | 
			
		||||
        println!("Before");
 | 
			
		||||
        $b
 | 
			
		||||
        println!("After");
 | 
			
		||||
    };
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
run_block!({
 | 
			
		||||
    println!("Inside");
 | 
			
		||||
});
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
输出:
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
Before
 | 
			
		||||
Inside
 | 
			
		||||
After
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
### 4️⃣ 小结
 | 
			
		||||
 | 
			
		||||
* `expr` 只能匹配表达式
 | 
			
		||||
* Rust 宏提供了多种匹配类型(`ident`, `ty`, `pat`, `stmt`, `block`, `literal`, `tt` 等)
 | 
			
		||||
* `tt` 最通用,但匹配后需要自己处理结构
 | 
			
		||||
 | 
			
		||||
> 可以理解为:**每个匹配类型限制了宏能匹配的语法单元**,避免写宏时乱匹配或产生歧义
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
我可以画一张 **macro_rules! 匹配类型示意图**,把 `expr, ident, ty, pat, stmt, block, tt, literal` 的对应语法单元和示例都标出来,一目了然。
 | 
			
		||||
 | 
			
		||||
你希望我画吗?
 | 
			
		||||
							
								
								
									
										7
									
								
								Package-Crate/cratetest/Cargo.lock
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								Package-Crate/cratetest/Cargo.lock
									
									
									
										generated
									
									
									
										Normal file
									
								
							@@ -0,0 +1,7 @@
 | 
			
		||||
# This file is automatically @generated by Cargo.
 | 
			
		||||
# It is not intended for manual editing.
 | 
			
		||||
version = 4
 | 
			
		||||
 | 
			
		||||
[[package]]
 | 
			
		||||
name = "cratetest"
 | 
			
		||||
version = "0.1.0"
 | 
			
		||||
							
								
								
									
										6
									
								
								Package-Crate/cratetest/Cargo.toml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								Package-Crate/cratetest/Cargo.toml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,6 @@
 | 
			
		||||
[package]
 | 
			
		||||
name = "cratetest"
 | 
			
		||||
version = "0.1.0"
 | 
			
		||||
edition = "2024"
 | 
			
		||||
 | 
			
		||||
[dependencies]
 | 
			
		||||
							
								
								
									
										0
									
								
								Package-Crate/cratetest/src/lib.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								Package-Crate/cratetest/src/lib.rs
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										6
									
								
								Package-Crate/cratetest/src/main.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								Package-Crate/cratetest/src/main.rs
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,6 @@
 | 
			
		||||
mod student;
 | 
			
		||||
fn main() {
 | 
			
		||||
    let s = student::monitor::check::check_num::Container::init_auto(1, String::from("Alice"), 20, 95.5);
 | 
			
		||||
    student::monitor::check::check_score::score(s);
 | 
			
		||||
    println!("Hello, world!");
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										2
									
								
								Package-Crate/cratetest/src/student/mod.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								Package-Crate/cratetest/src/student/mod.rs
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,2 @@
 | 
			
		||||
pub mod ordinary;
 | 
			
		||||
pub mod monitor;
 | 
			
		||||
							
								
								
									
										50
									
								
								Package-Crate/cratetest/src/student/monitor.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										50
									
								
								Package-Crate/cratetest/src/student/monitor.rs
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,50 @@
 | 
			
		||||
pub mod check{
 | 
			
		||||
    pub mod check_num{
 | 
			
		||||
        pub const MAX_NUM:i64 = 120; //check中且不能改
 | 
			
		||||
        pub static mut NUM:i64 = 30; //必须用unsafe
 | 
			
		||||
        //比较好的方法是用一个结构体存
 | 
			
		||||
        pub struct Container{
 | 
			
		||||
            num: i64,
 | 
			
		||||
            name: String,
 | 
			
		||||
            age: i64,
 | 
			
		||||
            score: f64
 | 
			
		||||
        }
 | 
			
		||||
        impl Container  {
 | 
			
		||||
            pub fn init_self(&mut self, num_:i64, name_:String, age_:i64, score_:f64){
 | 
			
		||||
                self.num = num_;
 | 
			
		||||
                self.name = name_;
 | 
			
		||||
                self.age = age_;
 | 
			
		||||
                self.score = score_;
 | 
			
		||||
            }
 | 
			
		||||
            pub fn init_auto(num:i64, name:String, age:i64, score:f64) -> Self {
 | 
			
		||||
                return Self { num, name, age, score };
 | 
			
		||||
            }
 | 
			
		||||
            pub fn num(&self) -> i64{
 | 
			
		||||
                return self.num;
 | 
			
		||||
            }
 | 
			
		||||
            pub fn score_rt(&self) -> f64 {
 | 
			
		||||
                return self.score;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        pub fn max_num() -> i64{
 | 
			
		||||
            return MAX_NUM;
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
    }
 | 
			
		||||
    pub mod check_score{
 | 
			
		||||
        use crate::student::monitor::check::check_num::Container;
 | 
			
		||||
        pub fn score(c:Container){
 | 
			
		||||
            println!("Score is {0}", c.score_rt());
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
pub mod alarm{
 | 
			
		||||
    pub fn not_allowed(){
 | 
			
		||||
        println!("This Action is Not Allowed");
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
pub mod unite{
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										14
									
								
								Package-Crate/cratetest/src/student/ordinary.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								Package-Crate/cratetest/src/student/ordinary.rs
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,14 @@
 | 
			
		||||
pub mod biology{
 | 
			
		||||
    pub struct Info{
 | 
			
		||||
        word: String,
 | 
			
		||||
        num: i64
 | 
			
		||||
    }
 | 
			
		||||
    impl Info{
 | 
			
		||||
        pub fn init(&self, word: String, num: i64) -> Self {
 | 
			
		||||
            Self { word, num }
 | 
			
		||||
        }
 | 
			
		||||
        pub fn getinfo(&self){
 | 
			
		||||
            println!("My name is {0}, I have number {1}", self.word, self.num);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										1
									
								
								Package-Crate/cratetest/target/.rustc_info.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								Package-Crate/cratetest/target/.rustc_info.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
{"rustc_fingerprint":10462622210688861186,"outputs":{"7971740275564407648":{"success":true,"status":"","code":0,"stdout":"___.exe\nlib___.rlib\n___.dll\n___.dll\n___.lib\n___.dll\nC:\\Users\\huaji\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\npacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"msvc\"\ntarget_family=\"windows\"\ntarget_feature=\"cmpxchg16b\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_feature=\"sse3\"\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"windows\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"pc\"\nwindows\n","stderr":""},"17747080675513052775":{"success":true,"status":"","code":0,"stdout":"rustc 1.89.0 (29483883e 2025-08-04)\nbinary: rustc\ncommit-hash: 29483883eed69d5fb4db01964cdf2af4d86e9cb2\ncommit-date: 2025-08-04\nhost: x86_64-pc-windows-msvc\nrelease: 1.89.0\nLLVM version: 20.1.7\n","stderr":""}},"successes":{}}
 | 
			
		||||
							
								
								
									
										3
									
								
								Package-Crate/cratetest/target/CACHEDIR.TAG
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								Package-Crate/cratetest/target/CACHEDIR.TAG
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
			
		||||
Signature: 8a477f597d28d172789f06886806bc55
 | 
			
		||||
# This file is a cache directory tag created by cargo.
 | 
			
		||||
# For information about cache directory tags see https://bford.info/cachedir/
 | 
			
		||||
							
								
								
									
										0
									
								
								Package-Crate/cratetest/target/debug/.cargo-lock
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								Package-Crate/cratetest/target/debug/.cargo-lock
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
This file has an mtime of when this was started.
 | 
			
		||||
@@ -0,0 +1,9 @@
 | 
			
		||||
{"$message_type":"diagnostic","message":"struct `Info` is never constructed","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src\\student\\ordinary.rs","byte_start":33,"byte_end":37,"line_start":2,"line_end":2,"column_start":16,"column_end":20,"is_primary":true,"text":[{"text":"    pub struct Info{","highlight_start":16,"highlight_end":20}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`#[warn(dead_code)]` on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: struct `Info` is never constructed\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\student\\ordinary.rs:2:16\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m2\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m    pub struct Info{\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m                \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^^\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m= \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15mnote\u001b[0m\u001b[0m: `#[warn(dead_code)]` on by default\u001b[0m\n\n"}
 | 
			
		||||
{"$message_type":"diagnostic","message":"methods `init` and `getinfo` are never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src\\student\\ordinary.rs","byte_start":92,"byte_end":101,"line_start":6,"line_end":6,"column_start":5,"column_end":14,"is_primary":false,"text":[{"text":"    impl Info{","highlight_start":5,"highlight_end":14}],"label":"methods in this implementation","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src\\student\\ordinary.rs","byte_start":119,"byte_end":123,"line_start":7,"line_end":7,"column_start":16,"column_end":20,"is_primary":true,"text":[{"text":"        pub fn init(&self, word: String, num: i64) -> Self {","highlight_start":16,"highlight_end":20}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src\\student\\ordinary.rs","byte_start":224,"byte_end":231,"line_start":10,"line_end":10,"column_start":16,"column_end":23,"is_primary":true,"text":[{"text":"        pub fn getinfo(&self){","highlight_start":16,"highlight_end":23}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: methods `init` and `getinfo` are never used\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\student\\ordinary.rs:7:16\u001b[0m\n\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m6\u001b[0m\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m    impl Info{\u001b[0m\n\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m     \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m---------\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14mmethods in this implementation\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m7\u001b[0m\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m        pub fn init(&self, word: String, num: i64) -> Self {\u001b[0m\n\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m                \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^^\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m...\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m10\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m        pub fn getinfo(&self){\u001b[0m\n\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m                \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^^^^^\u001b[0m\n\n"}
 | 
			
		||||
{"$message_type":"diagnostic","message":"constant `MAX_NUM` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src\\student\\monitor.rs","byte_start":58,"byte_end":65,"line_start":3,"line_end":3,"column_start":19,"column_end":26,"is_primary":true,"text":[{"text":"        pub const MAX_NUM:i64 = 120; //check中且不能改","highlight_start":19,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: constant `MAX_NUM` is never used\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\student\\monitor.rs:3:19\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m3\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m        pub const MAX_NUM:i64 = 120; //check中且不能改\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m                   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^^^^^\u001b[0m\n\n"}
 | 
			
		||||
{"$message_type":"diagnostic","message":"static `NUM` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src\\student\\monitor.rs","byte_start":124,"byte_end":127,"line_start":4,"line_end":4,"column_start":24,"column_end":27,"is_primary":true,"text":[{"text":"        pub static mut NUM:i64 = 30; //必须用unsafe","highlight_start":24,"highlight_end":27}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: static `NUM` is never used\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\student\\monitor.rs:4:24\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m4\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m        pub static mut NUM:i64 = 30; //必须用unsafe\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m                        \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^\u001b[0m\n\n"}
 | 
			
		||||
{"$message_type":"diagnostic","message":"fields `num`, `name`, and `age` are never read","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src\\student\\monitor.rs","byte_start":230,"byte_end":239,"line_start":6,"line_end":6,"column_start":20,"column_end":29,"is_primary":false,"text":[{"text":"        pub struct Container{","highlight_start":20,"highlight_end":29}],"label":"fields in this struct","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src\\student\\monitor.rs","byte_start":254,"byte_end":257,"line_start":7,"line_end":7,"column_start":13,"column_end":16,"is_primary":true,"text":[{"text":"            num: i64,","highlight_start":13,"highlight_end":16}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src\\student\\monitor.rs","byte_start":277,"byte_end":281,"line_start":8,"line_end":8,"column_start":13,"column_end":17,"is_primary":true,"text":[{"text":"            name: String,","highlight_start":13,"highlight_end":17}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src\\student\\monitor.rs","byte_start":304,"byte_end":307,"line_start":9,"line_end":9,"column_start":13,"column_end":16,"is_primary":true,"text":[{"text":"            age: i64,","highlight_start":13,"highlight_end":16}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: fields `num`, `name`, and `age` are never read\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\student\\monitor.rs:7:13\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m6\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m        pub struct Container{\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m                    \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m---------\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14mfields in this struct\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m7\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m            num: i64,\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m             \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m8\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m            name: String,\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m             \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^^\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m9\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m            age: i64,\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m             \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^\u001b[0m\n\n"}
 | 
			
		||||
{"$message_type":"diagnostic","message":"methods `init_self` and `num` are never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src\\student\\monitor.rs","byte_start":358,"byte_end":372,"line_start":12,"line_end":12,"column_start":9,"column_end":23,"is_primary":false,"text":[{"text":"        impl Container  {","highlight_start":9,"highlight_end":23}],"label":"methods in this implementation","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src\\student\\monitor.rs","byte_start":396,"byte_end":405,"line_start":13,"line_end":13,"column_start":20,"column_end":29,"is_primary":true,"text":[{"text":"            pub fn init_self(&mut self, num_:i64, name_:String, age_:i64, score_:f64){","highlight_start":20,"highlight_end":29}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src\\student\\monitor.rs","byte_start":794,"byte_end":797,"line_start":22,"line_end":22,"column_start":20,"column_end":23,"is_primary":true,"text":[{"text":"            pub fn num(&self) -> i64{","highlight_start":20,"highlight_end":23}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: methods `init_self` and `num` are never used\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\student\\monitor.rs:13:20\u001b[0m\n\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m12\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m        impl Container  {\u001b[0m\n\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m         \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--------------\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14mmethods in this implementation\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m13\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m            pub fn init_self(&mut self, num_:i64, name_:String, age_:i64, score_:f64){\u001b[0m\n\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m                    \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^^^^^^^\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m...\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m22\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m            pub fn num(&self) -> i64{\u001b[0m\n\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m                    \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^\u001b[0m\n\n"}
 | 
			
		||||
{"$message_type":"diagnostic","message":"function `max_num` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src\\student\\monitor.rs","byte_start":985,"byte_end":992,"line_start":29,"line_end":29,"column_start":16,"column_end":23,"is_primary":true,"text":[{"text":"        pub fn max_num() -> i64{","highlight_start":16,"highlight_end":23}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: function `max_num` is never used\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\student\\monitor.rs:29:16\u001b[0m\n\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m29\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m        pub fn max_num() -> i64{\u001b[0m\n\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m                \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^^^^^\u001b[0m\n\n"}
 | 
			
		||||
{"$message_type":"diagnostic","message":"function `not_allowed` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src\\student\\monitor.rs","byte_start":1293,"byte_end":1304,"line_start":43,"line_end":43,"column_start":12,"column_end":23,"is_primary":true,"text":[{"text":"    pub fn not_allowed(){","highlight_start":12,"highlight_end":23}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: function `not_allowed` is never used\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\student\\monitor.rs:43:12\u001b[0m\n\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m43\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m    pub fn not_allowed(){\u001b[0m\n\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m            \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^^^^^^^^^\u001b[0m\n\n"}
 | 
			
		||||
{"$message_type":"diagnostic","message":"8 warnings emitted","code":null,"level":"warning","spans":[],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: 8 warnings emitted\u001b[0m\n\n"}
 | 
			
		||||
@@ -0,0 +1 @@
 | 
			
		||||
c67506101aee53a5
 | 
			
		||||
@@ -0,0 +1 @@
 | 
			
		||||
{"rustc":3062648155896360161,"features":"[]","declared_features":"[]","target":15519478794282214699,"profile":3316208278650011218,"path":4942398508502643691,"deps":[[198839618041740247,"cratetest",false,18430654450331647994]],"local":[{"CheckDepInfo":{"dep_info":"debug\\.fingerprint\\cratetest-18245caf720d90fc\\dep-test-bin-cratetest","checksum":false}}],"rustflags":[],"config":2069994364910194474,"compile_kind":0}
 | 
			
		||||
@@ -0,0 +1 @@
 | 
			
		||||
589e821bb81016bc
 | 
			
		||||
@@ -0,0 +1 @@
 | 
			
		||||
{"rustc":3062648155896360161,"features":"[]","declared_features":"[]","target":15519478794282214699,"profile":8731458305071235362,"path":4942398508502643691,"deps":[[198839618041740247,"cratetest",false,18262412242635120008]],"local":[{"CheckDepInfo":{"dep_info":"debug\\.fingerprint\\cratetest-18ae1240f891c4ad\\dep-bin-cratetest","checksum":false}}],"rustflags":[],"config":2069994364910194474,"compile_kind":0}
 | 
			
		||||
										
											Binary file not shown.
										
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
This file has an mtime of when this was started.
 | 
			
		||||
@@ -0,0 +1,9 @@
 | 
			
		||||
{"$message_type":"diagnostic","message":"struct `Info` is never constructed","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src\\student\\ordinary.rs","byte_start":33,"byte_end":37,"line_start":2,"line_end":2,"column_start":16,"column_end":20,"is_primary":true,"text":[{"text":"    pub struct Info{","highlight_start":16,"highlight_end":20}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`#[warn(dead_code)]` on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: struct `Info` is never constructed\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\student\\ordinary.rs:2:16\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m2\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m    pub struct Info{\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m                \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^^\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m= \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15mnote\u001b[0m\u001b[0m: `#[warn(dead_code)]` on by default\u001b[0m\n\n"}
 | 
			
		||||
{"$message_type":"diagnostic","message":"methods `init` and `getinfo` are never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src\\student\\ordinary.rs","byte_start":92,"byte_end":101,"line_start":6,"line_end":6,"column_start":5,"column_end":14,"is_primary":false,"text":[{"text":"    impl Info{","highlight_start":5,"highlight_end":14}],"label":"methods in this implementation","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src\\student\\ordinary.rs","byte_start":119,"byte_end":123,"line_start":7,"line_end":7,"column_start":16,"column_end":20,"is_primary":true,"text":[{"text":"        pub fn init(&self, word: String, num: i64) -> Self {","highlight_start":16,"highlight_end":20}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src\\student\\ordinary.rs","byte_start":224,"byte_end":231,"line_start":10,"line_end":10,"column_start":16,"column_end":23,"is_primary":true,"text":[{"text":"        pub fn getinfo(&self){","highlight_start":16,"highlight_end":23}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: methods `init` and `getinfo` are never used\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\student\\ordinary.rs:7:16\u001b[0m\n\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m6\u001b[0m\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m    impl Info{\u001b[0m\n\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m     \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m---------\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14mmethods in this implementation\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m7\u001b[0m\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m        pub fn init(&self, word: String, num: i64) -> Self {\u001b[0m\n\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m                \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^^\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m...\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m10\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m        pub fn getinfo(&self){\u001b[0m\n\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m                \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^^^^^\u001b[0m\n\n"}
 | 
			
		||||
{"$message_type":"diagnostic","message":"constant `MAX_NUM` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src\\student\\monitor.rs","byte_start":58,"byte_end":65,"line_start":3,"line_end":3,"column_start":19,"column_end":26,"is_primary":true,"text":[{"text":"        pub const MAX_NUM:i64 = 120; //check中且不能改","highlight_start":19,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: constant `MAX_NUM` is never used\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\student\\monitor.rs:3:19\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m3\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m        pub const MAX_NUM:i64 = 120; //check中且不能改\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m                   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^^^^^\u001b[0m\n\n"}
 | 
			
		||||
{"$message_type":"diagnostic","message":"static `NUM` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src\\student\\monitor.rs","byte_start":124,"byte_end":127,"line_start":4,"line_end":4,"column_start":24,"column_end":27,"is_primary":true,"text":[{"text":"        pub static mut NUM:i64 = 30; //必须用unsafe","highlight_start":24,"highlight_end":27}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: static `NUM` is never used\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\student\\monitor.rs:4:24\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m4\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m        pub static mut NUM:i64 = 30; //必须用unsafe\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m                        \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^\u001b[0m\n\n"}
 | 
			
		||||
{"$message_type":"diagnostic","message":"fields `num`, `name`, and `age` are never read","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src\\student\\monitor.rs","byte_start":230,"byte_end":239,"line_start":6,"line_end":6,"column_start":20,"column_end":29,"is_primary":false,"text":[{"text":"        pub struct Container{","highlight_start":20,"highlight_end":29}],"label":"fields in this struct","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src\\student\\monitor.rs","byte_start":254,"byte_end":257,"line_start":7,"line_end":7,"column_start":13,"column_end":16,"is_primary":true,"text":[{"text":"            num: i64,","highlight_start":13,"highlight_end":16}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src\\student\\monitor.rs","byte_start":277,"byte_end":281,"line_start":8,"line_end":8,"column_start":13,"column_end":17,"is_primary":true,"text":[{"text":"            name: String,","highlight_start":13,"highlight_end":17}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src\\student\\monitor.rs","byte_start":304,"byte_end":307,"line_start":9,"line_end":9,"column_start":13,"column_end":16,"is_primary":true,"text":[{"text":"            age: i64,","highlight_start":13,"highlight_end":16}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: fields `num`, `name`, and `age` are never read\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\student\\monitor.rs:7:13\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m6\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m        pub struct Container{\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m                    \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m---------\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14mfields in this struct\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m7\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m            num: i64,\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m             \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m8\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m            name: String,\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m             \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^^\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m9\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m            age: i64,\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m             \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^\u001b[0m\n\n"}
 | 
			
		||||
{"$message_type":"diagnostic","message":"methods `init_self` and `num` are never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src\\student\\monitor.rs","byte_start":358,"byte_end":372,"line_start":12,"line_end":12,"column_start":9,"column_end":23,"is_primary":false,"text":[{"text":"        impl Container  {","highlight_start":9,"highlight_end":23}],"label":"methods in this implementation","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src\\student\\monitor.rs","byte_start":396,"byte_end":405,"line_start":13,"line_end":13,"column_start":20,"column_end":29,"is_primary":true,"text":[{"text":"            pub fn init_self(&mut self, num_:i64, name_:String, age_:i64, score_:f64){","highlight_start":20,"highlight_end":29}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src\\student\\monitor.rs","byte_start":794,"byte_end":797,"line_start":22,"line_end":22,"column_start":20,"column_end":23,"is_primary":true,"text":[{"text":"            pub fn num(&self) -> i64{","highlight_start":20,"highlight_end":23}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: methods `init_self` and `num` are never used\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\student\\monitor.rs:13:20\u001b[0m\n\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m12\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m        impl Container  {\u001b[0m\n\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m         \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--------------\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14mmethods in this implementation\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m13\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m            pub fn init_self(&mut self, num_:i64, name_:String, age_:i64, score_:f64){\u001b[0m\n\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m                    \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^^^^^^^\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m...\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m22\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m            pub fn num(&self) -> i64{\u001b[0m\n\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m                    \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^\u001b[0m\n\n"}
 | 
			
		||||
{"$message_type":"diagnostic","message":"function `max_num` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src\\student\\monitor.rs","byte_start":985,"byte_end":992,"line_start":29,"line_end":29,"column_start":16,"column_end":23,"is_primary":true,"text":[{"text":"        pub fn max_num() -> i64{","highlight_start":16,"highlight_end":23}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: function `max_num` is never used\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\student\\monitor.rs:29:16\u001b[0m\n\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m29\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m        pub fn max_num() -> i64{\u001b[0m\n\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m                \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^^^^^\u001b[0m\n\n"}
 | 
			
		||||
{"$message_type":"diagnostic","message":"function `not_allowed` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src\\student\\monitor.rs","byte_start":1293,"byte_end":1304,"line_start":43,"line_end":43,"column_start":12,"column_end":23,"is_primary":true,"text":[{"text":"    pub fn not_allowed(){","highlight_start":12,"highlight_end":23}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: function `not_allowed` is never used\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\student\\monitor.rs:43:12\u001b[0m\n\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m43\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m    pub fn not_allowed(){\u001b[0m\n\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m            \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^^^^^^^^^\u001b[0m\n\n"}
 | 
			
		||||
{"$message_type":"diagnostic","message":"8 warnings emitted","code":null,"level":"warning","spans":[],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: 8 warnings emitted\u001b[0m\n\n"}
 | 
			
		||||
										
											Binary file not shown.
										
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
This file has an mtime of when this was started.
 | 
			
		||||
@@ -0,0 +1 @@
 | 
			
		||||
fa7ffda192d6c6ff
 | 
			
		||||
@@ -0,0 +1 @@
 | 
			
		||||
{"rustc":3062648155896360161,"features":"[]","declared_features":"[]","target":7479634845804353691,"profile":17672942494452627365,"path":10763286916239946207,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug\\.fingerprint\\cratetest-99ce758d585dbfb5\\dep-lib-cratetest","checksum":false}}],"rustflags":[],"config":2069994364910194474,"compile_kind":0}
 | 
			
		||||
										
											Binary file not shown.
										
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
This file has an mtime of when this was started.
 | 
			
		||||
@@ -0,0 +1 @@
 | 
			
		||||
c1b1db4cf5b9bbc9
 | 
			
		||||
@@ -0,0 +1 @@
 | 
			
		||||
{"rustc":3062648155896360161,"features":"[]","declared_features":"[]","target":7479634845804353691,"profile":3316208278650011218,"path":10763286916239946207,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug\\.fingerprint\\cratetest-ad4fb1e3517573b1\\dep-test-lib-cratetest","checksum":false}}],"rustflags":[],"config":2069994364910194474,"compile_kind":0}
 | 
			
		||||
@@ -0,0 +1 @@
 | 
			
		||||
090467bb01666943
 | 
			
		||||
@@ -0,0 +1 @@
 | 
			
		||||
{"rustc":3062648155896360161,"features":"[]","declared_features":"[]","target":15519478794282214699,"profile":17672942494452627365,"path":4942398508502643691,"deps":[[198839618041740247,"cratetest",false,18430654450331647994]],"local":[{"CheckDepInfo":{"dep_info":"debug\\.fingerprint\\cratetest-d257ba26dc831c10\\dep-bin-cratetest","checksum":false}}],"rustflags":[],"config":2069994364910194474,"compile_kind":0}
 | 
			
		||||
										
											Binary file not shown.
										
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
This file has an mtime of when this was started.
 | 
			
		||||
@@ -0,0 +1,9 @@
 | 
			
		||||
{"$message_type":"diagnostic","message":"struct `Info` is never constructed","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src\\student\\ordinary.rs","byte_start":33,"byte_end":37,"line_start":2,"line_end":2,"column_start":16,"column_end":20,"is_primary":true,"text":[{"text":"    pub struct Info{","highlight_start":16,"highlight_end":20}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`#[warn(dead_code)]` on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: struct `Info` is never constructed\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\student\\ordinary.rs:2:16\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m2\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m    pub struct Info{\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m                \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^^\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m= \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15mnote\u001b[0m\u001b[0m: `#[warn(dead_code)]` on by default\u001b[0m\n\n"}
 | 
			
		||||
{"$message_type":"diagnostic","message":"methods `init` and `getinfo` are never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src\\student\\ordinary.rs","byte_start":92,"byte_end":101,"line_start":6,"line_end":6,"column_start":5,"column_end":14,"is_primary":false,"text":[{"text":"    impl Info{","highlight_start":5,"highlight_end":14}],"label":"methods in this implementation","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src\\student\\ordinary.rs","byte_start":119,"byte_end":123,"line_start":7,"line_end":7,"column_start":16,"column_end":20,"is_primary":true,"text":[{"text":"        pub fn init(&self, word: String, num: i64) -> Self {","highlight_start":16,"highlight_end":20}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src\\student\\ordinary.rs","byte_start":224,"byte_end":231,"line_start":10,"line_end":10,"column_start":16,"column_end":23,"is_primary":true,"text":[{"text":"        pub fn getinfo(&self){","highlight_start":16,"highlight_end":23}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: methods `init` and `getinfo` are never used\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\student\\ordinary.rs:7:16\u001b[0m\n\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m6\u001b[0m\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m    impl Info{\u001b[0m\n\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m     \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m---------\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14mmethods in this implementation\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m7\u001b[0m\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m        pub fn init(&self, word: String, num: i64) -> Self {\u001b[0m\n\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m                \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^^\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m...\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m10\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m        pub fn getinfo(&self){\u001b[0m\n\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m                \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^^^^^\u001b[0m\n\n"}
 | 
			
		||||
{"$message_type":"diagnostic","message":"constant `MAX_NUM` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src\\student\\monitor.rs","byte_start":58,"byte_end":65,"line_start":3,"line_end":3,"column_start":19,"column_end":26,"is_primary":true,"text":[{"text":"        pub const MAX_NUM:i64 = 120; //check中且不能改","highlight_start":19,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: constant `MAX_NUM` is never used\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\student\\monitor.rs:3:19\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m3\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m        pub const MAX_NUM:i64 = 120; //check中且不能改\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m                   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^^^^^\u001b[0m\n\n"}
 | 
			
		||||
{"$message_type":"diagnostic","message":"static `NUM` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src\\student\\monitor.rs","byte_start":124,"byte_end":127,"line_start":4,"line_end":4,"column_start":24,"column_end":27,"is_primary":true,"text":[{"text":"        pub static mut NUM:i64 = 30; //必须用unsafe","highlight_start":24,"highlight_end":27}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: static `NUM` is never used\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\student\\monitor.rs:4:24\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m4\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m        pub static mut NUM:i64 = 30; //必须用unsafe\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m                        \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^\u001b[0m\n\n"}
 | 
			
		||||
{"$message_type":"diagnostic","message":"fields `num`, `name`, and `age` are never read","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src\\student\\monitor.rs","byte_start":230,"byte_end":239,"line_start":6,"line_end":6,"column_start":20,"column_end":29,"is_primary":false,"text":[{"text":"        pub struct Container{","highlight_start":20,"highlight_end":29}],"label":"fields in this struct","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src\\student\\monitor.rs","byte_start":254,"byte_end":257,"line_start":7,"line_end":7,"column_start":13,"column_end":16,"is_primary":true,"text":[{"text":"            num: i64,","highlight_start":13,"highlight_end":16}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src\\student\\monitor.rs","byte_start":277,"byte_end":281,"line_start":8,"line_end":8,"column_start":13,"column_end":17,"is_primary":true,"text":[{"text":"            name: String,","highlight_start":13,"highlight_end":17}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src\\student\\monitor.rs","byte_start":304,"byte_end":307,"line_start":9,"line_end":9,"column_start":13,"column_end":16,"is_primary":true,"text":[{"text":"            age: i64,","highlight_start":13,"highlight_end":16}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: fields `num`, `name`, and `age` are never read\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\student\\monitor.rs:7:13\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m6\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m        pub struct Container{\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m                    \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m---------\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14mfields in this struct\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m7\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m            num: i64,\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m             \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m8\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m            name: String,\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m             \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^^\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m9\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m            age: i64,\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m             \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^\u001b[0m\n\n"}
 | 
			
		||||
{"$message_type":"diagnostic","message":"methods `init_self` and `num` are never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src\\student\\monitor.rs","byte_start":358,"byte_end":372,"line_start":12,"line_end":12,"column_start":9,"column_end":23,"is_primary":false,"text":[{"text":"        impl Container  {","highlight_start":9,"highlight_end":23}],"label":"methods in this implementation","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src\\student\\monitor.rs","byte_start":396,"byte_end":405,"line_start":13,"line_end":13,"column_start":20,"column_end":29,"is_primary":true,"text":[{"text":"            pub fn init_self(&mut self, num_:i64, name_:String, age_:i64, score_:f64){","highlight_start":20,"highlight_end":29}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src\\student\\monitor.rs","byte_start":794,"byte_end":797,"line_start":22,"line_end":22,"column_start":20,"column_end":23,"is_primary":true,"text":[{"text":"            pub fn num(&self) -> i64{","highlight_start":20,"highlight_end":23}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: methods `init_self` and `num` are never used\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\student\\monitor.rs:13:20\u001b[0m\n\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m12\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m        impl Container  {\u001b[0m\n\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m         \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--------------\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14mmethods in this implementation\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m13\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m            pub fn init_self(&mut self, num_:i64, name_:String, age_:i64, score_:f64){\u001b[0m\n\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m                    \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^^^^^^^\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m...\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m22\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m            pub fn num(&self) -> i64{\u001b[0m\n\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m                    \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^\u001b[0m\n\n"}
 | 
			
		||||
{"$message_type":"diagnostic","message":"function `max_num` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src\\student\\monitor.rs","byte_start":985,"byte_end":992,"line_start":29,"line_end":29,"column_start":16,"column_end":23,"is_primary":true,"text":[{"text":"        pub fn max_num() -> i64{","highlight_start":16,"highlight_end":23}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: function `max_num` is never used\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\student\\monitor.rs:29:16\u001b[0m\n\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m29\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m        pub fn max_num() -> i64{\u001b[0m\n\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m                \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^^^^^\u001b[0m\n\n"}
 | 
			
		||||
{"$message_type":"diagnostic","message":"function `not_allowed` is never used","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src\\student\\monitor.rs","byte_start":1293,"byte_end":1304,"line_start":43,"line_end":43,"column_start":12,"column_end":23,"is_primary":true,"text":[{"text":"    pub fn not_allowed(){","highlight_start":12,"highlight_end":23}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: function `not_allowed` is never used\u001b[0m\n\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m--> \u001b[0m\u001b[0msrc\\student\\monitor.rs:43:12\u001b[0m\n\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14m43\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m    pub fn not_allowed(){\u001b[0m\n\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m|\u001b[0m\u001b[0m            \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;11m^^^^^^^^^^^\u001b[0m\n\n"}
 | 
			
		||||
{"$message_type":"diagnostic","message":"8 warnings emitted","code":null,"level":"warning","spans":[],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;11mwarning\u001b[0m\u001b[0m\u001b[1m\u001b[38;5;15m: 8 warnings emitted\u001b[0m\n\n"}
 | 
			
		||||
										
											Binary file not shown.
										
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
This file has an mtime of when this was started.
 | 
			
		||||
@@ -0,0 +1 @@
 | 
			
		||||
88dd02202d1f71fd
 | 
			
		||||
@@ -0,0 +1 @@
 | 
			
		||||
{"rustc":3062648155896360161,"features":"[]","declared_features":"[]","target":7479634845804353691,"profile":8731458305071235362,"path":10763286916239946207,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug\\.fingerprint\\cratetest-e02f2472706cb861\\dep-lib-cratetest","checksum":false}}],"rustflags":[],"config":2069994364910194474,"compile_kind":0}
 | 
			
		||||
							
								
								
									
										1
									
								
								Package-Crate/cratetest/target/debug/cratetest.d
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								Package-Crate/cratetest/target/debug/cratetest.d
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
D:\code\Git-Rust\Package-Crate\cratetest\target\debug\cratetest.exe: D:\code\Git-Rust\Package-Crate\cratetest\src\lib.rs D:\code\Git-Rust\Package-Crate\cratetest\src\main.rs D:\code\Git-Rust\Package-Crate\cratetest\src\student\mod.rs D:\code\Git-Rust\Package-Crate\cratetest\src\student\monitor.rs D:\code\Git-Rust\Package-Crate\cratetest\src\student\ordinary.rs
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								Package-Crate/cratetest/target/debug/cratetest.exe
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Package-Crate/cratetest/target/debug/cratetest.exe
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Package-Crate/cratetest/target/debug/cratetest.pdb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Package-Crate/cratetest/target/debug/cratetest.pdb
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							@@ -0,0 +1,8 @@
 | 
			
		||||
D:\code\Git-Rust\Package-Crate\cratetest\target\debug\deps\cratetest-18245caf720d90fc.d: src\main.rs src\student\mod.rs src\student\ordinary.rs src\student\monitor.rs
 | 
			
		||||
 | 
			
		||||
D:\code\Git-Rust\Package-Crate\cratetest\target\debug\deps\libcratetest-18245caf720d90fc.rmeta: src\main.rs src\student\mod.rs src\student\ordinary.rs src\student\monitor.rs
 | 
			
		||||
 | 
			
		||||
src\main.rs:
 | 
			
		||||
src\student\mod.rs:
 | 
			
		||||
src\student\ordinary.rs:
 | 
			
		||||
src\student\monitor.rs:
 | 
			
		||||
@@ -0,0 +1,5 @@
 | 
			
		||||
D:\code\Git-Rust\Package-Crate\cratetest\target\debug\deps\cratetest-99ce758d585dbfb5.d: src\lib.rs
 | 
			
		||||
 | 
			
		||||
D:\code\Git-Rust\Package-Crate\cratetest\target\debug\deps\libcratetest-99ce758d585dbfb5.rmeta: src\lib.rs
 | 
			
		||||
 | 
			
		||||
src\lib.rs:
 | 
			
		||||
@@ -0,0 +1,5 @@
 | 
			
		||||
D:\code\Git-Rust\Package-Crate\cratetest\target\debug\deps\cratetest-ad4fb1e3517573b1.d: src\lib.rs
 | 
			
		||||
 | 
			
		||||
D:\code\Git-Rust\Package-Crate\cratetest\target\debug\deps\libcratetest-ad4fb1e3517573b1.rmeta: src\lib.rs
 | 
			
		||||
 | 
			
		||||
src\lib.rs:
 | 
			
		||||
@@ -0,0 +1,8 @@
 | 
			
		||||
D:\code\Git-Rust\Package-Crate\cratetest\target\debug\deps\cratetest-d257ba26dc831c10.d: src\main.rs src\student\mod.rs src\student\ordinary.rs src\student\monitor.rs
 | 
			
		||||
 | 
			
		||||
D:\code\Git-Rust\Package-Crate\cratetest\target\debug\deps\libcratetest-d257ba26dc831c10.rmeta: src\main.rs src\student\mod.rs src\student\ordinary.rs src\student\monitor.rs
 | 
			
		||||
 | 
			
		||||
src\main.rs:
 | 
			
		||||
src\student\mod.rs:
 | 
			
		||||
src\student\ordinary.rs:
 | 
			
		||||
src\student\monitor.rs:
 | 
			
		||||
@@ -0,0 +1,7 @@
 | 
			
		||||
D:\code\Git-Rust\Package-Crate\cratetest\target\debug\deps\cratetest-e02f2472706cb861.d: src\lib.rs
 | 
			
		||||
 | 
			
		||||
D:\code\Git-Rust\Package-Crate\cratetest\target\debug\deps\libcratetest-e02f2472706cb861.rlib: src\lib.rs
 | 
			
		||||
 | 
			
		||||
D:\code\Git-Rust\Package-Crate\cratetest\target\debug\deps\libcratetest-e02f2472706cb861.rmeta: src\lib.rs
 | 
			
		||||
 | 
			
		||||
src\lib.rs:
 | 
			
		||||
							
								
								
									
										8
									
								
								Package-Crate/cratetest/target/debug/deps/cratetest.d
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								Package-Crate/cratetest/target/debug/deps/cratetest.d
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,8 @@
 | 
			
		||||
D:\code\Git-Rust\Package-Crate\cratetest\target\debug\deps\cratetest.d: src\main.rs src\student\mod.rs src\student\ordinary.rs src\student\monitor.rs
 | 
			
		||||
 | 
			
		||||
D:\code\Git-Rust\Package-Crate\cratetest\target\debug\deps\cratetest.exe: src\main.rs src\student\mod.rs src\student\ordinary.rs src\student\monitor.rs
 | 
			
		||||
 | 
			
		||||
src\main.rs:
 | 
			
		||||
src\student\mod.rs:
 | 
			
		||||
src\student\ordinary.rs:
 | 
			
		||||
src\student\monitor.rs:
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								Package-Crate/cratetest/target/debug/deps/cratetest.exe
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Package-Crate/cratetest/target/debug/deps/cratetest.exe
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Package-Crate/cratetest/target/debug/deps/cratetest.pdb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Package-Crate/cratetest/target/debug/deps/cratetest.pdb
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user