| Age | Commit message (Collapse) | Author | Lines |
|
[const prop] Fix "alloc id without corresponding allocation" ICE
r? @oli-obk
|
|
r=kinnison
Support anchors intra doc links
Fixes #62833
Part of #43466.
cc @ollie27
r? @kinnison
|
|
Allow `Unreachable` terminators through `min_const_fn` checks
Resolves #66756.
This allows `Unreachable` terminators through the `min_const_fn` checks if `#![feature(const_if_match)]` is enabled. We could probably just allow them with no feature flag, but it seems okay to be conservative here.
r? @oli-obk
|
|
Add wildcard test for const_if_match
Closes https://github.com/rust-lang/rust/issues/66758
Many thanks to @Centril for his help getting me started!
|
|
Various tweaks to diagnostic output
|
|
|
|
|
|
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
|
|
Add additional regression tests for PGO
This PR adds regression tests for making sure that
- instrumentation records the right counts for branches taken and functions called, and that
- the indirect call promotion pass actually is able to promote indirect calls.
r? @alexcrichton
|
|
|
|
Add version mismatch help message for unimplemented trait
Improves issue #22750
The error reporting for E0277 (the trait `X` is not implemented for `Foo`)
now checks whether `Foo` implements a trait with the same path as `X`,
which probably means that the programmer wanted to actually use only one
version of the trait `X` instead of the two.
Still open:
* the same diagnostic should be added for [the trait method case](https://github.com/rust-lang/rust/issues/22750#issuecomment-372077056)
* Showing the real crate versions would be nice, but rustc currently doesn't have that information [according to Esteban](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/diagnostics.20for.20crate.20version.20mismatch/near/180572989)
|
|
Add support for sanitizer recover and tracking origins of uninitialized memory
* Add support for sanitizer recovery `-Zsanitizer-recover=...` (equivalent to `-fsanitize-recover` in clang).
* Add support for tracking origins of uninitialized memory in MemorySanitizer `-Zsanitizer-memory-track-origins` (equivalent to `-fsanitize-memory-track-origins` in clang).
|
|
Closes https://github.com/rust-lang/rust/issues/66758
|
|
Fix opaque types resulting from projections in function signature
When we normalize the types in a function signature, we may end up
resolving a projection to an opaque type (e.g. `Self::MyType` when
we have `type MyType = impl SomeTrait`). When the projection is
resolved, we will instantiate the generic parameters into fresh
inference variables.
While we do want to normalize projections to opaque types, we don't want
to replace the explicit generic parameters (e.g. `T` in `impl
MyTrait<T>`) with inference variables. We want the opaque type in the
function signature to be eligible to be a defining use of that opaque
type - adding inference variables prevents this, since the opaque type
substs now appears to refer to some specific type, rather than a generic
type.
To resolve this issue, we inspect the opaque types in the function
signature after normalization. Any inference variables in the substs are
replaced with the corresponding generic parameter in the identity substs
(e.g. `T` in `impl MyTrait<T>`). Note that normalization is the only way
that we can end up with inference variables in opaque substs in a
function signature - users have no way of getting inference variables
into a function signature.
Note that all of this refers to the opaque type (ty::Opaque) and its
subst - *not* to the underlying type.
Fixes #59342
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Rollup of 7 pull requests
Successful merges:
- #65613 (Preserve whitespace inside one-backtick codeblocks)
- #66512 (Add unix::process::CommandExt::arg0)
- #66569 (GitHub Actions: preparations, part 1)
- #66678 (Remove useless line for error index generation)
- #66684 (Drive-by cleanup in region naming)
- #66694 (Add some comments to panic runtime)
- #66698 (tidy: Remove unused import)
Failed merges:
r? @ghost
|
|
Add unix::process::CommandExt::arg0
This allows argv[0] to be overridden on the executable's command-line. This also makes the program
executed independent of argv[0].
Does Fuchsia have the same semantics? I'm assuming so.
Addresses: #66510
|
|
|
|
Highlight parts of fn in type errors
When a type error arises between two fn items, fn pointers or tuples,
highlight only the differing parts of each.
Examples:
<img width="699" alt="" src="https://user-images.githubusercontent.com/1606434/69487597-ab561600-0e11-11ea-9b4e-d4fd9e91d5dc.png">
<img width="528" alt="" src="https://user-images.githubusercontent.com/1606434/69487207-9033d800-0e0a-11ea-93e3-8c4d002411a5.png">
<img width="468" alt="" src="https://user-images.githubusercontent.com/1606434/69487208-9033d800-0e0a-11ea-92e3-2b2cee120335.png">
<img width="775" alt="" src="https://user-images.githubusercontent.com/1606434/69487209-9033d800-0e0a-11ea-9e68-7f6ed5c8cb08.png">
|
|
Fix some issues with attributes on unnamed fields
Fixes https://github.com/rust-lang/rust/issues/66487
Fixes https://github.com/rust-lang/rust/issues/66555
|
|
|
|
Ast address-of
This is the parts of #64588 that don't affect MIR. If an address-of expression makes it to MIR lowering we error and lower to the best currently expressible approximation to limit further errors.
r? @Centril
|
|
Co-Authored-By: varkor <github@varkor.com>
|
|
Add some tests to verify that this case is never hit
|
|
|
|
When we normalize the types in a function signature, we may end up
resolving a projection to an opaque type (e.g. `Self::MyType` when
we have `type MyType = impl SomeTrait`). When the projection is
resolved, we will instantiate the generic parameters into fresh
inference variables.
While we do want to normalize projections to opaque types, we don't want
to replace the explicit generic parameters (e.g. `T` in `impl
MyTrait<T>`) with inference variables. We want the opaque type in the
function signature to be eligible to be a defining use of that opaque
type - adding inference variables prevents this, since the opaque type
substs now appears to refer to some specific type, rather than a generic
type.
To resolve this issue, we inspect the opaque types in the function
signature after normalization. Any inference variables in the substs are
replaced with the corresponding generic parameter in the identity substs
(e.g. `T` in `impl MyTrait<T>`). Note that normalization is the only way
that we can end up with inference variables in opaque substs in a
function signature - users have no way of getting inference variables
into a function signature.
Note that all of this refers to the opaque type (ty::Opaque) and its
subst - *not* to the underlying type.
Fixes #59342
|
|
rustc_plugin: Remove support for syntactic plugins
This part of the plugin interface was successfully replaced by token-based procedural macros in theory and in practice.
cc https://github.com/rust-lang/rust/issues/29597
cc https://github.com/rust-lang/rust/pull/64675
r? @Centril
|
|
|
|
|
|
|
|
Issue #22750
The error reporting for E0277 (the trait `X` is not implemented for `Foo`)
now checks whether `Foo` implements a trait with the same path as `X`,
which probably means that the programmer wanted to actually use only one
version of the trait `X` instead of the two.
|
|
Rework raw ident suggestions
Use heuristics to determine whethersuggesting raw identifiers is
appropriate.
Account for raw identifiers when printing a path in a `use` suggestion.
Fix #66126.
|
|
|
|
|
|
|
|
parser: recover on nested ADTs as enum variants
Closes: https://github.com/rust-lang/rust/issues/66127
|
|
Scope format! temporaries
This places the temporaries that `format!` generates to refer to its arguments (through `&dyn Trait`) in a short-lived scope surrounding just the invocation of `format!`. This enables `format!` to be used in generators without the temporaries preventing the generator from being `Send` (due to `dyn Trait` not being `Sync`).
See rust-lang/rust#64477 for details.
|
|
Use heuristics to determine whethersuggesting raw identifiers is
appropriate.
Account for raw identifiers when printing a path in a `use` suggestion.
|
|
When a type error arises between two fn items, fn pointers or tuples,
highlight only the differing parts of each.
|
|
r=GuillaumeGomez
rustdoc: Mark `--extern-private` as unstable
It's not even stable in rustc so it shouldn't be stable in rustdoc.
r? @kinnison
|
|
Point at type in `let` assignment on type errors
Fix #61067.
|
|
Stabilize cfg(doc)
cc #43781.
|
|
Fixes #66345
|
|
|