Skip to content

Commit 35487a2

Browse files
committed
Auto merge of #144294 - matthiaskrgr:rollup-ybvall3, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #142454 (Add modern AVR mcus like avr128db28 and attiny3224) - #142924 (tidy: move rustdoc js stuff into a tidy extra check) - #143373 (Unquerify maybe_unused_trait_imports.) - #144082 (tests: cover more `exported_private_dependencies` cases) - #144126 (Fix empty target_config in apply_rust_config bootstrap) - #144164 ( opt-dist: add an option for setting path to stage0 root) - #144265 (Dont ICE on copy error being suppressed due to overflow) r? `@ghost` `@rustbot` modify labels: rollup
2 parents c0b282f + 749f895 commit 35487a2

File tree

36 files changed

+3821
-185
lines changed

36 files changed

+3821
-185
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ __pycache__/
8585

8686
## Node
8787
node_modules
88-
package-lock.json
89-
package.json
9088
/src/doc/rustc-dev-guide/mermaid.min.js
9189

9290
## Rustdoc GUI tests

REUSE.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ path = [
3737
"rust-bors.toml",
3838
"triagebot.toml",
3939
"typos.toml",
40+
"package.json",
41+
"package-lock.json",
4042
"x",
4143
"x.ps1",
4244
"x.py",

compiler/rustc_borrowck/src/diagnostics/move_errors.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -303,10 +303,11 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
303303
}
304304

305305
fn has_ambiguous_copy(&mut self, ty: Ty<'tcx>) -> bool {
306-
let Some(copy_trait_def) = self.infcx.tcx.lang_items().copy_trait() else { return false };
307-
// This is only going to be ambiguous if there are incoherent impls, because otherwise
308-
// ambiguity should never happen in MIR.
309-
self.infcx.type_implements_trait(copy_trait_def, [ty], self.infcx.param_env).may_apply()
306+
let Some(copy_def_id) = self.infcx.tcx.lang_items().copy_trait() else { return false };
307+
308+
// Avoid bogus move errors because of an incoherent `Copy` impl.
309+
self.infcx.type_implements_trait(copy_def_id, [ty], self.infcx.param_env).may_apply()
310+
&& self.infcx.tcx.coherent_trait(copy_def_id).is_err()
310311
}
311312

