forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#127785 - matthiaskrgr:rollup-04q3ug0, r=matth…
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#120990 (Suggest a borrow when using dbg) - rust-lang#127047 (fix least significant digits of f128 associated constants) - rust-lang#127629 (Suggest using `map_or` when `Option<&T>::unwrap_or where T: Deref` fails) - rust-lang#127770 (Update books) - rust-lang#127780 (Make sure trait def ids match before zipping args in `note_function_argument_obligation`) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
19 changed files
with
523 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule book
updated
47 files
Submodule edition-guide
updated
2 files
+20 −11 | src/rust-2024/index.md | |
+7 −0 | src/rust-2024/never-type-fallback.md |
Submodule reference
updated
27 files
+16 −1 | .github/workflows/main.yml | |
+5 −5 | CONTRIBUTING.md | |
+7 −0 | README.md | |
+2 −68 | STYLE.md | |
+3 −0 | book.toml | |
+148 −0 | docs/authoring.md | |
+45 −45 | src/attributes.md | |
+94 −94 | src/attributes/codegen.md | |
+3 −3 | src/attributes/debugger.md | |
+9 −9 | src/attributes/diagnostics.md | |
+5 −1 | src/attributes/limits.md | |
+10 −6 | src/behavior-considered-undefined.md | |
+4 −2 | src/inline-assembly.md | |
+2 −2 | src/items/constant-items.md | |
+6 −4 | src/items/external-blocks.md | |
+5 −4 | src/items/functions.md | |
+7 −2 | src/linkage.md | |
+3 −3 | src/macros-by-example.md | |
+6 −6 | src/names.md | |
+1 −1 | src/names/namespaces.md | |
+5 −5 | src/names/preludes.md | |
+1 −1 | src/tokens.md | |
+4 −4 | src/types.md | |
+21 −12 | style-check/Cargo.lock | |
+1 −1 | style-check/Cargo.toml | |
+10 −1 | style-check/src/main.rs | |
+166 −0 | theme/reference.css |
Submodule rustc-dev-guide
updated
9 files
+257 −48 | ci/date-check/Cargo.lock | |
+7 −3 | ci/date-check/src/main.rs | |
+2 −2 | src/SUMMARY.md | |
+1 −1 | src/bug-fix-procedure.md | |
+1 −1 | src/building/how-to-build-and-run.md | |
+1 −1 | src/building/optimized-build.md | |
+149 −67 | src/mir/passes.md | |
+1 −1 | src/rustdoc.md | |
+3 −3 | src/tests/fuchsia.md |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
fn s() -> String { | ||
let a = String::new(); | ||
dbg!(a); | ||
return a; //~ ERROR use of moved value: | ||
} | ||
|
||
fn m() -> String { | ||
let a = String::new(); | ||
dbg!(1, 2, a, 1, 2); | ||
return a; //~ ERROR use of moved value: | ||
} | ||
|
||
fn t(a: String) -> String { | ||
let b: String = "".to_string(); | ||
dbg!(a, b); | ||
return b; //~ ERROR use of moved value: | ||
} | ||
|
||
fn x(a: String) -> String { | ||
let b: String = "".to_string(); | ||
dbg!(a, b); | ||
return a; //~ ERROR use of moved value: | ||
} | ||
|
||
macro_rules! my_dbg { | ||
() => { | ||
eprintln!("[{}:{}:{}]", file!(), line!(), column!()) | ||
}; | ||
($val:expr $(,)?) => { | ||
match $val { | ||
tmp => { | ||
eprintln!("[{}:{}:{}] {} = {:#?}", | ||
file!(), line!(), column!(), stringify!($val), &tmp); | ||
tmp | ||
} | ||
} | ||
}; | ||
($($val:expr),+ $(,)?) => { | ||
($(my_dbg!($val)),+,) | ||
}; | ||
} | ||
|
||
fn test_my_dbg() -> String { | ||
let b: String = "".to_string(); | ||
my_dbg!(b, 1); | ||
return b; //~ ERROR use of moved value: | ||
} | ||
|
||
fn test_not_macro() -> String { | ||
let a = String::new(); | ||
let _b = match a { | ||
tmp => { | ||
eprintln!("dbg: {}", tmp); | ||
tmp | ||
} | ||
}; | ||
return a; //~ ERROR use of moved value: | ||
} | ||
|
||
fn get_expr(_s: String) {} | ||
|
||
fn test() { | ||
let a: String = "".to_string(); | ||
let _res = get_expr(dbg!(a)); | ||
let _l = a.len(); //~ ERROR borrow of moved value | ||
} | ||
|
||
fn main() {} |
Oops, something went wrong.