- 29 5月, 2022 19 次提交
-
-
由 binggh 提交于
Remove dead code Missing } ./x.py fmt Remove duplicate check Recursively remove all usage of help_on_error
-
由 bors 提交于
Move things to `rustc_type_ir` Finishes some work proposed in https://github.com/rust-lang/compiler-team/issues/341. r? `@ghost`
-
由 bors 提交于
Move download-rustc from python to rustbuild - Remove download-rustc handling from bootstrap.py - Allow a custom `pattern` in `builder.unpack()` - Only download rustc once another part of bootstrap depends on it. This is somewhat necessary since the download functions rely on having a full `Builder`, which isn't available until after config parsing finishes. Helps with https://github.com/rust-lang/rust/issues/94829.
-
由 bors 提交于
rustdoc: include impl generics / self in search index Fixes #92205
-
由 bors 提交于
Rollup of 5 pull requests Successful merges: - #96950 (Add regression test for #96395) - #97028 (Add support for embedding pretty printers via `#[debugger_visualizer]` attribute) - #97478 (Remove FIXME on `ExtCtxt::fn_decl()`) - #97479 (Make some tests check-pass) - #97482 (ptr::invalid is not equivalent to a int2ptr cast) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
-
由 Guillaume Gomez 提交于
ptr::invalid is not equivalent to a int2ptr cast I just realized I forgot to update these docs when adding `from_exposed_addr`. Right now the docs say `invalid` and `from_exposed_addr` are both equivalent to a cast, and that is clearly not what we want. Cc ``@Gankra``
-
由 Guillaume Gomez 提交于
Make some tests check-pass This touches the tests related to lint, parser, and importing, all of them should be fine with `check-pass`. r? ``@compiler-errors``
-
由 Guillaume Gomez 提交于
Remove FIXME on `ExtCtxt::fn_decl()` `ExtCtxt::fn_decl()` is used like `self.fn_decl(..)` or `self.cx.fn_decl(..)`, coverting it to an assoc fn, for example, makes it inconvenience (e.g. `self.cx.fn_decl(..)` would be longer to represent). Given that, it doesn't seem a "FIXME" thing and unused `self` is okay, I think.
-
由 Guillaume Gomez 提交于
Add support for embedding pretty printers via `#[debugger_visualizer]` attribute Initial support for [RFC 3191](https://github.com/rust-lang/rfcs/pull/3191) in PR https://github.com/rust-lang/rust/pull/91779 was scoped to supporting embedding NatVis files using a new attribute. This PR implements the pretty printer support as stated in the RFC mentioned above. This change includes embedding pretty printers in the `.debug_gdb_scripts` just as the pretty printers for rustc are embedded today. Also added additional tests for embedded pretty printers. Additionally cleaned up error checking so all error checking is done up front regardless of the current target. RFC: https://github.com/rust-lang/rfcs/pull/3191
-
由 Guillaume Gomez 提交于
Add regression test for #96395 Closes #96395 This repeats "fixed" and "ICE", see https://github.com/rust-lang/glacier/pull/1243#issuecomment-1123768138 I think it's good to add a test before regressing again. r? ``@compiler-errors`` for quick reviiew cc ``@oli-obk`` you might want to check as you're familiar with MIR
-
由 bors 提交于
Update to rebased rustc-rayon 0.4 In rayon-rs/rayon#938, miri uncovered a race in `rustc-rayon-core` that had already been fixed in the regular `rayon-core`. I have now rebased that fork onto the latest rayon branch, and published as 0.4. I also updated `indexmap` to bump the dependency. `Cargo.lock` changes: Updating indexmap v1.8.0 -> v1.8.2 Updating rayon v1.5.1 -> v1.5.3 Updating rayon-core v1.9.1 -> v1.9.3 Updating rustc-rayon v0.3.2 -> v0.4.0 Updating rustc-rayon-core v0.3.2 -> v0.4.1
-
由 bors 提交于
update libbacktrace It seems like previously we were on a tag of the backtrace repo; not sure if there is a policy that it should always be a tag? Cc https://github.com/rust-lang/backtrace-rs/pull/462 `@alexcrichton` `@DrMeepster`
-
由 Michael Goulet 提交于
-
由 Michael Goulet 提交于
-
由 Michael Goulet 提交于
-
由 Michael Goulet 提交于
-
由 Wilco Kusee 提交于
-
由 bors 提交于
proc_macro: don't pass a client-side function pointer through the server. Before this PR, `proc_macro::bridge::Client<F>` contained both: * the C ABI entry-point `run`, that the server can call to start the client * some "payload" `f: F` passed to that entry-point * in practice, this was always a (client-side Rust ABI) `fn` pointer to the actual function the proc macro author wrote, i.e. `#[proc_macro] fn foo(input: TokenStream) -> TokenStream` In other words, the client was passing one of its (Rust) `fn` pointers to the server, which was passing it back to the client, for the client to call (see later below for why that was ever needed). I was inspired by `@nnethercote's` attempt to remove the `get_handle_counters` field from `Client` (see https://github.com/rust-lang/rust/pull/97004#issuecomment-1139273301), which combined with removing the `f` ("payload") field, could theoretically allow for a `#[repr(transparent)]` `Client` that mostly just newtypes the C ABI entry-point `fn` pointer <sub>(and in the context of e.g. wasm isolation, that's *all* you want, since you can reason about it from outside the wasm VM, as just a 32-bit "function table index", that you can pass to the wasm VM to call that function)</sub>. <hr/> So this PR removes that "payload". But it's not a simple refactor: the reason the field existed in the first place is because monomorphizing over a function type doesn't let you call the function without having a value of that type, because function types don't implement anything like `Default`, i.e.: ```rust extern "C" fn ffi_wrapper<A, R, F: Fn(A) -> R>(arg: A) -> R { let f: F = ???; // no way to get a value of `F` f(arg) } ``` That could be solved with something like this, if it was allowed: ```rust extern "C" fn ffi_wrapper< A, R, F: Fn(A) -> R, const f: F // not allowed because the type is a generic param >(arg: A) -> R { f(arg) } ``` Instead, this PR contains a workaround in `proc_macro::bridge::selfless_reify` (see its module-level comment for more details) that can provide something similar to the `ffi_wrapper` example above, but limited to `F` being `Copy` and ZST (and requiring an `F` value to prove the caller actually can create values of `F` and it's not uninhabited or some other unsound situation). <hr/> Hopefully this time we don't have a performance regression, and this has a chance to land. cc `@mystor` `@bjorn3`
-
由 Ralf Jung 提交于
-
- 28 5月, 2022 21 次提交
-
-
由 bors 提交于
Try to cache region_scope_tree as a query This PR will attempt to restore `region_scope_tree` as a query so that caching works again. It seems that `region_scope_tree` could be re-computed for nested items after all, which could explain the performance regression introduced by #95563. cc `@Mark-Simulacrum` `@pnkfelix` I will try to trigger a perf run here.
-
由 bors 提交于
Split dead store elimination off dest prop This splits off a part of #96451 . I've added this in as its own pass for now, so that it actually runs, can be tested, etc. In the dest prop PR, I'll stop invoking this as its own pass, so that it doesn't get invoked twice. r? `@tmiasko`
-
由 Ralf Jung 提交于
-
由 Yuki Okushi 提交于
-
由 Yuki Okushi 提交于
-
由 bors 提交于
Rollup of 5 pull requests Successful merges: - #94640 (Partially stabilize `(const_)slice_ptr_len` feature by stabilizing `NonNull::len`) - #97034 (Implement `Hash` for `core::alloc::Layout`) - #97327 (macros: introduce `fluent_messages` macro ) - #97448 (docs: Don't imply that OsStr on Unix is always UTF-8) - #97466 ([bootstrap] Move `sanitize_sh` from `dist` to `install`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
-
由 Dylan DPC 提交于
[bootstrap] Move `sanitize_sh` from `dist` to `install` This is the only place it's used, so there's no need for it to be public in another module. In general, `dist` shouldn't ever touch shell scripts.
-
由 Dylan DPC 提交于
docs: Don't imply that OsStr on Unix is always UTF-8 The methods in `OsStrExt` consume and return `&[u8]` and don't perform any UTF-8 checks.
-
由 Dylan DPC 提交于
macros: introduce `fluent_messages` macro Adds a new `fluent_messages` macro which performs compile-time validation of the compiler's Fluent resources (i.e. that the resources parse and don't multiply define the same messages) and generates constants that make using those messages in diagnostics more ergonomic. For example, given the following invocation of the macro.. ```rust fluent_messages! { typeck => "./typeck.ftl", } ``` ..where `typeck.ftl` has the following contents.. ```fluent typeck-field-multiply-specified-in-initializer = field `{$ident}` specified more than once .label = used more than once .label-previous-use = first use of `{$ident}` ``` ...then the macro parse the Fluent resource, emitting a diagnostic if it fails to do so... ```text error: could not parse Fluent resource --> $DIR/test.rs:35:28 | LL | missing_message => "./missing-message.ftl", | ^^^^^^^^^^^^^^^^^^^^^^^ | = help: see additional errors emitted error: expected a message field for "missing-message" --> ./missing-message.ftl:1:1 | 1 | missing-message = | ^^^^^^^^^^^^^^^^^^ | ``` ...or generating the following code if it succeeds: ```rust pub static DEFAULT_LOCALE_RESOURCES: &'static [&'static str] = &[ include_str!("./typeck.ftl"), ]; mod fluent_generated { mod typeck { pub const field_multiply_specified_in_initializer: DiagnosticMessage = DiagnosticMessage::fluent("typeck-field-multiply-specified-in-initializer"); pub const field_multiply_specified_in_initializer_label_previous_use: DiagnosticMessage = DiagnosticMessage::fluent_attr( "typeck-field-multiply-specified-in-initializer", "previous-use-label" ); } } ``` When emitting a diagnostic, the generated constants can be used as follows: ```rust let mut err = sess.struct_span_err( span, fluent::typeck::field_multiply_specified_in_initializer ); err.span_label( span, fluent::typeck::field_multiply_specified_in_initializer_label ); err.span_label( previous_use_span, fluent::typeck::field_multiply_specified_in_initializer_label_previous_use ); err.emit(); ``` I'd like to reduce the verbosity of referring to labels/notes/helps with this scheme (though it wasn't much better before), but I'll leave that for a follow-up. r? `@oli-obk` cc `@pvdrz` `@compiler-errors`
-
由 Dylan DPC 提交于
Implement `Hash` for `core::alloc::Layout` This was brought up on [reddit](https://www.reddit.com/r/rust/comments/uoypui/the_standard_library_types_are_good_except_when/), and I don't see why Layout shouldn't implement `Hash`. Feel free to comment if I am wrong though :)
-
由 Dylan DPC 提交于
Partially stabilize `(const_)slice_ptr_len` feature by stabilizing `NonNull::len` This PR partially stabilizes features `const_slice_ptr_len` and `slice_ptr_len` by only stabilizing `NonNull::len`. This partial stabilization is tracked under features `slice_ptr_len_nonnull` and `const_slice_ptr_len_nonnull`, for which this PR can serve as the tracking issue. To summarize the discussion from #71146 leading up to this partial stabilization request: It's currently a bit footgunny to obtain the length of a raw slice pointer, stabilization of `NonNull:len` will help with removing these footguns. Some example footguns are: ```rust /// # Safety /// The caller must ensure that `ptr`: /// 1. does not point to memory that was previously allocated but is now deallocated; /// 2. is within the bounds of a single allocated object; /// 3. does not to point to a slice for which the length exceeds `isize::MAX` bytes; /// 4. points to a properly aligned address; /// 5. does not point to uninitialized memory; /// 6. does not point to a mutably borrowed memory location. pub unsafe fn ptr_len<T>(ptr: core::ptr::NonNull<[T]>) -> usize { (&*ptr.as_ptr()).len() } ``` A slightly less complicated version (but still more complicated than it needs to be): ```rust /// # Safety /// The caller must ensure that the start of `ptr`: /// 1. does not point to memory that was previously allocated but is now deallocated; /// 2. must be within the bounds of a single allocated object. pub unsafe fn ptr_len<T>(ptr: NonNull<[T]>) -> usize { (&*(ptr.as_ptr() as *const [()])).len() } ``` This PR does not stabilize `<*const [T]>::len` and `<*mut [T]>::len` because the tracking issue #71146 list a potential blocker for these methods, but this blocker [does not apply](https://github.com/rust-lang/rust/issues/71146#issuecomment-808735714) to `NonNull::len`. We should probably also ping the [Constant Evaluation WG](https://github.com/rust-lang/const-eval) since this PR includes a `#[rustc_allow_const_fn_unstable(const_slice_ptr_len)]`. My instinct here is that this will probably be okay because the pointer is not actually dereferenced and `len()` does not touch the address component of the pointer, but would be best to double check :) One potential down-side was raised that stabilizing `NonNull::len` could lead to encouragement of coding patterns like: ``` pub fn ptr_len<T>(ptr: *mut [T]) -> usize { NonNull::new(ptr).unwrap().len() } ``` which unnecessarily assert non-nullness. However, these are much less of a footgun than the above examples and this should be resolved when `slice_ptr_len` fully stabilizes eventually.
-
由 bors 提交于
Fix `x dist --stage 1 src/tools/rust-analyzer` Previously, this would break because the submodule wasn't checked out. Fixes https://github.com/rust-lang/rust/issues/97464.
-
由 bors 提交于
Add suggestion for relaxing static lifetime bounds on dyn trait impls in NLL This PR introduces suggestions for relaxing static lifetime bounds on impls of dyn trait items for NLL similar to what is already available in lexical region diagnostics. Fixes https://github.com/rust-lang/rust/issues/95701 r? `@estebank`
-
由 Josh Stone 提交于
-
由 bors 提交于
Pass Context as a &mut to allow to remove RefCell fields Fixes #90323. r? `@notriddle`
-
由 Jakob Degen 提交于
-
由 bors 提交于
Rollup of 6 pull requests Successful merges: - #95214 (Remove impossible panic note from `Vec::append`) - #97411 (Print stderr consistently) - #97453 (rename `TyKind` to `RegionKind` in comment in rustc_middle) - #97457 (Add regression test for #81899) - #97458 (Modify `derive(Debug)` to use `Self` in struct literal to avoid redundant error) - #97462 (Add more eslint rules) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
-
由 Matthias Krüger 提交于
Add more eslint rules The last one is the most useful of this batch. :) Here are the links for the eslint rules: * [arrow-parens](https://eslint.org/docs/rules/arrow-parens) * [no-unused-vars](https://eslint.org/docs/rules/no-unused-vars) * [eqeqeq](https://eslint.org/docs/rules/eqeqeq) r? `@notriddle`
-
由 Matthias Krüger 提交于
Modify `derive(Debug)` to use `Self` in struct literal to avoid redundant error Reduce verbosity in #97343.
-
由 Matthias Krüger 提交于
Add regression test for #81899 Closes #81899 r? `@compiler-errors`
-
由 Matthias Krüger 提交于
rename `TyKind` to `RegionKind` in comment in rustc_middle
-