-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 8 pull requests #83580
Rollup of 8 pull requests #83580
Commits on Mar 24, 2021
-
rustdoc: Use diagnostics for error when including sources
This error probably almost never happens, but we should still use the diagnostic infrastructure. My guess is that the error was added back before rustdoc used the rustc diagnostic infrastructure (it was all `println!` and `eprintln!` back then!) and since it likely rarely occurs and this code doesn't change that much, no one thought to transition it to using diagnostics. Note that the old error was actually a warning (it didn't stop the rest of doc building). It seems very unlikely that this would fail without the rest of the doc build failing, so it makes more sense for it to be a hard error. The error looks like this: error: failed to render source code for `src/test/rustdoc/smart-punct.rs`: "bar": foo --> src/test/rustdoc/smart-punct.rs:3:1 | 3 | / #![crate_name = "foo"] 4 | | 5 | | //! This is the "start" of the 'document'! How'd you know that "it's" ... 6 | | //! ... | 22 | | //! I say "don't smart-punct me -- please!" 23 | | //! ``` | |_______^ I wasn't sure how to trigger the error, so to create that message I temporarily made rustdoc always emit it. That's also why it says "bar" and "foo" instead of a real error message. Note that the span of the diagnostic starts at line 3 because line 1 of that file is a (non-doc) comment and line 2 is a blank line.
Configuration menu - View commit details
-
Copy full SHA for 3d8ce0a - Browse repository at this point
Copy the full SHA 3d8ce0aView commit details
Commits on Mar 26, 2021
-
This makes it a little easier to `zip` iterators: ```rust for (x, y) in zip(xs, ys) {} // vs. for (x, y) in xs.into_iter().zip(ys) {} ``` You can `zip(&mut xs, &ys)` for the conventional `iter_mut()` and `iter()`, respectively. This can also support arbitrary nesting, where it's easier to see the item layout than with arbitrary `zip` chains: ```rust for ((x, y), z) in zip(zip(xs, ys), zs) {} for (x, (y, z)) in zip(xs, zip(ys, zs)) {} // vs. for ((x, y), z) in xs.into_iter().zip(ys).zip(xz) {} for (x, (y, z)) in xs.into_iter().zip((ys.into_iter().zip(xz)) {} ``` It may also format more nicely, especially when the first iterator is a longer chain of methods -- for example: ```rust iter::zip( trait_ref.substs.types().skip(1), impl_trait_ref.substs.types().skip(1), ) // vs. trait_ref .substs .types() .skip(1) .zip(impl_trait_ref.substs.types().skip(1)) ``` This replaces the tuple-pair `IntoIterator` in rust-lang#78204. There is prior art for the utility of this in [`itertools::zip`]. [`itertools::zip`]: https://docs.rs/itertools/0.10.0/itertools/fn.zip.html
Configuration menu - View commit details
-
Copy full SHA for b362958 - Browse repository at this point
Copy the full SHA b362958View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3b1f5e3 - Browse repository at this point
Copy the full SHA 3b1f5e3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 72ebebe - Browse repository at this point
Copy the full SHA 72ebebeView commit details -
Configuration menu - View commit details
-
Copy full SHA for e82e812 - Browse repository at this point
Copy the full SHA e82e812View commit details -
Configuration menu - View commit details
-
Copy full SHA for addc51a - Browse repository at this point
Copy the full SHA addc51aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5ac917d - Browse repository at this point
Copy the full SHA 5ac917dView commit details
Commits on Mar 27, 2021
-
Always preserve
None
-delimited groups in a capturedTokenStream
Previously, we would silently remove any `None`-delimiters when capturing a `TokenStream`, 'flattenting' them to their inner tokens. This was not normally visible, since we usually have `TokenKind::Interpolated` (which gets converted to a `None`-delimited group during macro invocation) instead of an actual `None`-delimited group. However, there are a couple of cases where this becomes visible to proc-macros: 1. A cross-crate `macro_rules!` macro has a `None`-delimited group stored in its body (as a result of being produced by another `macro_rules!` macro). The cross-crate `macro_rules!` invocation can then expand to an attribute macro invocation, which needs to be able to see the `None`-delimited group. 2. A proc-macro can invoke an attribute proc-macro with its re-collected input. If there are any nonterminals present in the input, they will get re-collected to `None`-delimited groups, which will then get captured as part of the attribute macro invocation. Both of these cases are incredibly obscure, so there hopefully won't be any breakage. This change will allow more agressive 'flattenting' of nonterminals in rust-lang#82608 without losing `None`-delimited groups.
Configuration menu - View commit details
-
Copy full SHA for f94360f - Browse repository at this point
Copy the full SHA f94360fView commit details -
Configuration menu - View commit details
-
Copy full SHA for ee1b33c - Browse repository at this point
Copy the full SHA ee1b33cView commit details -
Improve fs error open_from unix
Consistency for rust-lang#79399 Suggested by JohnTitor Improve fs error invaild input for sys_common The text was duplicated from unix.
Configuration menu - View commit details
-
Copy full SHA for 6c6ef73 - Browse repository at this point
Copy the full SHA 6c6ef73View commit details -
Configuration menu - View commit details
-
Copy full SHA for 42150fb - Browse repository at this point
Copy the full SHA 42150fbView commit details -
Configuration menu - View commit details
-
Copy full SHA for e461ddd - Browse repository at this point
Copy the full SHA e461dddView commit details -
make unaligned_refereces future-incompat lint warn-by-default, and re…
…move the safe_packed_borrows lint that it replaces
Configuration menu - View commit details
-
Copy full SHA for fb4f48e - Browse repository at this point
Copy the full SHA fb4f48eView commit details -
Configuration menu - View commit details
-
Copy full SHA for f0a6052 - Browse repository at this point
Copy the full SHA f0a6052View commit details -
Rollup merge of rust-lang#81351 - lcnr:big-money-big-prices, r=oli-obk
combine: stop eagerly evaluating consts `super_relate_consts` eagerly evaluates constants which doesn't seem too great. I now also finally understand why all of the unused substs test passed. The reason being that we just evaluated the constants in `super_relate_consts` 😆 While this change isn't strictly necessary as evaluating consts here doesn't hurt, it still feels a lot cleaner to do it this way r? `@oli-obk` `@nikomatsakis`
Configuration menu - View commit details
-
Copy full SHA for 520c9a2 - Browse repository at this point
Copy the full SHA 520c9a2View commit details -
Rollup merge of rust-lang#82525 - RalfJung:unaligned-ref-warn, r=petr…
…ochenkov make unaligned_references future-incompat lint warn-by-default and also remove the safe_packed_borrows lint that it replaces. `std::ptr::addr_of!` has hit beta now and will hit stable in a month, so I propose we start fixing rust-lang#27060 for real: creating a reference to a field of a packed struct needs to eventually become a hard error; this PR makes it a warn-by-default future-incompat lint. (The lint already existed, this just raises its default level.) At the same time I removed the corresponding code from unsafety checking; really there's no reason an `unsafe` block should make any difference here. For references to packed fields outside `unsafe` blocks, this means `unaligned_refereces` replaces the previous `safe_packed_borrows` warning with a link to rust-lang#82523 (and no more talk about unsafe blocks making any difference). So behavior barely changes, the warning is just worded differently. For references to packed fields inside `unsafe` blocks, this PR shows a new future-incompat warning. Closes rust-lang#46043 because that lint no longer exists.
Configuration menu - View commit details
-
Copy full SHA for a900677 - Browse repository at this point
Copy the full SHA a900677View commit details -
Rollup merge of rust-lang#82626 - lcnr:encode_with_shorthandb, r=este…
…bank update array missing `IntoIterator` msg fixes rust-lang#82602 r? ```@estebank``` do you know whether we can use the expr span in `rustc_on_unimplemented`? The label isn't too great rn
Configuration menu - View commit details
-
Copy full SHA for ebea9d9 - Browse repository at this point
Copy the full SHA ebea9d9View commit details -
Rollup merge of rust-lang#82917 - cuviper:iter-zip, r=m-ou-se
Add function core::iter::zip This makes it a little easier to `zip` iterators: ```rust for (x, y) in zip(xs, ys) {} // vs. for (x, y) in xs.into_iter().zip(ys) {} ``` You can `zip(&mut xs, &ys)` for the conventional `iter_mut()` and `iter()`, respectively. This can also support arbitrary nesting, where it's easier to see the item layout than with arbitrary `zip` chains: ```rust for ((x, y), z) in zip(zip(xs, ys), zs) {} for (x, (y, z)) in zip(xs, zip(ys, zs)) {} // vs. for ((x, y), z) in xs.into_iter().zip(ys).zip(xz) {} for (x, (y, z)) in xs.into_iter().zip((ys.into_iter().zip(xz)) {} ``` It may also format more nicely, especially when the first iterator is a longer chain of methods -- for example: ```rust iter::zip( trait_ref.substs.types().skip(1), impl_trait_ref.substs.types().skip(1), ) // vs. trait_ref .substs .types() .skip(1) .zip(impl_trait_ref.substs.types().skip(1)) ``` This replaces the tuple-pair `IntoIterator` in rust-lang#78204. There is prior art for the utility of this in [`itertools::zip`]. [`itertools::zip`]: https://docs.rs/itertools/0.10.0/itertools/fn.zip.html
Configuration menu - View commit details
-
Copy full SHA for b2e2543 - Browse repository at this point
Copy the full SHA b2e2543View commit details -
Rollup merge of rust-lang#82993 - camelid:source-use-diag, r=jyn514
rustdoc: Use diagnostics for error when including sources This error probably almost never happens, but we should still use the diagnostic infrastructure. My guess is that the error was added back before rustdoc used the rustc diagnostic infrastructure (it was all `println!` and `eprintln!` back then!) and since it likely rarely occurs and this code doesn't change that much, no one thought to transition it to using diagnostics. Note that the old error was actually a warning (it didn't stop the rest of doc building). It seems very unlikely that this would fail without the rest of the doc build failing, so it makes more sense for it to be a hard error. The error looks like this: error: failed to render source code for `src/test/rustdoc/smart-punct.rs`: "bar": foo --> src/test/rustdoc/smart-punct.rs:3:1 | 3 | / #![crate_name = "foo"] 4 | | 5 | | //! This is the "start" of the 'document'! How'd you know that "it's" ... 6 | | //! ... | 22 | | //! I say "don't smart-punct me -- please!" 23 | | //! ``` | |_______^ I wasn't sure how to trigger the error, so to create that message I temporarily made rustdoc always emit it. That's also why it says "bar" and "foo" instead of a real error message. Note that the span of the diagnostic starts at line 3 because line 1 of that file is a (non-doc) comment and line 2 is a blank line.
Configuration menu - View commit details
-
Copy full SHA for f665e5a - Browse repository at this point
Copy the full SHA f665e5aView commit details -
Rollup merge of rust-lang#83522 - pickfire:patch-6, r=JohnTitor
Improve fs error open_from unix Consistency for rust-lang#79399 Suggested by JohnTitor r? `@JohnTitor` Not user if the error is too long now, do we handle long errors well?
Configuration menu - View commit details
-
Copy full SHA for aee7b9e - Browse repository at this point
Copy the full SHA aee7b9eView commit details -
Rollup merge of rust-lang#83548 - Aaron1011:capture-none-delims, r=pe…
…trochenkov Always preserve `None`-delimited groups in a captured `TokenStream` Previously, we would silently remove any `None`-delimiters when capturing a `TokenStream`, 'flattenting' them to their inner tokens. This was not normally visible, since we usually have `TokenKind::Interpolated` (which gets converted to a `None`-delimited group during macro invocation) instead of an actual `None`-delimited group. However, there are a couple of cases where this becomes visible to proc-macros: 1. A cross-crate `macro_rules!` macro has a `None`-delimited group stored in its body (as a result of being produced by another `macro_rules!` macro). The cross-crate `macro_rules!` invocation can then expand to an attribute macro invocation, which needs to be able to see the `None`-delimited group. 2. A proc-macro can invoke an attribute proc-macro with its re-collected input. If there are any nonterminals present in the input, they will get re-collected to `None`-delimited groups, which will then get captured as part of the attribute macro invocation. Both of these cases are incredibly obscure, so there hopefully won't be any breakage. This change will allow more agressive 'flattenting' of nonterminals in rust-lang#82608 without losing `None`-delimited groups.
Configuration menu - View commit details
-
Copy full SHA for 1115acc - Browse repository at this point
Copy the full SHA 1115accView commit details -
Rollup merge of rust-lang#83555 - m-ou-se:inline-io-error-new-const, …
…r=jackh726 Add #[inline] to io::Error methods Fixes rust-lang#82812
Configuration menu - View commit details
-
Copy full SHA for 7d6af67 - Browse repository at this point
Copy the full SHA 7d6af67View commit details