| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
Unimplement unsized_locals
Implements https://github.com/rust-lang/compiler-team/issues/630
Tracking issue here: https://github.com/rust-lang/rust/issues/111942
Note that this just removes the feature, not the implementation, and does not touch `unsized_fn_params`. This is because it is required to support `Box<dyn FnOnce()>: FnOnce()`.
There may be more that should be removed (possibly in follow up prs)
- the `forget_unsized` function and `forget` intrinsic.
- the `unsized_locals` test directory; I've just fixed up the tests for now
- various codegen support for unsized values and allocas
cc ``@JakobDegen`` ``@oli-obk`` ``@Noratrieb`` ``@programmerjake`` ``@bjorn3``
``@rustbot`` label F-unsized_locals
Fixes rust-lang/rust#79409
|
|
[rustdoc] Give more information into extracted doctest information
Follow-up of https://github.com/rust-lang/rust/pull/134531.
This update fragment the doctest code into its sub-parts to give more control to the end users on how they want to use it.
The new JSON looks like this:
```json
{
"format_version":2,
"doctests":[
{
"file":"$DIR/extract-doctests-result.rs",
"line":8,
"doctest_attributes":{
"original":"",
"should_panic":false,
"no_run":false,
"ignore":"None",
"rust":true,
"test_harness":false,
"compile_fail":false,
"standalone_crate":false,
"error_codes":[],
"edition":null,
"added_css_classes":[],
"unknown":[]
},
"original_code":"let x = 12;\nOk(())",
"doctest_code":{
"crate_level":"#![allow(unused)]\n",
"code":"let x = 12;\nOk(())",
"wrapper":{
"before":"fn main() { fn _inner() -> core::result::Result<(), impl core::fmt::Debug> {\n",
"after":"\n} _inner().unwrap() }",
"returns_result":true
}
},
"name":"$DIR/extract-doctests-result.rs - (line 8)"
}
]
}
```
for this doctest:
```rust
let x = 12;
Ok(())
```
With this, I think it matches what you need ``@ojeda?`` If so, once merged I'll update the patch I sent to RfL.
r? ``@aDotInTheVoid``
|
|
Temporary lifetime extension through tuple struct and tuple variant constructors
This makes temporary lifetime extension work for tuple struct and tuple variant constructors, such as `Some()`.
Before:
```rust
let a = &temp(); // Extended
let a = Some(&temp()); // Not extended :(
let a = Some { 0: &temp() }; // Extended
```
After:
```rust
let a = &temp(); // Extended
let a = Some(&temp()); // Extended
let a = Some { 0: &temp() }; // Extended
```
So, with this change, this works:
```rust
let a = Some(&String::from("hello")); // New: String lifetime now extended!
println!("{a:?}");
```
Until now, we did not extend through tuple struct/variant constructors (like `Some`), because they are function calls syntactically, and we do not want to extend the String lifetime in:
```rust
let a = some_function(&String::from("hello")); // String not extended!
```
However, it turns out to be very easy to distinguish between regular functions and constructors at the point where we do lifetime extension.
In practice, constructors nearly always use UpperCamelCase while regular functions use lower_snake_case, so it should still be easy to for a human programmer at the call site to see whether something qualifies for lifetime extension or not.
This needs a lang fcp.
---
More examples of what will work after this change:
```rust
let x = Person {
name: "Ferris",
job: Some(&Job { // `Job` now extended!
title: "Chief Rustacean",
organisation: "Acme Ltd.",
}),
};
dbg!(x);
```
```rust
let file = if use_stdout {
None
} else {
Some(&File::create("asdf")?) // `File` now extended!
};
set_logger(file);
```
```rust
use std::path::Component;
let c = Component::Normal(&OsString::from(format!("test-{num}"))); // OsString now extended!
assert_eq!(path.components.first().unwrap(), c);
```
|
|
|
|
|
|
remove `pref_align_of` intrinsic handling, rename `{min_=>}align_of{,_val}`
|
|
|
|
|
|
Rollup of 16 pull requests
Successful merges:
- rust-lang/rust#140969 (Allow initializing logger with additional tracing Layer)
- rust-lang/rust#141352 (builtin dyn impl no guide inference)
- rust-lang/rust#142046 (add Vec::peek_mut)
- rust-lang/rust#142273 (tests: Minicore `extern "gpu-kernel"` feature test)
- rust-lang/rust#142302 (Rework how the disallowed qualifier in function type diagnostics are generated)
- rust-lang/rust#142405 (Don't hardcode the intrinsic return types twice in the compiler)
- rust-lang/rust#142434 ( Pre-install JS dependencies in tidy Dockerfile)
- rust-lang/rust#142439 (doc: mention that intrinsics should not be called in user code)
- rust-lang/rust#142441 (Delay replacing escaping bound vars in `FindParamInClause`)
- rust-lang/rust#142449 (Require generic params for const generic params)
- rust-lang/rust#142452 (Remove "intermittent" wording from `ReadDir`)
- rust-lang/rust#142459 (Remove output helper bootstrap)
- rust-lang/rust#142460 (cleanup search graph impl)
- rust-lang/rust#142461 (compiletest: Clarify that `--no-capture` is needed with `--verbose`)
- rust-lang/rust#142475 (Add platform support docs & maintainers for *-windows-msvc)
- rust-lang/rust#142480 (tests: Convert two handwritten minicores to add-core-stubs)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
Add platform support docs & maintainers for *-windows-msvc
Thanks to `@ChrisDenton,` `@dpaoliello,` `@lambdageek` and `@sivadeilra` for agreeing to be target maintainers!
cc rust-lang/rust#113739
|
|
compiletest: Clarify that `--no-capture` is needed with `--verbose`
Confusingly, this does not make compile test print what command is used to run a ui test:
./x test tests/ui/panics/abort-on-panic.rs --verbose
It is also necessary to pass `--no-capture`, like this:
./x test tests/ui/panics/abort-on-panic.rs --verbose --no-capture
Then you will see prints like this:
executing cd "/rust/build/x86_64-unknown-linux-gnu/test/ui/panics/abort-on-panic.next" && \
RUSTC="/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" \
RUST_TEST_THREADS="32" \
"/rust/build/x86_64-unknown-linux-gnu/test/ui/panics/abort-on-panic.next/a"
Add a hint in the code for this that would have helped me figure this out.
(See https://rust-lang.zulipchat.com/#narrow/channel/122651-general/topic/compiltest.20show.20rustc.20commands.3F for some more context.)
|
|
Remove output helper bootstrap
This PR removes output utility helper method.
r? `@Kobzol`
|
|
Delay replacing escaping bound vars in `FindParamInClause`
By uplifting the `BoundVarReplacer`, which is used by (e.g.) normalization to replace escaping bound vars that are encountered when folding binders, we can use a similar strategy to delay the instantiation of a binder's contents in the `FindParamInClause` used by the new trait solver.
This should alleviate the recently added requirement that `Binder<T>: TypeVisitable` only if `T: TypeFoldable`, which was previously required b/c we were calling `enter_forall` so that we could structurally normalize aliases that we found within the predicates of a param-env clause.
r? lcnr
|
|
Pre-install JS dependencies in tidy Dockerfile
Also fixes passing `TIDY_PRINT_DIFF` to tidy, which has been passed to `npm install` rather than to tidy after the latest change here.
r? `@GuillaumeGomez`
Fixes: https://github.com/rust-lang/rust/issues/142433
|
|
Build rustc with assertions in `dist-alt` jobs
Revival of https://github.com/rust-lang/rust/pull/131077, to check CI times now that we don't do PGO/BOLT anymore on Linux `-alt` builds.
r? `@ghost`
try-job: dist-x86_64-msvc-alt
try-job: dist-x86_64-linux-alt
|
|
|
|
This works in rustc. This change isn't motivated by any real code.
I just learned about it and decided to see why it doesn't work with
rust-analyzer.
|
|
|
|
|
|
|
|
|
|
Rollup of 9 pull requests
Successful merges:
- rust-lang/rust#128425 (Make `missing_fragment_specifier` an unconditional error)
- rust-lang/rust#135927 (retpoline and retpoline-external-thunk flags (target modifiers) to enable retpoline-related target features)
- rust-lang/rust#140770 (add `extern "custom"` functions)
- rust-lang/rust#142176 (tests: Split dont-shuffle-bswaps along opt-levels and arches)
- rust-lang/rust#142248 (Add supported asm types for LoongArch32)
- rust-lang/rust#142267 (assert more in release in `rustc_ast_lowering`)
- rust-lang/rust#142274 (Update the stdarch submodule)
- rust-lang/rust#142276 (Update dependencies in `library/Cargo.lock`)
- rust-lang/rust#142308 (Upgrade `object`, `addr2line`, and `unwinding` in the standard library)
Failed merges:
- rust-lang/rust#140920 (Extract some shared code from codegen backend target feature handling)
r? `@ghost`
`@rustbot` modify labels: rollup
try-job: aarch64-apple
try-job: x86_64-msvc-1
try-job: x86_64-gnu
try-job: dist-i586-gnu-i586-i686-musl
try-job: test-various
|
|
Remove `InternedCallableDefId`
|
|
Confusingly, this does not make compile test print what command is used
to run a ui test:
./x test tests/ui/panics/abort-on-panic.rs --verbose
It is also necessary to pass `--no-capture`, like this:
./x test tests/ui/panics/abort-on-panic.rs --verbose --no-capture
Now you will see prints like this:
executing cd "/rust/build/x86_64-unknown-linux-gnu/test/ui/panics/abort-on-panic.next" && \
RUSTC="/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" \
RUST_TEST_THREADS="32" \
"/rust/build/x86_64-unknown-linux-gnu/test/ui/panics/abort-on-panic.next/a"
Add a hint in the code for this that would have helped me figure this out.
|
|
It's unnecessary
|
|
|
|
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
|
|
Clippy subtree update
r? `@Manishearth`
1 day late. Got distracted yesterday evening and forgot about it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Rollup of 10 pull requests
Successful merges:
- rust-lang/rust#134847 (Implement asymmetrical precedence for closures and jumps)
- rust-lang/rust#141491 (Delegate `<CStr as Debug>` to `ByteStr`)
- rust-lang/rust#141770 (Merge `Cfg::render_long_html` and `Cfg::render_long_plain` methods common code)
- rust-lang/rust#142069 (Introduce `-Zmacro-stats`)
- rust-lang/rust#142158 (Tracking the old name of renamed unstable library features)
- rust-lang/rust#142221 ([AIX] strip underlying xcoff object)
- rust-lang/rust#142340 (miri: we can use apfloat's mul_add now)
- rust-lang/rust#142379 (Add bootstrap option to compile a tool with features)
- rust-lang/rust#142410 (intrinsics: rename min_align_of to align_of)
- rust-lang/rust#142413 (rustc-dev-guide subtree update)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Generate annotations for macro defined items if their name is in the input
|
|
|
|
Simplify and optimize `ItemTree`
|
|
|
|
|
|
clippy-subtree-update
|
|
|
|
Updating adler2 v2.0.0 -> v2.0.1
Updating anyhow v1.0.97 -> v1.0.98
Updating bitflags v2.9.0 -> v2.9.1
Updating borsh v1.5.5 -> v1.5.7
Updating boxcar v0.2.12 -> v0.2.13
Updating camino v1.1.9 -> v1.1.10
Updating cc v1.2.16 -> v1.2.26
Updating cfg-if v1.0.0 -> v1.0.1
Updating flate2 v1.1.1 -> v1.1.2
Updating foldhash v0.1.4 -> v0.1.5
Updating getrandom v0.2.15 -> v0.2.16
Updating hashbrown v0.15.2 -> v0.15.4
Updating hermit-abi v0.3.9 -> v0.5.2
Updating icu_collections v1.5.0 -> v2.0.0
Adding icu_locale_core v2.0.0
Removing icu_locid v1.5.0
Removing icu_locid_transform v1.5.0
Removing icu_locid_transform_data v1.5.0
Updating icu_normalizer v1.5.0 -> v2.0.0
Updating icu_normalizer_data v1.5.0 -> v2.0.0
Updating icu_properties v1.5.1 -> v2.0.1
Updating icu_properties_data v1.5.0 -> v2.0.1
Updating icu_provider v1.5.0 -> v2.0.0
Removing icu_provider_macros v1.5.0
Updating idna_adapter v1.2.0 -> v1.2.1
Updating kqueue v1.0.8 -> v1.1.1
Updating libloading v0.8.7 -> v0.8.8
Updating libmimalloc-sys v0.1.40 -> v0.1.42
Updating litemap v0.7.5 -> v0.8.0
Updating lock_api v0.4.12 -> v0.4.13
Updating log v0.4.26 -> v0.4.27
Updating memchr v2.7.4 -> v2.7.5
Updating mimalloc v0.1.44 -> v0.1.46
Updating miniz_oxide v0.8.5 -> v0.8.9
Updating mio v1.0.3 -> v1.0.4
Updating num_cpus v1.16.0 -> v1.17.0
Updating once_cell v1.21.1 -> v1.21.3
Updating parking_lot v0.12.3 -> v0.12.4
Updating parking_lot_core v0.9.10 -> v0.9.11
Updating portable-atomic v1.11.0 -> v1.11.1
Adding potential_utf v0.1.2
Updating proc-macro2 v1.0.94 -> v1.0.95
Updating redox_syscall v0.5.10 -> v0.5.13
Updating rustc-demangle v0.1.24 -> v0.1.25
Updating rustc_apfloat v0.2.2+llvm-462a31f5a5ab -> v0.2.3+llvm-462a31f5a5ab
Updating serde_spanned v0.6.8 -> v0.6.9
Updating smallvec v1.14.0 -> v1.15.1
Updating syn v2.0.100 -> v2.0.103
Updating synstructure v0.13.1 -> v0.13.2
Updating tenthash v1.0.0 -> v1.1.0
Updating thread_local v1.1.8 -> v1.1.9
Updating time v0.3.40 -> v0.3.41
Updating time-macros v0.2.21 -> v0.2.22
Updating tinystr v0.7.6 -> v0.8.1
Updating toml v0.8.20 -> v0.8.23
Updating toml_datetime v0.6.8 -> v0.6.11
Updating toml_edit v0.22.24 -> v0.22.27
Adding toml_write v0.1.2
Updating tracing-attributes v0.1.28 -> v0.1.29
Updating tracing-core v0.1.33 -> v0.1.34
Removing utf16_iter v1.0.5
Updating wasi v0.11.0+wasi-snapshot-preview1 -> v0.11.1+wasi-snapshot-preview1
Updating windows v0.61.1 -> v0.61.3
Updating windows-core v0.61.0 -> v0.61.2
Updating windows-future v0.2.0 -> v0.2.1
Updating windows-link v0.1.1 -> v0.1.3
Updating windows-result v0.3.2 -> v0.3.4
Updating windows-strings v0.4.0 -> v0.4.2
Adding windows-sys v0.60.2
Updating windows-targets v0.53.0 -> v0.53.2
Adding windows-threading v0.1.0
Updating winnow v0.7.3 -> v0.7.11
Removing write16 v1.0.0
Updating writeable v0.5.5 -> v0.6.1
Updating yoke v0.7.5 -> v0.8.0
Updating yoke-derive v0.7.5 -> v0.8.0
Adding zerotrie v0.2.2
Updating zerovec v0.10.4 -> v0.11.2
Updating zerovec-derive v0.10.3 -> v0.11.1
|
|
|
|
|
|
|