Rollup of 6 pull requests#157044
Conversation
…literal was expected
Previously locally vendored dependencies wouldn't be reused when building the source tarball, instead everything would be downloaded from the internet again (if not in the cargo cache).
When a crate-level attribute like `#![feature(...)]` is used as an inner attribute inside a non-root module, the diagnostic now includes a help message pointing to the crate root file path, making it easier for users to find where the attribute should be placed.
Skip the "the crate root is at ..." help message when the misplaced crate-level attribute is already in the crate root file, since it adds no useful information in that case. Add a cross-file test to verify the help still appears when the attribute is in a different file from the crate root.
Place submod.rs under tests/ui/attributes/auxiliary/ and use #[path] to include it, matching the preferred compiletest test structure. Removes the need for //@ ignore-auxiliary.
Co-authored-by: Josh Stone <cuviper@gmail.com> Co-authored-by: alexey semenyuk <alexsemenyuk88@gmail.com>
relnotes for 1.96 r? @cuviper cc @rust-lang/release
…nt, r=oli-obk Add `TypeId` methods `variants` `fields` `field` for `type_info` Tracking issue rust-lang#146922 - Adds `fn TypeId::variants` returns the number of variants, for struct and union and primitive types, it's always 1. - Adds `fn TypeId::fields` returns the number of fields. - Adds `fn TypeId::field` returns a field representing type `FieldId`. - Adds a new type `FieldId`, which is a wrapper of `FieldRepresentingType`'s `TypeId`. For methods `{fields,field}`, if indexing out of bounds, a compile-time error will be raised. Regarding the removal of `Type` items, this will be done in a later PR in one go. r? @oli-obk
…hanBrouwer Suggest adding quotation marks to identifiers in attributes When the user provides an identifier when a literal was expected in an attribute value, suggest adding quotation marks to the identifier to make it a string literal. For instance: ``` error: attribute value must be a literal --> $DIR/crate-type-non-crate.rs:9:16 | LL | #[crate_type = lib] | ^^^ help: try adding quotation marks: `"lib"` ```
…ieyouxu Allow building the source tarballs while offline Previously locally vendored dependencies wouldn't be reused when building the source tarball, instead everything would be downloaded from the internet again (if not in the cargo cache). Fixes rust-lang#156982
…=nnethercote `#[expect]` is an attribute valid for outer style
…lp-in-attr-style-diagnostic, r=JonathanBrouwer Show crate root path in misplaced crate-level attribute diagnostic Fixes rust-lang#157001 If you put `#![feature(...)]` inside a non-root module, the diagnostic tells you it can only be used at the crate root, but never says where the crate root actually is. Not great if you're new to Rust or working in a big workspace with nested modules. Now the diagnostic includes a help line with the crate root file path when the misplaced attribute is an inner attribute. Outer attributes already get a span note pointing at what they're applied to, so they don't need this. Path goes through `RemapPathScopeComponents::DIAGNOSTICS` so `--remap-path-prefix` is respected. ``` warning: the `#![feature]` attribute can only be used at the crate root --> src/foo.rs:1:1 | LL | #![feature(test)] | ^^^^^^^^^^^^^^^^^ | = help: the crate root is at `src/main.rs` ```
|
@bors r+ rollup=never p=5 |
This comment has been minimized.
This comment has been minimized.
|
📌 Perf builds for each rolled up PR:
previous master: 8f02e856be In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing 8f02e85 (parent) -> 59bc26c (this PR) Test differencesShow 40 test diffsStage 1
Stage 2
Additionally, 36 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 59bc26c76496c81c01963b59bca3563b60be5722 --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
Finished benchmarking commit (59bc26c): comparison URL. Overall result: ❌✅ regressions and improvements - no action needed@rustbot label: -perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 0.6%, secondary 1.7%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 1.0%, secondary -3.6%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 511.209s -> 510.899s (-0.06%) |
Successful merges:
TypeIdmethodsvariantsfieldsfieldfortype_info#156403 (AddTypeIdmethodsvariantsfieldsfieldfortype_info)#[expect]is an attribute valid for outer style #157023 (#[expect]is an attribute valid for outer style)r? @ghost
Create a similar rollup