- 01 2月, 2022 5 次提交
-
-
由 lcnr 提交于
-
由 bors 提交于
rustc_errors: only box the `diagnostic` field in `DiagnosticBuilder`. I happened to need to do the first change (replacing `allow_suggestions` with equivalent functionality on `Diagnostic` itself) as part of a larger change, and noticed that there's only two fields left in `DiagnosticBuilderInner`. So with this PR, instead of a single pointer, `DiagnosticBuilder` is two pointers, which should work just as well for passing *it* by value (and may even work better wrt some operations, though probably not by much). But anything that was already taking advantage of `DiagnosticBuilder` being a single pointer, and wrapping it further (e.g. `Result<T, DiagnosticBuilder>` w/ non-ZST `T`), ~~will probably see a slowdown~~, so I want to do a perf run before even trying to propose this.
-
由 bors 提交于
Check that `#[rustc_must_implement_one_of]` is applied to a trait `#[rustc_must_implement_one_of]` only makes sense when applied to a trait, so it's sensible to emit an error otherwise.
-
由 bors 提交于
Check the number of arguments first in `is_recursive_call`
-
由 bors 提交于
Move overlap_mode into trait level attribute r? `@nikomatsakis` Should fix some performance regressions noted on https://github.com/rust-lang/rust/pull/93175
-
- 31 1月, 2022 35 次提交
-
-
由 Santiago Pastorino 提交于
-
由 Santiago Pastorino 提交于
-
由 bors 提交于
Store def_id_to_hir_id as variant in hir_owner. If hir_owner is Owner(_), the LocalDefId is pointing to an owner, so the ItemLocalId is 0. If the HIR node does not exist, we store Phantom. Otherwise, we store the HirId associated to the LocalDefId. Related to #89278 r? `@oli-obk`
-
由 bors 提交于
Rollup of 8 pull requests Successful merges: - #90277 (Improve terminology around "after typeck") - #92918 (Allow eliding GATs in expression position) - #93039 (Don't suggest inaccessible fields) - #93155 (Switch pretty printer to block-based indentation) - #93214 (Respect doc(hidden) when suggesting available fields) - #93347 (Make `char::DecodeUtf16::size_hist` more precise) - #93392 (Clarify documentation on char::MAX) - #93444 (Fix some CSS warnings and errors from VS Code) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
-
由 bors 提交于
Rollup of 8 pull requests Successful merges: - #93395 (Improve suggestion for escaping reserved keywords) - #93403 (review the total_cmp documentation) - #93461 (Accommodate yield points in the format_args expansion) - #93462 (Document `SystemTime` platform precision) - #93471 (unix: Use metadata for `DirEntry::file_type` fallback) - #93480 (Remove deprecated and unstable slice_partition_at_index functions) - #93485 (core: Remove some redundant {}s from the sorting code) - #93494 (kmc-solid: Inherit the calling task's base priority in `Thread::new`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
-
由 Matthias Krüger 提交于
kmc-solid: Inherit the calling task's base priority in `Thread::new` This PR fixes the initial priority calculation of spawned threads on the [`*-kmc-solid_*`](https://doc.rust-lang.org/nightly/rustc/platform-support/kmc-solid.html) Tier 3 targets. Fixes a spawned task (an RTOS object on top of which threads are implemented for this target; unrelated to async tasks) getting an unexpectedly higher priority if it's spawned by a task whose priority is temporarily boosted by a priority-protection mutex.
-
由 Matthias Krüger 提交于
core: Remove some redundant {}s from the sorting code
-
由 Matthias Krüger 提交于
Remove deprecated and unstable slice_partition_at_index functions They have been deprecated since commit 01ac5a97 which was part of the 1.49.0 release, so from the point of nightly, 11 releases ago.
-
由 Matthias Krüger 提交于
unix: Use metadata for `DirEntry::file_type` fallback When `DirEntry::file_type` fails to match a known `d_type`, we should fall back to `DirEntry::metadata` instead of a bare `lstat`, because this is faster and more reliable on targets with `fstatat`.
-
由 Matthias Krüger 提交于
Document `SystemTime` platform precision Fixes #88822
-
由 Matthias Krüger 提交于
Accommodate yield points in the format_args expansion Fixes #93274. For the case `println!("{} {:?}", "", async {}.await)` in the issue, the expansion before: ```rust ::std::io::_print( ::core::fmt::Arguments::new_v1( &["", " ", "\n"], &[ ::core::fmt::ArgumentV1::new(&"", ::core::fmt::Display::fmt), ::core::fmt::ArgumentV1::new(&async {}.await, ::core::fmt::Debug::fmt), ], ), ); ``` After: ```rust ::std::io::_print( ::core::fmt::Arguments::new_v1( &["", " ", "\n"], &match (&"", &async {}.await) { _args => [ ::core::fmt::ArgumentV1::new(_args.0, ::core::fmt::Display::fmt), ::core::fmt::ArgumentV1::new(_args.1, ::core::fmt::Debug::fmt), ], }, ), ); ```
-
由 Matthias Krüger 提交于
review the total_cmp documentation The documentation has been restructured to split out a brief summary paragraph out from the following elaborating paragraphs. I also attempted my hand at wording improvements and adding articles where I felt them missing, but being non-native english speaker these may need more thorough review. cc https://github.com/rust-lang/rust/issues/72599
-
由 Matthias Krüger 提交于
Improve suggestion for escaping reserved keywords r? `@davidtwco`
-
由 Matthias Krüger 提交于
Fix some CSS warnings and errors from VS Code There's no such CSS rule as `box-shadow-color`, so I instead copied the whole `box-shadow` property to each rule to make it actually apply. r? `@jsha`
-
由 Matthias Krüger 提交于
Clarify documentation on char::MAX As mentioned in https://github.com/rust-lang/rust/issues/91836#issuecomment-994106874, the documentation on `char::MAX` is not quite correct – USVs are not "only ones within a certain range", they are code points _outside_ a certain range. I have corrected this and given the actual numbers as there is no reason to hide them.
-
由 Matthias Krüger 提交于
Make `char::DecodeUtf16::size_hist` more precise New implementation takes into account contents of `self.buf` and rounds lower bound up instead of down. Fixes #88762 Revival of #88763
-
由 Matthias Krüger 提交于
Respect doc(hidden) when suggesting available fields Resolves #93210
-
由 Matthias Krüger 提交于
Switch pretty printer to block-based indentation This PR backports https://github.com/dtolnay/prettyplease/commit/401d60c04213e6c66565e0e69a95b4588db5fdba from the `prettyplease` crate into `rustc_ast_pretty`. A before and after: ```diff - let res = - ((::alloc::fmt::format as - for<'r> fn(Arguments<'r>) -> String {format})(((::core::fmt::Arguments::new_v1 - as - fn(&[&'static str], &[ArgumentV1]) -> Arguments {Arguments::new_v1})((&([("test" - as - &str)] - as - [&str; 1]) - as - &[&str; 1]), - (&([] - as - [ArgumentV1; 0]) - as - &[ArgumentV1; 0])) - as - Arguments)) - as String); + let res = + ((::alloc::fmt::format as + for<'r> fn(Arguments<'r>) -> String {format})(((::core::fmt::Arguments::new_v1 + as + fn(&[&'static str], &[ArgumentV1]) -> Arguments {Arguments::new_v1})((&([("test" + as &str)] as [&str; 1]) as + &[&str; 1]), + (&([] as [ArgumentV1; 0]) as &[ArgumentV1; 0])) as + Arguments)) as String); ``` Previously the pretty printer would compute indentation always relative to whatever column a block begins at, like this: ```rust fn demo(arg1: usize, arg2: usize); ``` This is never the thing to do in the dominant contemporary Rust style. Rustfmt's default and the style used by the vast majority of Rust codebases is block indentation: ```rust fn demo( arg1: usize, arg2: usize, ); ``` where every indentation level is a multiple of 4 spaces and each level is indented relative to the indentation of the previous line, not the position that the block starts in. By itself this PR doesn't get perfect formatting in all cases, but it is the smallest possible step in clearly the right direction. More backports from `prettyplease` to tune the ibox/cbox indent levels around various AST node types are upcoming.
-
由 Matthias Krüger 提交于
Don't suggest inaccessible fields Fixes: https://github.com/rust-lang/rust/issues/92999
-
由 Matthias Krüger 提交于
Allow eliding GATs in expression position Thoughts on whether this is worthwhile? Fixes #92836 r? ``@jackh726``
-
由 Matthias Krüger 提交于
Improve terminology around "after typeck" Closes #70258.
-
由 bors 提交于
update vulnerable/yanked deps tokio v1.8.2 -> v1.8.4: https://rustsec.org/advisories/RUSTSEC-2021-0124 ammonia v3.1.0 -> v3.1.3: https://rustsec.org/advisories/RUSTSEC-2022-0003 thread_local v1.0.1 -> v1.1.4: https://rustsec.org/advisories/RUSTSEC-2022-0006 pin-project-lite v0.2.4 -> v0.2.8: yanked: https://github.com/taiki-e/pin-project-lite/blob/main/CHANGELOG.md#024---2021-01-11
-
由 David Tolnay 提交于
-
由 David Tolnay 提交于
-
由 David Tolnay 提交于
The `print_expr` method already places an `ibox(INDENT_UNIT)` around every expr that gets printed. Some exprs were then using `self.head` inside of that, which does its own `cbox(INDENT_UNIT)`, resulting in two levels of indentation: while true { stuff; } This commit fixes those cases to produce the expected single level of indentation within every expression containing a block. while true { stuff; }
-
由 David Tolnay 提交于
Previously the pretty printer would compute indentation always relative to whatever column a block begins at, like this: fn demo(arg1: usize, arg2: usize); This is never the thing to do in the dominant contemporary Rust style. Rustfmt's default and the style used by the vast majority of Rust codebases is block indentation: fn demo( arg1: usize, arg2: usize, ); where every indentation level is a multiple of 4 spaces and each level is indented relative to the indentation of the previous line, not the position that the block starts in.
-
由 Tomoaki Kawada 提交于
Fixes a spawned task getting an unexpectedly higher priority if it's spawned by a task whose priority is temporarily boosted by a priority- protection mutex.
-
由 bors 提交于
Create `core::fmt::ArgumentV1` with generics instead of fn pointer Split from (and prerequisite of) #90488, as this seems to have perf implication. `@rustbot` label: +T-libs
-
由 George Bateman 提交于
-
由 Simonas Kazlauskas 提交于
The documentation has been restructured to split out a brief summary paragraph out from the following elaborating paragraphs. I also attempted my hand at wording improvements and adding articles where I felt them missing, but being non-native english speaker these may need more thorough review.
-
由 bors 提交于
rustdoc: Remove `def_id_no_primitives` Fixes #90187.
-
由 David Tolnay 提交于
-
由 David Tolnay 提交于
-
由 David Tolnay 提交于
Currently fails with: error: future cannot be sent between threads safely --> $DIR/src/test/ui/fmt/format-with-yield-point.rs:21:17 | LL | assert_send(with_await()); | ^^^^^^^^^^^^ future returned by `with_await` is not `Send` | = help: the trait `Sync` is not implemented for `core::fmt::Opaque` note: future is not `Send` as this value is used across an await --> $DIR/src/test/ui/fmt/format-with-yield-point.rs:11:37 | LL | println!("{} {:?}", "", async {}.await); | --------------------------------^^^^^^- | | | | | await occurs here, with `$crate::format_args_nl!($($arg)*)` maybe used later | has type `ArgumentV1<'_>` which is not `Send` | `$crate::format_args_nl!($($arg)*)` is later dropped here note: required by a bound in `assert_send` --> $DIR/src/test/ui/fmt/format-with-yield-point.rs:18:24 | LL | fn assert_send(_: impl Send) {} | ^^^^ required by this bound in `assert_send` error: future cannot be sent between threads safely --> $DIR/src/test/ui/fmt/format-with-yield-point.rs:22:17 | LL | assert_send(with_macro_call()); | ^^^^^^^^^^^^^^^^^ future returned by `with_macro_call` is not `Send` | = help: the trait `Sync` is not implemented for `core::fmt::Opaque` note: future is not `Send` as this value is used across an await --> $DIR/src/test/ui/fmt/format-with-yield-point.rs:6:17 | LL | async {}.await | ^^^^^^ await occurs here, with `$crate::format_args_nl!($($arg)*)` maybe used later ... LL | println!("{} {:?}", "", m!()); | ----------------------------- | | | | | in this macro invocation | has type `ArgumentV1<'_>` which is not `Send` | `$crate::format_args_nl!($($arg)*)` is later dropped here note: required by a bound in `assert_send` --> $DIR/src/test/ui/fmt/format-with-yield-point.rs:18:24 | LL | fn assert_send(_: impl Send) {} | ^^^^ required by this bound in `assert_send` = note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors
-
由 bors 提交于
Rollup of 5 pull requests Successful merges: - #92887 (Bootstrap compiler update) - #92908 (Render more readable macro matcher tokens in rustdoc) - #93183 (rustdoc: mobile nav fixes) - #93192 (Add VS 2022 into error message) - #93475 (Add test to ensure that theme is applied correctly when going back in history) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
-