Skip to content
Closed
Changes from 2 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
6ed283b
rustdoc-json: Add test for `Self` type
aDotInTheVoid Aug 15, 2024
42a901a
Don't use TyKind in lint
compiler-errors Aug 24, 2024
af05882
Deny wasm_c_abi lint to nudge the last 25%
workingjubilee Aug 24, 2024
c61f85b
Don't make pattern nonterminals match statement nonterminals
compiler-errors Jan 22, 2024
f1e2991
std: make `thread::current` available in all `thread_local!` destructors
joboet Jul 18, 2024
cfbd250
bless miri tests
joboet Jul 20, 2024
a1c36c6
linker: Synchronize native library search in rustc and linker
petrochenkov Aug 14, 2024
05bd36d
linker: Better support alternative static library naming on MSVC
petrochenkov Aug 21, 2024
ac8f132
docs: Update docs for the rustc's `-L` option
petrochenkov Aug 27, 2024
ee05de8
Re-enable android tests/benches in alloc
saethlin Aug 27, 2024
83de14c
Enable some ilog2 tests as well
saethlin Aug 27, 2024
ae6f8a7
allow BufReader::peek to be called on unsized types
lolbinarycat Aug 28, 2024
0cac915
Improve `isqrt` tests and add benchmarks
ChaiTRex Aug 26, 2024
7af8e21
Speed up `checked_isqrt` and `isqrt` methods
ChaiTRex Aug 26, 2024
120e437
Rollup merge of #120221 - compiler-errors:statements-are-not-patterns…
workingjubilee Aug 29, 2024
772a670
Rollup merge of #127912 - joboet:tls_dtor_thread_current, r=cupiver
workingjubilee Aug 29, 2024
0e039de
Rollup merge of #128166 - ChaiTRex:isqrt, r=tgross35
workingjubilee Aug 29, 2024
10db657
Rollup merge of #129123 - aDotInTheVoid:rustdoc-json-self, r=fmease
workingjubilee Aug 29, 2024
9d9c153
Rollup merge of #129366 - petrochenkov:libsearch, r=jieyouxu
workingjubilee Aug 29, 2024
8f2dad9
Rollup merge of #129527 - compiler-errors:lint-nit, r=Nadrieril
workingjubilee Aug 29, 2024
a4ae0e3
Rollup merge of #129534 - workingjubilee:ratchet-wasm-c-abi-fcw-to-de…
workingjubilee Aug 29, 2024
09a2515
Rollup merge of #129640 - saethlin:unignore-android-in-alloc, r=tgross35
workingjubilee Aug 29, 2024
6027230
Rollup merge of #129675 - lolbinarycat:bufreader_peek_unsized, r=work…
workingjubilee Aug 29, 2024
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
58 changes: 58 additions & 0 deletions tests/rustdoc-json/traits/self.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// ignore-tidy-linelength

pub struct Foo;

// Check that Self is represented uniformly between inherent impls, trait impls,
// and trait definitions, even though it uses both SelfTyParam and SelfTyAlias
// internally.
//
// Each assertion matches 3 times, and should be the same each time.

impl Foo {
//@ ismany '$.index[*][?(@.name=="by_ref")].inner.function.decl.inputs[0][0]' '"self"' '"self"' '"self"'
//@ ismany '$.index[*][?(@.name=="by_ref")].inner.function.decl.inputs[0][1].borrowed_ref.type.generic' '"Self"' '"Self"' '"Self"'
//@ ismany '$.index[*][?(@.name=="by_ref")].inner.function.decl.inputs[0][1].borrowed_ref.lifetime' null null null
//@ ismany '$.index[*][?(@.name=="by_ref")].inner.function.decl.inputs[0][1].borrowed_ref.mutable' false false false
pub fn by_ref(&self) {}

//@ ismany '$.index[*][?(@.name=="by_exclusive_ref")].inner.function.decl.inputs[0][0]' '"self"' '"self"' '"self"'
//@ ismany '$.index[*][?(@.name=="by_exclusive_ref")].inner.function.decl.inputs[0][1].borrowed_ref.type.generic' '"Self"' '"Self"' '"Self"'
//@ ismany '$.index[*][?(@.name=="by_exclusive_ref")].inner.function.decl.inputs[0][1].borrowed_ref.lifetime' null null null
//@ ismany '$.index[*][?(@.name=="by_exclusive_ref")].inner.function.decl.inputs[0][1].borrowed_ref.mutable' true true true
pub fn by_exclusive_ref(&mut self) {}

//@ ismany '$.index[*][?(@.name=="by_value")].inner.function.decl.inputs[0][0]' '"self"' '"self"' '"self"'
//@ ismany '$.index[*][?(@.name=="by_value")].inner.function.decl.inputs[0][1].generic' '"Self"' '"Self"' '"Self"'
pub fn by_value(self) {}

//@ ismany '$.index[*][?(@.name=="with_lifetime")].inner.function.decl.inputs[0][0]' '"self"' '"self"' '"self"'
//@ ismany '$.index[*][?(@.name=="with_lifetime")].inner.function.decl.inputs[0][1].borrowed_ref.type.generic' '"Self"' '"Self"' '"Self"'
//@ ismany '$.index[*][?(@.name=="with_lifetime")].inner.function.decl.inputs[0][1].borrowed_ref.lifetime' \"\'a\" \"\'a\" \"\'a\"
//@ ismany '$.index[*][?(@.name=="with_lifetime")].inner.function.decl.inputs[0][1].borrowed_ref.mutable' false false false
pub fn with_lifetime<'a>(&'a self) {}

//@ ismany '$.index[*][?(@.name=="build")].inner.function.decl.output.generic' '"Self"' '"Self"' '"Self"'
pub fn build() -> Self {
Self
}
}

pub struct Bar;

pub trait SelfParams {
fn by_ref(&self);
fn by_exclusive_ref(&mut self);
fn by_value(self);
fn with_lifetime<'a>(&'a self);
fn build() -> Self;
}

impl SelfParams for Bar {
fn by_ref(&self) {}
fn by_exclusive_ref(&mut self) {}
fn by_value(self) {}
fn with_lifetime<'a>(&'a self) {}
fn build() -> Self {
Self
}
}