| Age | Commit message (Collapse) | Author | Lines |
|
Add unstable option to control doctest run directory
This option will allow splitting the compile-time from the run-time
directory of doctest invocations and is one step to solve
https://github.com/rust-lang/cargo/issues/8993#issuecomment-760088944
r? `@jyn514`
|
|
Replace version_check dependency with own version parsing code
This gives compiler maintainers a better degree of control
over how the version gets parsed and is a good way to ensure
that there are no changes of behaviour in the future.
Also, issue a warning if the version is invalid instead of erroring
so that we stay forwards compatible with possible future changes
of the versioning scheme.
Last, this improves the present test a little.
Fixes #79436
r? `@petrochenkov`
|
|
Expand assert!(expr, args..) to include $crate for hygiene on 2021.
This makes `assert!(expr, args..)` properly hygienic in Rust 2021.
This is part of rust-lang/rfcs#3007, see #80162.
Before edition 2021, this was a breaking change, as `std::panic` and `core::panic` are different. In edition 2021 they will be identical, making it possible to apply proper hygiene here.
|
|
Permit mutable references in all const contexts
fixes #71212
cc `@rust-lang/wg-const-eval` `@christianpoveda`
|
|
Target stack-probe support configurable finely
This adds capability to configure the target's stack probe support in a
more precise manner than just on/off. In particular now we allow
choosing between always inline-asm, always call or either one of those
depending on the LLVM version.
Note that this removes the ability to turn off the generation of the
stack-probe attribute. This is valid to replace it with inline-asm for all targets because
`probe-stack="inline-asm"` will not generate any machine code on targets
that do not currently support stack probes. This makes support for stack
probes on targets that don't have any right now automatic with LLVM
upgrades in the future.
(This is valid to do based on the fact that clang unconditionally sets
this attribute when `-fstack-clash-protection` is used, AFAICT)
cc #77885
r? `@cuviper`
|
|
Generate metadata by iterating on DefId instead of traversing the HIR tree 1/N
Sample from #80347.
|
|
This gives compiler maintainers a better degree of control
over how the version gets parsed and is a good way to ensure
that there are no changes of behaviour in the future.
Also, issue a warning if the version is invalid instead of erroring
so that we stay forwards compatible with possible future changes
of the versioning scheme.
Last, this improves the present test a little.
|
|
rustdoc: Fix visibility of trait and impl items
Fixes #81274.
r? `@jyn514`
|
|
Lower closure prototype after its body.
Fixes #79537.
r? `@Mark-Simulacrum`
|
|
mir: Improve size_of handling when arg is unsized
As discussed on Zulip with `@RalfJung.`
|
|
This option will allow splitting the compile-time from the run-time
directory of doctest invocations and is one step to solve
https://github.com/rust-lang/cargo/issues/8993#issuecomment-760088944
|
|
avoid promoting division, modulo and indexing operations that could fail
For division, `x / y` will still be promoted if `y` is a non-zero integer literal; however, `1/(1+1)` will not be promoted any more.
While at it, also see if we can reject promoting floating-point arithmetic (which are [complicated](https://github.com/rust-lang/unsafe-code-guidelines/issues/237) so maybe we should not promote them).
This will need a crater run to see if there's code out there that relies on these things being promoted.
If we can land this, promoteds in `fn`/`const fn` cannot fail to evaluate any more, which should let us do some simplifications in codegen/Miri!
Cc https://github.com/rust-lang/rfcs/pull/3027
Fixes https://github.com/rust-lang/rust/issues/61821
r? `@oli-obk`
|
|
|
|
|
|
|
|
|
|
mutability check
|
|
|
|
|
|
Improve diagnostics when parsing angle args
https://github.com/rust-lang/rust/pull/79266 introduced parsing of generic arguments in associated type constraints, this however resulted in possibly very confusing error messages in cases in which closing angle brackets were missing such as in `Vec<(u32, _, _) = vec![]`, which outputs an incorrectly parsed equality constraint error, as noted by `@cynecx.`
This PR tries to provide better error messages in such cases.
r? `@petrochenkov`
|
|
|
|
Add setgroups to std::os::unix::process::CommandExt
Should fix #38527. I'm not sure groups is the greatest name though.
|
|
|
|
|
|
Rollup of 10 pull requests
Successful merges:
- #80573 (Deny rustc::internal lints for rustdoc and clippy)
- #81173 (Expand docs on Iterator::intersperse)
- #81194 (Stabilize std::panic::panic_any.)
- #81202 (Don't prefix 0x for each segments in `dbg!(Ipv6)`)
- #81225 (Make 'docs' nullable in rustdoc-json output)
- #81227 (Remove doctree::StructType)
- #81233 (Document why not use concat! in dbg! macro)
- #81236 (Gracefully handle loop labels missing leading `'` in different positions)
- #81241 (Turn alloc's force_expr macro into a regular macro_rules.)
- #81242 (Enforce statically that `MIN_NON_ZERO_CAP` is calculated at compile time)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Gracefully handle loop labels missing leading `'` in different positions
Fix #81192.
* Account for labels when suggesting `loop` instead of `while true`
* Suggest `'a` when given `a` only when appropriate
* Add loop head span to hir
* Tweak error for invalid `break expr`
* Add more misspelled label tests
* Avoid emitting redundant "unused label" lint
* Parse loop labels missing a leading `'`
Each commit can be reviewed in isolation.
|
|
Combine instructions immediately
|
|
require gat substs to be invariant
fixes #69184, fixes #80766
r? `@matthewjasper` probably
|
|
|
|
|
|
|
|
|
|
|
|
Co-authored-by: Ashley Mannix <kodraus@hey.com>
|
|
|
|
Fix formatting for removed lints
- Don't add backticks for the reason a lint was removed. This is almost
never a code block, and when it is the backticks should be in the reason
itself.
- Don't assume clippy is the only tool that needs to be checked for
backwards compatibility
I split this out of https://github.com/rust-lang/rust/pull/80527/ because it kept causing tests to fail, and it's a good change to have anyway.
r? `@flip1995`
|
|
|
|
When encountering the following typo:
```rust
a: loop { break 'a; }
```
provide an appropriate suggestion.
|
|
|
|
|
|
Point at loop head on invalid `break expr`.
Suggest removing `expr` or using label if available.
|
|
When encountering a name `a` that isn't resolved, but a label `'a` is
found in the current ribs, only suggest `'a` if this name is the value
expression of a `break` statement.
Solve FIXME.
|
|
|
|
Force token collection to run when parsing nonterminals
Fixes #81007
Previously, we would fail to collect tokens in the proper place when
only builtin attributes were present. As a result, we would end up with
attribute tokens in the collected `TokenStream`, leading to duplication
when we attempted to prepend the attributes from the AST node.
We now explicitly track when token collection must be performed due to
nomterminal parsing.
|
|
|
|
|
|
|
|
Rollup of 11 pull requests
Successful merges:
- #79655 (Add Vec visualization to understand capacity)
- #80172 (Use consistent punctuation for 'Prelude contents' docs)
- #80429 (Add regression test for mutual recursion in obligation forest)
- #80601 (Improve grammar in documentation of format strings)
- #81046 (Improve unknown external crate error)
- #81178 (Visit only terminators when removing landing pads)
- #81179 (Fix broken links with `--document-private-items` in the standard library)
- #81184 (Remove unnecessary `after_run` function)
- #81185 (Fix ICE in mir when evaluating SizeOf on unsized type)
- #81187 (Fix typo in counters.rs)
- #81219 (Document security implications of std::env::temp_dir)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Fix ICE in mir when evaluating SizeOf on unsized type
Not quite ready yet. This tries to fix #80742 as discussed on [Zulip topic][1],
by using `delay_span_bug`.
I don't understand what `delay_span_bug` does. It seems like my error message
is never used. With this patch, in this program:
```rust
#![allow(incomplete_features)]
#![feature(const_evaluatable_checked)]
#![feature(const_generics)]
use std::fmt::Debug;
use std::marker::PhantomData;
use std::mem::size_of;
struct Inline<T>
where
[u8; size_of::<T>() + 1]: ,
{
_phantom: PhantomData<T>,
buf: [u8; size_of::<T>() + 1],
}
impl<T> Inline<T>
where
[u8; size_of::<T>() + 1]: ,
{
pub fn new(val: T) -> Inline<T> {
todo!()
}
}
fn main() {
let dst = Inline::<dyn Debug>::new(0); // line 27
}
```
these errors are printed, both for line 27 (annotated line above):
- "no function or associated item named `new` found for struct `Inline<dyn
Debug>` in the current scope"
- "the size for values of type `dyn Debug` cannot be known at compilation time"
Second error makes sense, but I'm not sure about the first one and why it's
even printed.
Finally, I'm not sure about the span passing in `const_eval`.
[1]: https://rust-lang.zulipchat.com/#narrow/stream/269128-miri/topic/Help.20fixing.20.2380742
|
|
Improve unknown external crate error
This improves error messages when unknown items in the crate root are encountered.
Fixes #63799
r? ```@estebank```
|