Skip to content
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

Rollup of 7 pull requests #135916

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 11 additions & 3 deletions compiler/rustc_hir_typeck/src/coercion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,9 +461,17 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
// to the target type), since that should be the least
// confusing.
let Some(InferOk { value: ty, mut obligations }) = found else {
let err = first_error.expect("coerce_borrowed_pointer had no error");
debug!("coerce_borrowed_pointer: failed with err = {:?}", err);
return Err(err);
if let Some(first_error) = first_error {
debug!("coerce_borrowed_pointer: failed with err = {:?}", first_error);
return Err(first_error);
} else {
// This may happen in the new trait solver since autoderef requires
// the pointee to be structurally normalizable, or else it'll just bail.
// So when we have a type like `&<not well formed>`, then we get no
// autoderef steps (even though there should be at least one). That means
// we get no type mismatches, since the loop above just exits early.
return Err(TypeError::Mismatch);
}
};

if ty == a && mt_a.mutbl.is_not() && autoderef.step_count() == 1 {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_parse_format/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ impl<'a> Parser<'a> {
}
}
}
&self.input[start..self.input.len()]
&self.input[start..]
}

/// Parses an `Argument` structure, or what's contained within braces inside the format string.
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_target/src/spec/base/windows_gnu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ pub(crate) fn opts() -> TargetOptions {
emit_debug_gdb_scripts: false,
requires_uwtable: true,
eh_frame_header: false,
debuginfo_kind: DebuginfoKind::Dwarf,
// FIXME(davidtwco): Support Split DWARF on Windows GNU - may require LLVM changes to
// output DWO, despite using DWARF, doesn't use ELF..
debuginfo_kind: DebuginfoKind::Pdb,
supported_split_debuginfo: Cow::Borrowed(&[SplitDebuginfo::Off]),
..Default::default()
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_target/src/spec/base/windows_gnullvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ pub(crate) fn opts() -> TargetOptions {
has_thread_local: true,
crt_static_allows_dylibs: true,
crt_static_respected: true,
debuginfo_kind: DebuginfoKind::Dwarf,
// FIXME(davidtwco): Support Split DWARF on Windows GNU - may require LLVM changes to
// output DWO, despite using DWARF, doesn't use ELF..
debuginfo_kind: DebuginfoKind::Pdb,
supported_split_debuginfo: Cow::Borrowed(&[SplitDebuginfo::Off]),
..Default::default()
}
Expand Down
8 changes: 4 additions & 4 deletions library/alloc/src/collections/btree/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1442,20 +1442,20 @@ impl<T, A: Allocator + Clone> BTreeSet<T, A> {
///
/// let mut set = BTreeSet::from([1, 2, 3, 4]);
///
/// let mut cursor = unsafe { set.upper_bound_mut(Bound::Included(&3)) };
/// let mut cursor = set.upper_bound_mut(Bound::Included(&3));
/// assert_eq!(cursor.peek_prev(), Some(&3));
/// assert_eq!(cursor.peek_next(), Some(&4));
///
/// let mut cursor = unsafe { set.upper_bound_mut(Bound::Excluded(&3)) };
/// let mut cursor = set.upper_bound_mut(Bound::Excluded(&3));
/// assert_eq!(cursor.peek_prev(), Some(&2));
/// assert_eq!(cursor.peek_next(), Some(&3));
///
/// let mut cursor = unsafe { set.upper_bound_mut(Bound::Unbounded) };
/// let mut cursor = set.upper_bound_mut(Bound::Unbounded);
/// assert_eq!(cursor.peek_prev(), Some(&4));
/// assert_eq!(cursor.peek_next(), None);
/// ```
#[unstable(feature = "btree_cursors", issue = "107540")]
pub unsafe fn upper_bound_mut<Q: ?Sized>(&mut self, bound: Bound<&Q>) -> CursorMut<'_, T, A>
pub fn upper_bound_mut<Q: ?Sized>(&mut self, bound: Bound<&Q>) -> CursorMut<'_, T, A>
where
T: Borrow<Q> + Ord,
Q: Ord,
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/src/core/build_steps/llvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1338,7 +1338,7 @@ impl Step for CrtBeginEnd {
.file(crtbegin_src)
.file(crtend_src);

// Those flags are defined in src/llvm-project/compiler-rt/lib/crt/CMakeLists.txt
// Those flags are defined in src/llvm-project/compiler-rt/lib/builtins/CMakeLists.txt
// Currently only consumer of those objects is musl, which use .init_array/.fini_array
// instead of .ctors/.dtors
cfg.flag("-std=c11")
Expand Down
4 changes: 3 additions & 1 deletion src/ci/github-actions/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ runners:
- &job-aarch64-linux
os: ubuntu-22.04-arm

- &job-aarch64-linux-8c
os: ubuntu-22.04-arm64-8core-32gb
envs:
env-x86_64-apple-tests: &env-x86_64-apple-tests
SCRIPT: ./x.py --stage 2 test --skip tests/ui --skip tests/rustdoc -- --exact
Expand Down Expand Up @@ -142,7 +144,7 @@ auto:
- name: dist-aarch64-linux
env:
CODEGEN_BACKENDS: llvm,cranelift
<<: *job-aarch64-linux
<<: *job-aarch64-linux-8c

- name: dist-android
<<: *job-linux-4c
Expand Down
3 changes: 1 addition & 2 deletions src/rustdoc-json-types/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1099,8 +1099,7 @@ pub struct Trait {
pub is_auto: bool,
/// Whether the trait is marked as `unsafe`.
pub is_unsafe: bool,
// FIXME(dyn_compat_renaming): Update the URL once the Reference is updated and hits stable.
/// Whether the trait is [dyn compatible](https://doc.rust-lang.org/reference/items/traits.html#object-safety)[^1].
/// Whether the trait is [dyn compatible](https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility)[^1].
///
/// [^1]: Formerly known as "object safe".
pub is_dyn_compatible: bool,
Expand Down
29 changes: 29 additions & 0 deletions tests/ui/debuginfo/windows_gnu_split_debuginfo_off.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//@ revisions: aarch64_gl i686_g i686_gl i686_uwp_g x86_64_g x86_64_gl x86_64_uwp_g
//@ compile-flags: --crate-type cdylib -Csplit-debuginfo=off
//@ check-pass

//@[aarch64_gl] compile-flags: --target aarch64-pc-windows-gnullvm
//@[aarch64_gl] needs-llvm-components: aarch64

//@[i686_g] compile-flags: --target i686-pc-windows-gnu
//@[i686_g] needs-llvm-components: x86

//@[i686_gl] compile-flags: --target i686-pc-windows-gnullvm
//@[i686_gl] needs-llvm-components: x86

//@[i686_uwp_g] compile-flags: --target i686-uwp-windows-gnu
//@[i686_uwp_g] needs-llvm-components: x86

//@[x86_64_g] compile-flags: --target x86_64-pc-windows-gnu
//@[x86_64_g] needs-llvm-components: x86

//@[x86_64_gl] compile-flags: --target x86_64-pc-windows-gnullvm
//@[x86_64_gl] needs-llvm-components: x86

//@[x86_64_uwp_g] compile-flags: --target x86_64-uwp-windows-gnu
//@[x86_64_uwp_g] needs-llvm-components: x86

#![feature(no_core)]

#![no_core]
#![no_std]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
error: `-Csplit-debuginfo=packed` is unstable on this platform

error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
error: `-Csplit-debuginfo=packed` is unstable on this platform

error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
error: `-Csplit-debuginfo=packed` is unstable on this platform

error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
error: `-Csplit-debuginfo=packed` is unstable on this platform

error: aborting due to 1 previous error

29 changes: 29 additions & 0 deletions tests/ui/debuginfo/windows_gnu_split_debuginfo_packed.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//@ revisions: aarch64_gl i686_g i686_gl i686_uwp_g x86_64_g x86_64_gl x86_64_uwp_g
//@ compile-flags: --crate-type cdylib -Csplit-debuginfo=packed
//@ error-pattern: error: `-Csplit-debuginfo=packed` is unstable on this platform

//@[aarch64_gl] compile-flags: --target aarch64-pc-windows-gnullvm
//@[aarch64_gl] needs-llvm-components: aarch64

//@[i686_g] compile-flags: --target i686-pc-windows-gnu
//@[i686_g] needs-llvm-components: x86

//@[i686_gl] compile-flags: --target i686-pc-windows-gnullvm
//@[i686_gl] needs-llvm-components: x86

//@[i686_uwp_g] compile-flags: --target i686-uwp-windows-gnu
//@[i686_uwp_g] needs-llvm-components: x86

//@[x86_64_g] compile-flags: --target x86_64-pc-windows-gnu
//@[x86_64_g] needs-llvm-components: x86

//@[x86_64_gl] compile-flags: --target x86_64-pc-windows-gnullvm
//@[x86_64_gl] needs-llvm-components: x86

//@[x86_64_uwp_g] compile-flags: --target x86_64-uwp-windows-gnu
//@[x86_64_uwp_g] needs-llvm-components: x86

#![feature(no_core)]

#![no_core]
#![no_std]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
error: `-Csplit-debuginfo=packed` is unstable on this platform

error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
error: `-Csplit-debuginfo=packed` is unstable on this platform

error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
error: `-Csplit-debuginfo=packed` is unstable on this platform

error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
error: `-Csplit-debuginfo=unpacked` is unstable on this platform

error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
error: `-Csplit-debuginfo=unpacked` is unstable on this platform

error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
error: `-Csplit-debuginfo=unpacked` is unstable on this platform

error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
error: `-Csplit-debuginfo=unpacked` is unstable on this platform

error: aborting due to 1 previous error

29 changes: 29 additions & 0 deletions tests/ui/debuginfo/windows_gnu_split_debuginfo_unpacked.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//@ revisions: aarch64_gl i686_g i686_gl i686_uwp_g x86_64_g x86_64_gl x86_64_uwp_g
//@ compile-flags: --crate-type cdylib -Csplit-debuginfo=unpacked
//@ error-pattern: error: `-Csplit-debuginfo=unpacked` is unstable on this platform

//@[aarch64_gl] compile-flags: --target aarch64-pc-windows-gnullvm
//@[aarch64_gl] needs-llvm-components: aarch64

//@[i686_g] compile-flags: --target i686-pc-windows-gnu
//@[i686_g] needs-llvm-components: x86

//@[i686_gl] compile-flags: --target i686-pc-windows-gnullvm
//@[i686_gl] needs-llvm-components: x86

//@[i686_uwp_g] compile-flags: --target i686-uwp-windows-gnu
//@[i686_uwp_g] needs-llvm-components: x86

//@[x86_64_g] compile-flags: --target x86_64-pc-windows-gnu
//@[x86_64_g] needs-llvm-components: x86

//@[x86_64_gl] compile-flags: --target x86_64-pc-windows-gnullvm
//@[x86_64_gl] needs-llvm-components: x86

//@[x86_64_uwp_g] compile-flags: --target x86_64-uwp-windows-gnu
//@[x86_64_uwp_g] needs-llvm-components: x86

#![feature(no_core)]

#![no_core]
#![no_std]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
error: `-Csplit-debuginfo=unpacked` is unstable on this platform

error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
error: `-Csplit-debuginfo=unpacked` is unstable on this platform

error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
error: `-Csplit-debuginfo=unpacked` is unstable on this platform

error: aborting due to 1 previous error

17 changes: 17 additions & 0 deletions tests/ui/traits/next-solver/non-wf-in-coerce-pointers.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//@ compile-flags: -Znext-solver

trait Wf {
type Assoc;
}

struct S {
f: &'static <() as Wf>::Assoc,
//~^ ERROR the trait bound `(): Wf` is not satisfied
}

fn main() {
let x: S = todo!();
let y: &() = x.f;
//~^ ERROR mismatched types
//~| ERROR the trait bound `(): Wf` is not satisfied
}
39 changes: 39 additions & 0 deletions tests/ui/traits/next-solver/non-wf-in-coerce-pointers.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
error[E0277]: the trait bound `(): Wf` is not satisfied
--> $DIR/non-wf-in-coerce-pointers.rs:8:17
|
LL | f: &'static <() as Wf>::Assoc,
| ^^^^^^^^^^^^^^^^^ the trait `Wf` is not implemented for `()`
|
help: this trait has no implementations, consider adding one
--> $DIR/non-wf-in-coerce-pointers.rs:3:1
|
LL | trait Wf {
| ^^^^^^^^

error[E0308]: mismatched types
--> $DIR/non-wf-in-coerce-pointers.rs:14:18
|
LL | let y: &() = x.f;
| --- ^^^ types differ
| |
| expected due to this
|
= note: expected reference `&()`
found reference `&'static <() as Wf>::Assoc`

error[E0277]: the trait bound `(): Wf` is not satisfied
--> $DIR/non-wf-in-coerce-pointers.rs:14:18
|
LL | let y: &() = x.f;
| ^^^ the trait `Wf` is not implemented for `()`
|
help: this trait has no implementations, consider adding one
--> $DIR/non-wf-in-coerce-pointers.rs:3:1
|
LL | trait Wf {
| ^^^^^^^^

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
Loading