312313
fn report_cannot_move_from_static(&mut self, place: Place<'tcx>, span: Span) -> Diag<'infcx> {

compiler/rustc_hir_analysis/src/check_unused.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub(super) fn check_unused_traits(tcx: TyCtxt<'_>, (): ()) {
1818
used_trait_imports.extend_unord(imports.items().copied());
1919
}
2020

21-
for &id in tcx.maybe_unused_trait_imports(()) {
21+
for &id in tcx.resolutions(()).maybe_unused_trait_imports.iter() {
2222
debug_assert_eq!(tcx.def_kind(id), DefKind::Use);
2323
if tcx.visibility(id).is_public() {
2424
continue;

compiler/rustc_middle/src/query/mod.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2285,9 +2285,6 @@ rustc_queries! {
22852285
query upvars_mentioned(def_id: DefId) -> Option<&'tcx FxIndexMap<hir::HirId, hir::Upvar>> {
22862286
desc { |tcx| "collecting upvars mentioned in `{}`", tcx.def_path_str(def_id) }
22872287
}
2288-
query maybe_unused_trait_imports(_: ()) -> &'tcx FxIndexSet<LocalDefId> {
2289-
desc { "fetching potentially unused trait imports" }
2290-
}
22912288

22922289
/// All available crates in the graph, including those that should not be user-facing
22932290
/// (such as private crates).

compiler/rustc_middle/src/ty/context.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3428,8 +3428,6 @@ pub struct DeducedParamAttrs {
34283428
}
34293429

34303430
pub fn provide(providers: &mut Providers) {
3431-
providers.maybe_unused_trait_imports =
3432-
|tcx, ()| &tcx.resolutions(()).maybe_unused_trait_imports;
34333431
providers.extern_mod_stmt_cnum =
34343432
|tcx, id| tcx.resolutions(()).extern_crate_map.get(&id).cloned();
34353433
providers.is_panic_runtime =

compiler/rustc_target/src/spec/base/avr.rs

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,9 @@ pub fn ef_avr_arch(target_cpu: &str) -> u32 {
322322
"attiny1624" => elf::EF_AVR_ARCH_XMEGA3,
323323
"attiny1626" => elf::EF_AVR_ARCH_XMEGA3,
324324
"attiny1627" => elf::EF_AVR_ARCH_XMEGA3,
325+
"attiny3224" => elf::EF_AVR_ARCH_XMEGA3,
326+
"attiny3226" => elf::EF_AVR_ARCH_XMEGA3,
327+
"attiny3227" => elf::EF_AVR_ARCH_XMEGA3,
325328
"atmega808" => elf::EF_AVR_ARCH_XMEGA3,
326329
"atmega809" => elf::EF_AVR_ARCH_XMEGA3,
327330
"atmega1608" => elf::EF_AVR_ARCH_XMEGA3,
@@ -331,6 +334,70 @@ pub fn ef_avr_arch(target_cpu: &str) -> u32 {
331334
"atmega4808" => elf::EF_AVR_ARCH_XMEGA3,
332335
"atmega4809" => elf::EF_AVR_ARCH_XMEGA3,
333336

337+
"avr64da28" => elf::EF_AVR_ARCH_XMEGA2,
338+
"avr64da32" => elf::EF_AVR_ARCH_XMEGA2,
339+
"avr64da48" => elf::EF_AVR_ARCH_XMEGA2,
340+
"avr64da64" => elf::EF_AVR_ARCH_XMEGA2,
341+
"avr64db28" => elf::EF_AVR_ARCH_XMEGA2,
342+
"avr64db32" => elf::EF_AVR_ARCH_XMEGA2,
343+
"avr64db48" => elf::EF_AVR_ARCH_XMEGA2,
344+
"avr64db64" => elf::EF_AVR_ARCH_XMEGA2,
345+
"avr64dd14" => elf::EF_AVR_ARCH_XMEGA2,
346+
"avr64dd20" => elf::EF_AVR_ARCH_XMEGA2,
347+
"avr64dd28" => elf::EF_AVR_ARCH_XMEGA2,
348+
"avr64dd32" => elf::EF_AVR_ARCH_XMEGA2,
349+
"avr64du28" => elf::EF_AVR_ARCH_XMEGA2,
350+
"avr64du32" => elf::EF_AVR_ARCH_XMEGA2,
351+
"avr64ea28" => elf::EF_AVR_ARCH_XMEGA2,
352+
"avr64ea32" => elf::EF_AVR_ARCH_XMEGA2,
353+
"avr64ea48" => elf::EF_AVR_ARCH_XMEGA2,
354+
"avr64sd28" => elf::EF_AVR_ARCH_XMEGA2,
355+
"avr64sd32" => elf::EF_AVR_ARCH_XMEGA2,
356+
"avr64sd48" => elf::EF_AVR_ARCH_XMEGA2,
357+
358+
"avr16dd20" => elf::EF_AVR_ARCH_XMEGA3,
359+
"avr16dd28" => elf::EF_AVR_ARCH_XMEGA3,
360+
"avr16dd32" => elf::EF_AVR_ARCH_XMEGA3,
361+
"avr16du14" => elf::EF_AVR_ARCH_XMEGA3,
362+
"avr16du20" => elf::EF_AVR_ARCH_XMEGA3,
363+
"avr16du28" => elf::EF_AVR_ARCH_XMEGA3,
364+
"avr16du32" => elf::EF_AVR_ARCH_XMEGA3,
365+
"avr32da28" => elf::EF_AVR_ARCH_XMEGA3,
366+
"avr32da32" => elf::EF_AVR_ARCH_XMEGA3,
367+
"avr32da48" => elf::EF_AVR_ARCH_XMEGA3,
368+
"avr32db28" => elf::EF_AVR_ARCH_XMEGA3,
369+
"avr32db32" => elf::EF_AVR_ARCH_XMEGA3,
370+
"avr32db48" => elf::EF_AVR_ARCH_XMEGA3,
371+
"avr32dd14" => elf::EF_AVR_ARCH_XMEGA3,
372+
"avr32dd20" => elf::EF_AVR_ARCH_XMEGA3,
373+
"avr32dd28" => elf::EF_AVR_ARCH_XMEGA3,
374+
"avr32dd32" => elf::EF_AVR_ARCH_XMEGA3,
375+
"avr32du14" => elf::EF_AVR_ARCH_XMEGA3,
376+
"avr32du20" => elf::EF_AVR_ARCH_XMEGA3,
377+
"avr32du28" => elf::EF_AVR_ARCH_XMEGA3,
378+
"avr32du32" => elf::EF_AVR_ARCH_XMEGA3,
379+
"avr16eb14" => elf::EF_AVR_ARCH_XMEGA3,
380+
"avr16eb20" => elf::EF_AVR_ARCH_XMEGA3,
381+
"avr16eb28" => elf::EF_AVR_ARCH_XMEGA3,
382+
"avr16eb32" => elf::EF_AVR_ARCH_XMEGA3,
383+
"avr16ea28" => elf::EF_AVR_ARCH_XMEGA3,
384+
"avr16ea32" => elf::EF_AVR_ARCH_XMEGA3,
385+
"avr16ea48" => elf::EF_AVR_ARCH_XMEGA3,
386+
"avr32ea28" => elf::EF_AVR_ARCH_XMEGA3,
387+
"avr32ea32" => elf::EF_AVR_ARCH_XMEGA3,
388+
"avr32ea48" => elf::EF_AVR_ARCH_XMEGA3,
389+
"avr32sd20" => elf::EF_AVR_ARCH_XMEGA3,
390+
"avr32sd28" => elf::EF_AVR_ARCH_XMEGA3,
391+
"avr32sd32" => elf::EF_AVR_ARCH_XMEGA3,
392+
"avr128da28" => elf::EF_AVR_ARCH_XMEGA4,
393+
"avr128da32" => elf::EF_AVR_ARCH_XMEGA4,
394+
"avr128da48" => elf::EF_AVR_ARCH_XMEGA4,
395+
"avr128da64" => elf::EF_AVR_ARCH_XMEGA4,
396+
"avr128db28" => elf::EF_AVR_ARCH_XMEGA4,
397+
"avr128db32" => elf::EF_AVR_ARCH_XMEGA4,
398+
"avr128db48" => elf::EF_AVR_ARCH_XMEGA4,
399+
"avr128db64" => elf::EF_AVR_ARCH_XMEGA4,
400+
334401
// Unknown target CPU => Unspecified/generic code
335402
_ => 0,
336403
}

0 commit comments

Comments
 (0)