Skip to content

Commit 398fd92

Browse files
committed
Auto merge of rust-lang#119221 - matthiaskrgr:rollup-dh9exqf, r=matthiaskrgr
Rollup of 5 pull requests Successful merges: - rust-lang#117601 (Add support for hexagon-unknown-none-elf as target) - rust-lang#119169 (Rid the AST & HIR pretty printer of cruft) - rust-lang#119194 (Run fuchsia tests only on nightly) - rust-lang#119201 (tests: fix overaligned-constant to not over-specify getelementptr instr) - rust-lang#119215 (Emits error if has bound regions) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 208dd20 + b24e878 commit 398fd92

File tree

14 files changed

+326
-41
lines changed

14 files changed

+326
-41
lines changed

.github/workflows/ci.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,9 @@ jobs:
289289
os: ubuntu-20.04-4core-16gb
290290
env: {}
291291
- name: x86_64-gnu-integration
292+
env:
293+
CI_ONLY_WHEN_CHANNEL: nightly
292294
os: ubuntu-20.04-16core-64gb
293-
env: {}
294295
- name: x86_64-gnu-debug
295296
os: ubuntu-20.04-8core-32gb
296297
env: {}

compiler/rustc_ast_pretty/src/pprust/state/item.rs

+2-15
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use crate::pprust::state::{AnnNode, PrintState, State, INDENT_UNIT};
55
use ast::StaticItem;
66
use itertools::{Itertools, Position};
77
use rustc_ast as ast;
8-
use rustc_ast::GenericBound;
98
use rustc_ast::ModKind;
109
use rustc_span::symbol::Ident;
1110

