| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Signed-off-by: Sean Cross <sean@xobs.io>
|
|
r=Dylan-DPC
Tighten spans for bad fields in struct deriving `Copy`
r? `@estebank`
Closes #89137 for good, I think
Not sure if this is what you were looking for in https://github.com/rust-lang/rust/issues/89137#issuecomment-1146201791
|
|
Fix reachability analysis for const methods
Use `method_might_be_inlined` directly for `ImplItemKind::Fn` instead of duplicating the logic in `def_id_represents_local_inlined_item`.
This is parallel to how we use `item_might_be_inlined` for `ItemKind::Fn` in that same body.
Fixes #97708
|
|
Support the `#[expect]` attribute on fn parameters (RFC-2383)
A small PR to allow the `#[expect]` attribute on function parameters.
Nothing more to say, I hope everyone reading this has a lovely day.
---
r? ``@wesleywiser``
closes: https://github.com/rust-lang/rust/issues/97650
cc: https://github.com/rust-lang/rust/issues/85549
|
|
|
|
|
|
|
|
|
|
Do not ICE when failing to normalize during inlining.
Fixes https://github.com/rust-lang/rust/issues/97695
|
|
r=cjgillot
Add a suggestion to replace parentheses with angle brackets on associated trait constraint
This implements a requested suggestion FIXME in [`compiler/rustc_ast_lowering/src/lib.rs` ](https://github.com/rust-lang/rust/blob/9598b4b594c97dff66feb93522e22db500deea07/compiler/rustc_ast_lowering/src/lib.rs#L921)
The suggestion asks for the parentheses to either be replaced with angle brackets or removed completely depending on whether there are arguments provided within.


r? `@oli-obk`
|
|
|
|
|
|
|
|
Remove all json handling from rustc_serialize
Json is now handled using serde_json. Where appropriate I have replaced json usage with binary serialization (rmeta files) or manual string formatting (emcc linker arg generation).
This allowed for removing and simplifying a lot of code, which hopefully results in faster serialization/deserialization and faster compiles of rustc itself.
Where sensible we now use serde. Metadata and incr cache serialization keeps using a heavily modified (compared to crates.io) rustc-serialize version that in the future could probably be extended with zero-copy deserialization or other perf tricks that serde can't support due to supporting more than one serialization format.
Note that I had to remove `-Zast-json` and `-Zast-json-noexpand` as the relevant AST types don't implement `serde::Serialize`.
Fixes #40177
See also https://github.com/rust-lang/compiler-team/issues/418
|
|
|
|
|
|
|
|
|
|
Rollup of 3 pull requests
Successful merges:
- #97415 (Compute `is_late_bound_map` query separately from lifetime resolution)
- #97471 (Provide more context when denying invalid type params )
- #97681 (Add more eslint checks)
Failed merges:
- #97446 (Make hir().get_generics and generics_of consistent.)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Provide more context when denying invalid type params
|
|
rewrite error handling for unresolved inference vars
Pretty much completely rewrites `fn emit_inference_failure_err`.
This new setup should hopefully be easier to extend and is already a lot better when looking for generic arguments.
Because this is a rewrite there are still some parts which are lacking, these are tracked in #94483 and will be fixed in later PRs.
r? `@estebank` `@petrochenkov`
|
|
Rollup of 5 pull requests
Successful merges:
- #97366 (Stabilize `{slice,array}::from_ref`)
- #97653 (add cast kind of from_exposed_addr (int-to-ptr casts))
- #97663 (take back half-baked noaliasing check in Assignment)
- #97664 (On E0204 suggest missing type param bounds)
- #97668 (rustdoc: clean up primitive.slice.html links)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
rustdoc: clean up primitive.slice.html links
Before: <a href="https://doc.rust-lang.org/stable/std/boxed/struct.Box.html">Box</a><<a href="https://doc.rust-lang.org/stable/std/primitive.slice.html">[</a>T<a href="https://doc.rust-lang.org/stable/std/primitive.slice.html">]</a>>
After: <a href="https://doc.rust-lang.org/stable/std/boxed/struct.Box.html">Box</a><<a href="https://doc.rust-lang.org/stable/std/primitive.slice.html">[T]</a>>
|
|
On E0204 suggest missing type param bounds
```
error[E0204]: the trait `Copy` may not be implemented for this type
--> f42.rs:9:17
|
9 | #[derive(Debug, Copy, Clone)]
| ^^^^
10 | pub struct AABB<K>{
11 | pub loc: Vector2<K>,
| ------------------- this field does not implement `Copy`
12 | pub size: Vector2<K>
| -------------------- this field does not implement `Copy`
|
note: the `Copy` impl for `Vector2<K>` requires that `K: Debug`
--> f42.rs:11:5
|
11 | pub loc: Vector2<K>,
| ^^^^^^^^^^^^^^^^^^^
note: the `Copy` impl for `Vector2<K>` requires that `K: Debug`
--> f42.rs:12:5
|
12 | pub size: Vector2<K>
| ^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider restricting type parameter `K`
|
10 | pub struct AABB<K: Debug>{
| +++++++
```
Fix #89137.
|
|
add cast kind of from_exposed_addr (int-to-ptr casts)
This is basically the dual to https://github.com/rust-lang/rust/pull/97582, for int2ptr casts.
Cc `@tmiasko` https://github.com/rust-lang/rust/issues/97649
|
|
Remove label/lifetime shadowing warnings
This PR removes some pre-1.0 shadowing warnings for labels and lifetimes.
The current behaviour of the compiler is to warn
* labels that shadow unrelated labels in the same function --> removed
```rust
'a: loop {}
'a: loop {} // STOP WARNING
```
* labels that shadow enclosing labels --> kept, but only if shadowing is hygienic
```rust
'a: loop {
'a: loop {} // KEEP WARNING
}
```
* labels that shadow lifetime --> removed
```rust
fn foo<'a>() {
'a: loop {} // STOP WARNING
}
```
* lifetimes that shadow labels --> removed
```rust
'a: loop {
let b = Box::new(|x: &i8| *x) as Box<dyn for <'a> Fn(&'a i8) -> i8>; // STOP WARNING
}
```
* lifetimes that shadow lifetimes --> kept
```rust
fn foo<'a>() {
let b = Box::new(|x: &i8| *x) as Box<dyn for <'a> Fn(&'a i8) -> i8>; // KEEP WARNING
}
```
Closes https://github.com/rust-lang/rust/issues/31745.
-----
From `@petrochenkov` in https://github.com/rust-lang/rust/pull/95781#issuecomment-1105199014
> I think we should remove these silly checks entirely.
> They were introduced long time ago in case some new language features appear and require this space.
> Now we have another mechanism for such language changes - editions, and if "lifetimes in expressions" or something like that needs to be introduced it could be introduced as an edition change.
> However, there was no plans to introduce anything like for years, so it's unlikely that even the edition mechanism will be necessary.
r? rust-lang/lang
|
|
|
|
|
|
Move some tests to more reasonable places
r? `@petrochenkov`
|
|
|
|
|
|
|
|
don't use a `span_note` for ignored impls
Searching for the `derive` isn't too difficult as it's right above the field definition.
By using a span these errors are a lot more verbose than they should be, which is especially annoying as one can end up with a lot of `dead_code` warnings.
|
|
TaKO8Ki:fix-wrong-suggestion-for-adding-where-clauses, r=lcnr
Fix wrong suggestion for adding where clauses
closes #97576
|
|
update explicit impls error msg
|
|
rustdoc: Add more test coverage
Related issue https://github.com/rust-lang/rust/issues/91113
|
|
```
error[E0204]: the trait `Copy` may not be implemented for this type
--> f42.rs:9:17
|
9 | #[derive(Debug, Copy, Clone)]
| ^^^^
10 | pub struct AABB<K>{
11 | pub loc: Vector2<K>,
| ------------------- this field does not implement `Copy`
12 | pub size: Vector2<K>
| -------------------- this field does not implement `Copy`
|
note: the `Copy` impl for `Vector2<K>` requires that `K: Debug`
--> f42.rs:11:5
|
11 | pub loc: Vector2<K>,
| ^^^^^^^^^^^^^^^^^^^
note: the `Copy` impl for `Vector2<K>` requires that `K: Debug`
--> f42.rs:12:5
|
12 | pub size: Vector2<K>
| ^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider restricting type parameter `K`
|
10 | pub struct AABB<K: Debug>{
| +++++++
```
Fix #89137.
|
|
|
|
|
|
|
|
|
|
Rollup of 5 pull requests
Successful merges:
- #97420 (Be a little nicer with casts when formatting `fn` pointers)
- #97450 ([RFC 2011] Basic compiler infrastructure)
- #97599 (Fix JSON reexport ICE)
- #97617 (Rustdoc anonymous reexports)
- #97636 (Revert #96682.)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
|
|
Revert #96682.
The change was "Show invisible delimiters (within comments) when pretty
printing". It's useful to show these delimiters, but is a breaking
change for some proc macros.
Fixes #97608.
r? ``@petrochenkov``
|
|
Rustdoc anonymous reexports
Fixes #97615.
r? `@Nemo157`
|
|
Fix JSON reexport ICE
Fixes https://github.com/rust-lang/rust/issues/97432.
The problem was that the ID was conflicting because the reexports have the same one. To fix it, I "extended" it by adding the `Symbol` into it as well.
r? `@notriddle`
|
|
[RFC 2011] Basic compiler infrastructure
Splitting https://github.com/rust-lang/rust/pull/96496 into smaller pieces as was done in https://github.com/rust-lang/rust/pull/97233. Hope review will be easier.
This PR practically contains no logic and only serves as a building ground for the actual code that will be placed in a posterior step.
* Adds `context.rs` to place the new `assert!` logic. Has a lot of unused elements but all of them are used by the implementation.
* Creates an unstable flag because the feature is not yet complete and also to allow external feedback.
* Creates the necessary `sym` identifiers that are mostly based on the library elements -> https://github.com/rust-lang/rust/blob/master/library/core/src/asserting.rs
* Modifies `assert.rs` to branch to `context.rs` if the unstable flag is enabled.
* Adds a test to satisfy tidy but the test does nothing in reality.
|