-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rollup of 7 pull requests #80018
Rollup of 7 pull requests #80018
Commits on Nov 7, 2020
-
Refactor
parse_prefix
on WindowsRefactor `get_first_two_components` to `get_next_component`. Fixes the following behaviour of `parse_prefix`: - series of separator bytes in a prefix are correctly parsed as a single separator - device namespace prefixes correctly recognize both `\\` and `/` as separators
Configuration menu - View commit details
-
Copy full SHA for 94d73d4 - Browse repository at this point
Copy the full SHA 94d73d4View commit details
Commits on Dec 10, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 9cf2516 - Browse repository at this point
Copy the full SHA 9cf2516View commit details
Commits on Dec 11, 2020
-
Configuration menu - View commit details
-
Copy full SHA for d986924 - Browse repository at this point
Copy the full SHA d986924View commit details
Commits on Dec 12, 2020
-
Improve error handling in
symbols
proc-macroThis improves how the `symbols` proc-macro handles errors. If it finds an error in its input, the macro does not panic. Instead, it still produces an output token stream. That token stream will contain `compile_error!(...)` macro invocations. This will still cause compilation to fail (which is what we want), but it will prevent meaningless errors caused by the output not containing symbols that the macro normally generates. This solves a small (but annoying) problem. When you're editing rustc_span/src/symbol.rs, and you get something wrong (dup symbol name, misordered symbol), you want to get only the errors that are relevant, not a burst of errors that are irrelevant. This change also uses the correct Span when reporting errors, so you get errors that point to the correct place in rustc_span/src/symbol.rs where something is wrong. This also adds several unit tests which test the `symbols` proc-macro. This commit also makes it easy to run the `symbols` proc-macro as an ordinary Cargo test. Just run `cargo test`. This makes it easier to do development on the macro itself, such as running it under a debugger. This commit also uses the `Punctuated` type in `syn` for parsing comma-separated lists, rather than doing it manually. The output of the macro is not changed at all by this commit, so rustc should be completely unchanged. This just improves quality of life during development.
Arlie Davis committedDec 12, 2020 Configuration menu - View commit details
-
Copy full SHA for 201a833 - Browse repository at this point
Copy the full SHA 201a833View commit details
Commits on Dec 13, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 0f30b7d - Browse repository at this point
Copy the full SHA 0f30b7dView commit details -
Configuration menu - View commit details
-
Copy full SHA for d75618e - Browse repository at this point
Copy the full SHA d75618eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 94fd1d3 - Browse repository at this point
Copy the full SHA 94fd1d3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 09d528e - Browse repository at this point
Copy the full SHA 09d528eView commit details -
Configuration menu - View commit details
-
Copy full SHA for ec0f1d7 - Browse repository at this point
Copy the full SHA ec0f1d7View commit details -
Arlie Davis committed
Dec 13, 2020 Configuration menu - View commit details
-
Copy full SHA for 1a5b9b0 - Browse repository at this point
Copy the full SHA 1a5b9b0View commit details
Commits on Dec 14, 2020
-
Configuration menu - View commit details
-
Copy full SHA for adda964 - Browse repository at this point
Copy the full SHA adda964View commit details -
Rollup merge of rust-lang#78833 - CDirkx:parse_prefix, r=dtolnay
Refactor and fix `parse_prefix` on Windows This PR is an extension of rust-lang#78692 as well as a general refactor of `parse_prefix`: **Fixes**: There are two errors in the current implementation of `parse_prefix`: Firstly, in the current implementation only `\` is recognized as a separator character in device namespace prefixes. This behavior is only correct for verbatim paths; `"\\.\C:/foo"` should be parsed as `"C:"` instead of `"C:/foo"`. Secondly, the current implementation only handles single separator characters. In non-verbatim paths a series of separator characters should be recognized as a single boundary, e.g. the UNC path `"\\localhost\\\\\\C$\foo"` should be parsed as `"\\localhost\\\\\\C$"` and then `UNC(server: "localhost", share: "C$")`, but currently it is not parsed at all, because it starts being parsed as `\\localhost\` and then has an invalid empty share location. Paths like `"\\.\C:/foo"` and `"\\localhost\\\\\\C$\foo"` are valid on Windows, they are equivalent to just `"C:\foo"`. **Refactoring**: All uses of `&[u8]` within `parse_prefix` are extracted to helper functions and`&OsStr` is used instead. This reduces the number of places unsafe is used: - `get_first_two_components` is adapted to the more general `parse_next_component` and used in more places - code for parsing drive prefixes is extracted to `parse_drive`
Configuration menu - View commit details
-
Copy full SHA for 02e468e - Browse repository at this point
Copy the full SHA 02e468eView commit details -
Rollup merge of rust-lang#79918 - woodruffw-forks:ww/doc-initializer-…
…side-effects, r=dtolnay doc(array,vec): add notes about side effects when empty-initializing Copying some context from a conversation in the Rust discord: * Both `vec![T; 0]` and `[T; 0]` are syntactically valid, and produce empty containers of their respective types * Both *also* have side effects: ```rust fn side_effect() -> String { println!("side effect!"); "foo".into() } fn main() { println!("before!"); let x = vec![side_effect(); 0]; let y = [side_effect(); 0]; println!("{:?}, {:?}", x, y); } ``` produces: ``` before! side effect! side effect! [], [] ``` This PR just adds two small notes to each's documentation, warning users that side effects can occur. I've also submitted a clippy proposal: rust-lang/rust-clippy#6439
Configuration menu - View commit details
-
Copy full SHA for 4fceedb - Browse repository at this point
Copy the full SHA 4fceedbView commit details -
Rollup merge of rust-lang#79944 - sivadeilra:syms_proc_macro_testing,…
… r=petrochenkov Improve error handling in `symbols` proc-macro This improves how the `symbols` proc-macro handles errors. If it finds an error in its input, the macro does not panic. Instead, it still produces an output token stream. That token stream will contain `compile_error!(...)` macro invocations. This will still cause compilation to fail (which is what we want), but it will prevent meaningless errors caused by the output not containing symbols that the macro normally generates. This solves a small (but annoying) problem. When you're editing rustc_span/src/symbol.rs, and you get something wrong (dup symbol name, misordered symbol), you want to get only the errors that are relevant, not a burst of errors that are irrelevant. This change also uses the correct Span when reporting errors, so you get errors that point to the correct place in rustc_span/src/symbol.rs where something is wrong. This also adds several unit tests which test the `symbols` proc-macro. This commit also makes it easy to run the `symbols` proc-macro as an ordinary Cargo test. Just run `cargo test`. This makes it easier to do development on the macro itself, such as running it under a debugger. This commit also uses the `Punctuated` type in `syn` for parsing comma-separated lists, rather than doing it manually. The output of the macro is not changed at all by this commit, so rustc should be completely unchanged. This just improves quality of life during development.
Configuration menu - View commit details
-
Copy full SHA for 570c16a - Browse repository at this point
Copy the full SHA 570c16aView commit details -
Rollup merge of rust-lang#79959 - JohnTitor:tidy-entries, r=petrochenkov
Check the number of entries in UI test on tidy This helps rust-lang#73494 to be resolved. r? `@petrochenkov`
Configuration menu - View commit details
-
Copy full SHA for c3cf83b - Browse repository at this point
Copy the full SHA c3cf83bView commit details -
Rollup merge of rust-lang#80003 - Stupremee:fix-zst-vecdeque-conversi…
…on-panic, r=dtolnay Fix overflow when converting ZST Vec to VecDeque ```rust let v = vec![(); 100]; let queue = VecDeque::from(v); println!("{:?}", queue); ``` This code will currently panic with a capacity overflow. This PR resolves this issue and makes the code run fine. Resolves rust-lang#78532
Configuration menu - View commit details
-
Copy full SHA for e2ea2f0 - Browse repository at this point
Copy the full SHA e2ea2f0View commit details -
Rollup merge of rust-lang#80006 - ssomers:btree_cleanup_6, r=Mark-Sim…
…ulacrum BTreeMap: more expressive local variables in merge r? `@Mark-Simulacrum`
Configuration menu - View commit details
-
Copy full SHA for 2d852d0 - Browse repository at this point
Copy the full SHA 2d852d0View commit details -
Rollup merge of rust-lang#80013 - poliorcetics:rustdoc-test-refactor,…
… r=jyn514 Refactor test_lang_string_parse to make it clearer Follows rust-lang#79454 (comment) A small PR made to refactor a test in rustdoc that was becoming unwieldy. `@rustbot` label T-rustdoc r? `@jyn514`
Configuration menu - View commit details
-
Copy full SHA for 549937c - Browse repository at this point
Copy the full SHA 549937cView commit details