@@ -338,21 +337,9 @@ impl<'a> State<'a> {
338337
self.word_nbsp("trait");
339338
self.print_ident(item.ident);
340339
self.print_generic_params(&generics.params);
341-
let mut real_bounds = Vec::with_capacity(bounds.len());
342-
for bound in bounds.iter() {
343-
if let GenericBound::Trait(ptr, modifiers) = bound
344-
&& let ast::BoundPolarity::Maybe(_) = modifiers.polarity
345-
{
346-
self.space();
347-
self.word_space("for ?");
348-
self.print_trait_ref(&ptr.trait_ref);
349-
} else {
350-
real_bounds.push(bound.clone());
351-
}
352-
}
353-
if !real_bounds.is_empty() {
340+
if !bounds.is_empty() {
354341
self.word_nbsp(":");
355-
self.print_type_bounds(&real_bounds);
342+
self.print_type_bounds(bounds);
356343
}
357344
self.print_where_clause(&generics.where_clause);
358345
self.word(" ");

compiler/rustc_hir_analysis/src/check/entry.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,10 @@ fn check_main_fn_ty(tcx: TyCtxt<'_>, main_def_id: DefId) {
124124
if let Some(term_did) = tcx.lang_items().termination() {
125125
let return_ty = main_fnsig.output();
126126
let return_ty_span = main_fn_return_type_span(tcx, main_def_id).unwrap_or(main_span);
127-
let return_ty = return_ty.skip_binder();
127+
let Some(return_ty) = return_ty.no_bound_vars() else {
128+
tcx.sess.emit_err(errors::MainFunctionReturnTypeGeneric { span: return_ty_span });
129+
return;
130+
};
128131
let infcx = tcx.infer_ctxt().build();
129132
let cause = traits::ObligationCause::new(
130133
return_ty_span,

compiler/rustc_hir_pretty/src/lib.rs

+2-22
Original file line numberDiff line numberDiff line change
@@ -553,17 +553,7 @@ impl<'a> State<'a> {
553553
}
554554
hir::ItemKind::OpaqueTy(opaque_ty) => {
555555
self.print_item_type(item, opaque_ty.generics, |state| {
556-
let mut real_bounds = Vec::with_capacity(opaque_ty.bounds.len());
557-
for b in opaque_ty.bounds {
558-
if let GenericBound::Trait(ptr, hir::TraitBoundModifier::Maybe) = b {
559-
state.space();
560-
state.word_space("for ?");
561-
state.print_trait_ref(&ptr.trait_ref);
562-
} else {
563-
real_bounds.push(b);
564-
}
565-
}
566-
state.print_bounds("= impl", real_bounds);
556+
state.print_bounds("= impl", opaque_ty.bounds)
567557
});
568558
}
569559
hir::ItemKind::Enum(ref enum_definition, params) => {
@@ -625,17 +615,7 @@ impl<'a> State<'a> {
625615
self.word_nbsp("trait");
626616
self.print_ident(item.ident);
627617
self.print_generic_params(generics.params);
628-
let mut real_bounds = Vec::with_capacity(bounds.len());
629-
for b in bounds {
630-
if let GenericBound::Trait(ptr, hir::TraitBoundModifier::Maybe) = b {
631-
self.space();
632-
self.word_space("for ?");
633-
self.print_trait_ref(&ptr.trait_ref);
634-
} else {
635-
real_bounds.push(b);
636-
}
637-
}
638-
self.print_bounds(":", real_bounds);
618+
self.print_bounds(":", bounds);
639619
self.print_where_clause(generics);
640620
self.word(" ");
641621
self.bopen();

compiler/rustc_target/src/spec/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1493,6 +1493,7 @@ supported_targets! {
14931493
("mips64-unknown-linux-muslabi64", mips64_unknown_linux_muslabi64),
14941494
("mips64el-unknown-linux-muslabi64", mips64el_unknown_linux_muslabi64),
14951495
("hexagon-unknown-linux-musl", hexagon_unknown_linux_musl),
1496+
("hexagon-unknown-none-elf", hexagon_unknown_none_elf),
14961497

14971498
("mips-unknown-linux-uclibc", mips_unknown_linux_uclibc),
14981499
("mipsel-unknown-linux-uclibc", mipsel_unknown_linux_uclibc),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
use crate::spec::{PanicStrategy, Target, TargetOptions};
2+
3+
pub fn target() -> Target {
4+
Target {
5+
llvm_target: "hexagon-unknown-none-elf".into(),
6+
pointer_width: 32,
7+
data_layout: concat!(
8+
"e-m:e-p:32:32:32-a:0-n16:32-i64:64:64-i32:32",
9+
":32-i16:16:16-i1:8:8-f32:32:32-f64:64:64-v32",
10+
":32:32-v64:64:64-v512:512:512-v1024:1024:1024-v2048",
11+
":2048:2048"
12+
)
13+
.into(),
14+
arch: "hexagon".into(),
15+
16+
options: TargetOptions {
17+
cpu: "hexagonv60".into(),
18+
panic_strategy: PanicStrategy::Abort,
19+
dynamic_linking: true,
20+
features: "-small-data,+hvx-length128b".into(),
21+
max_atomic_width: Some(32),
22+
emit_debug_gdb_scripts: false,
23+
c_enum_min_bits: Some(8),
24+
..Default::default()
25+
},
26+
}
27+
}

compiler/rustc_target/src/spec/tests/tests_impl.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ impl Target {
116116

117117
// Check dynamic linking stuff
118118
// BPF: when targeting user space vms (like rbpf), those can load dynamic libraries.
119-
if self.os == "none" && self.arch != "bpf" {
119+
// hexagon: when targeting QuRT, that OS can load dynamic libraries.
120+
if self.os == "none" && (self.arch != "bpf" && self.arch != "hexagon") {
120121
assert!(!self.dynamic_linking);
121122
}
122123
if self.only_cdylib

src/ci/github-actions/ci.yml

+5
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,11 @@ jobs:
471471
<<: *job-linux-4c
472472

473473
- name: x86_64-gnu-integration
474+
env:
475+
# Only run this job on the nightly channel. Fuchsia requires
476+
# nightly features to compile, and this job would fail if
477+
# executed on beta and stable.
478+
CI_ONLY_WHEN_CHANNEL: nightly
474479
<<: *job-linux-16c
475480

476481
- name: x86_64-gnu-debug

src/doc/rustc/src/SUMMARY.md

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
- [\*-unknown-fuchsia](platform-support/fuchsia.md)
3939
- [\*-kmc-solid_\*](platform-support/kmc-solid.md)
4040
- [csky-unknown-linux-gnuabiv2\*](platform-support/csky-unknown-linux-gnuabiv2.md)
41+
- [hexagon-unknown-none-elf](platform-support/hexagon-unknown-none-elf.md)
4142
- [loongarch\*-unknown-linux-\*](platform-support/loongarch-linux.md)
4243
- [loongarch\*-unknown-none\*](platform-support/loongarch-none.md)
4344
- [m68k-unknown-linux-gnu](platform-support/m68k-unknown-linux-gnu.md)

src/doc/rustc/src/platform-support.md

+1
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ target | std | host | notes
265265
`bpfel-unknown-none` | * | | BPF (little endian)
266266
`csky-unknown-linux-gnuabiv2` | ✓ | | C-SKY abiv2 Linux (little endian)
267267
`csky-unknown-linux-gnuabiv2hf` | ✓ | | C-SKY abiv2 Linux, hardfloat (little endian)
268+
[`hexagon-unknown-none-elf`](platform-support/hexagon-unknown-none-elf.md)| * | Bare Hexagon (v60+, HVX)
268269
`hexagon-unknown-linux-musl` | ? | |
269270
`i386-apple-ios` | ✓ | | 32-bit x86 iOS [^x86_32-floats-return-ABI]
270271
[`i586-pc-nto-qnx700`](platform-support/nto-qnx.md) | * | | 32-bit x86 QNX Neutrino 7.0 RTOS [^x86_32-floats-return-ABI]

0 commit comments

Comments
 (0)