Skip to content

Rollup of 7 pull requests #139996

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 34 commits into from
Apr 18, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
9eb6a54
sync::mpsc: add miri reproducer of double free
petrosagg Apr 10, 2025
b9e2ac5
sync::mpsc: prevent double free on `Drop`
petrosagg Apr 8, 2025
f35eae7
store the kind of pattern adjustments in `pat_adjustments`
dianne Mar 15, 2025
2907ab5
Move `is_builder_target`, `is_system_llvm` and `is_rust_llvm` from `B…
Kobzol Apr 15, 2025
3c01dfe
Rename `is_builder_target` to `is_host_target`
Kobzol Apr 15, 2025
8c50f95
rustdoc: Output target feature information
willglynn Apr 4, 2025
a870bba
Add a warning when combining LLD with external LLVM config
Kobzol Apr 16, 2025
cb6c499
lower implicit deref patterns to THIR
dianne Feb 24, 2025
e4b7b3d
pattern typing for immutable implicit deref patterns
dianne Mar 9, 2025
91d0b57
register `DerefMut` bounds for implicit mutable derefs
dianne Mar 9, 2025
d6df469
refactor path pattern checking to get info for peeling
dianne Apr 7, 2025
9196048
refactor struct pattern checking to get info for peeling
dianne Mar 4, 2025
1f40e9a
refactor tuple struct pattern checking to get info for peeling
dianne Mar 4, 2025
923d95c
don't peel ADTs the pattern could match
dianne Mar 9, 2025
977c9ab
respect the tcx's recursion limit when peeling
dianne Mar 10, 2025
ff0d4bc
upvar inference for implicit deref patterns
dianne Mar 14, 2025
4c4b61b
add a feature gate test
dianne Mar 14, 2025
93d13e9
add an unstable book chapter
dianne Mar 14, 2025
3b91b7a
Make cow_of_cow test a teeny bit more explicit
Nadrieril Apr 16, 2025
92ce44f
ignore aix for tests/ui/erros/pic-linker.rs
Apr 16, 2025
4be670f
Warnings-as-errors in `check-builtin-attr-ice.rs`.
nnethercote Apr 9, 2025
400e8e5
Fix attribute printing in an error.
nnethercote Apr 9, 2025
7e1f2f9
Augment some tests involving attributes.
nnethercote Apr 10, 2025
2fef0a3
Replace infallible `name_or_empty` methods with fallible `name` methods.
nnethercote Apr 10, 2025
846c10f
Avoid an `unwrap` in `RustcMirAttrs::set_field`.
nnethercote Apr 15, 2025
6214674
rustdoc/clean: Change terminology of items pertaining to (formal) fn …
fmease Apr 15, 2025
82ff0a0
rustdoc: Properly clean fn params in all contexts
fmease Apr 16, 2025
c8a9095
Rollup merge of #138528 - dianne:implicit-deref-patterns, r=Nadrieril
matthiaskrgr Apr 18, 2025
e15cf92
Rollup merge of #139393 - willglynn:rustdoc_output_target_feature_inf…
matthiaskrgr Apr 18, 2025
5e8bc7f
Rollup merge of #139553 - petrosagg:channel-double-free, r=RalfJung,t…
matthiaskrgr Apr 18, 2025
540fb22
Rollup merge of #139615 - nnethercote:rm-name_or_empty, r=jdonszelmann
matthiaskrgr Apr 18, 2025
ac00a37
Rollup merge of #139853 - Kobzol:lld-llvm-config, r=onur-ozkan
matthiaskrgr Apr 18, 2025
cbf2662
Rollup merge of #139913 - fmease:rustdoc-fix-fn-param-handling, r=Gui…
matthiaskrgr Apr 18, 2025
8cb57ed
Rollup merge of #139942 - dalvescb:master, r=jieyouxu
matthiaskrgr Apr 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix attribute printing in an error.
The current code assumes that the attribute is just an identifier, and
so misprints paths.
  • Loading branch information
nnethercote committed Apr 16, 2025
commit 400e8e5dc819b1fa7f994fb60dbe8b5112ec3fd2
5 changes: 4 additions & 1 deletion compiler/rustc_passes/src/check_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -561,12 +561,15 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
allowed_target: Target,
) {
if target != allowed_target {
let path = attr.path();
let path: Vec<_> = path.iter().map(|s| s.as_str()).collect();
let attr_name = path.join("::");
self.tcx.emit_node_span_lint(
UNUSED_ATTRIBUTES,
hir_id,
attr.span(),
errors::OnlyHasEffectOn {
attr_name: attr.name_or_empty(),
attr_name,
target_name: allowed_target.name().replace(' ', "_"),
},
);
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_passes/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1433,7 +1433,7 @@ pub(crate) struct UselessAssignment<'a> {
#[derive(LintDiagnostic)]
#[diag(passes_only_has_effect_on)]
pub(crate) struct OnlyHasEffectOn {
pub attr_name: Symbol,
pub attr_name: String,
pub target_name: String,
}

Expand Down
4 changes: 2 additions & 2 deletions tests/ui/attributes/check-builtin-attr-ice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@
struct Foo {
#[should_panic::skip]
//~^ ERROR failed to resolve
//~| ERROR `#[]` only has an effect on functions
//~| ERROR `#[should_panic::skip]` only has an effect on functions
pub field: u8,

#[should_panic::a::b::c]
//~^ ERROR failed to resolve
//~| ERROR `#[]` only has an effect on functions
//~| ERROR `#[should_panic::a::b::c]` only has an effect on functions
pub field2: u8,
}

Expand Down
4 changes: 2 additions & 2 deletions tests/ui/attributes/check-builtin-attr-ice.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ error[E0433]: failed to resolve: use of unresolved module or unlinked crate `den
LL | #[deny::skip]
| ^^^^ use of unresolved module or unlinked crate `deny`

error: `#[]` only has an effect on functions
error: `#[should_panic::skip]` only has an effect on functions
--> $DIR/check-builtin-attr-ice.rs:45:5
|
LL | #[should_panic::skip]
Expand All @@ -28,7 +28,7 @@ note: the lint level is defined here
LL | #![deny(unused_attributes)]
| ^^^^^^^^^^^^^^^^^

error: `#[]` only has an effect on functions
error: `#[should_panic::a::b::c]` only has an effect on functions
--> $DIR/check-builtin-attr-ice.rs:50:5
|
LL | #[should_panic::a::b::c]
Expand Down