forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#126772 - cuviper:beta-next, r=cuviper
[beta] backports - Only compute `specializes` query if (min)specialization is enabled in the crate of the specializing impl rust-lang#126139 - Add pub struct with allow(dead_code) into worklist rust-lang#126315 - ci: Update centos:7 to use vault repos rust-lang#126352 r? cuviper
- Loading branch information
Showing
13 changed files
with
125 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
//@ check-pass | ||
|
||
mod ffi { | ||
use super::*; | ||
|
||
extern "C" { | ||
pub fn DomPromise_AddRef(promise: *const Promise); | ||
pub fn DomPromise_Release(promise: *const Promise); | ||
} | ||
} | ||
|
||
#[repr(C)] | ||
#[allow(unused)] | ||
pub struct Promise { | ||
private: [u8; 0], | ||
__nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>, | ||
} | ||
|
||
pub unsafe trait RefCounted { | ||
unsafe fn addref(&self); | ||
unsafe fn release(&self); | ||
} | ||
|
||
unsafe impl RefCounted for Promise { | ||
unsafe fn addref(&self) { | ||
ffi::DomPromise_AddRef(self) | ||
} | ||
unsafe fn release(&self) { | ||
ffi::DomPromise_Release(self) | ||
} | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
//@ aux-build: anyid-repro-125197.rs | ||
//@ check-pass | ||
|
||
// Makes sure that we don't check `specializes(impl1, impl2)` for a pair of impls that don't | ||
// actually participate in specialization. Since <https://github.com/rust-lang/rust/pull/122791>, | ||
// we don't treat inductive cycles as errors -- so we may need to winnow more pairs of impls, and | ||
// we try to winnow impls in favor of other impls. However, if we're *inside* the `specializes` | ||
// query, then may have a query cycle if we call `specializes` again! | ||
|
||
extern crate anyid_repro_125197; | ||
use anyid_repro_125197::AnyId; | ||
|
||
fn main() { | ||
let x = "hello, world"; | ||
let y: AnyId = x.into(); | ||
let _ = y == x; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use std::fmt::Display; | ||
use std::sync::Arc; | ||
|
||
pub struct AnyId(()); | ||
|
||
impl PartialEq<Self> for AnyId { | ||
fn eq(&self, _: &Self) -> bool { | ||
todo!() | ||
} | ||
} | ||
|
||
impl<T: Identifier> PartialEq<T> for AnyId { | ||
fn eq(&self, _: &T) -> bool { | ||
todo!() | ||
} | ||
} | ||
|
||
impl<T: Identifier> From<T> for AnyId { | ||
fn from(_: T) -> Self { | ||
todo!() | ||
} | ||
} | ||
|
||
pub trait Identifier: Display + 'static {} | ||
|
||
impl<T> Identifier for T where T: PartialEq + Display + 'static {} |