File: jump-to-non-local-method.rs

package info (click to toggle)
rustc 1.85.0%2Bdfsg2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 893,176 kB
  • sloc: xml: 158,127; python: 35,830; javascript: 19,497; cpp: 19,002; sh: 17,245; ansic: 13,127; asm: 4,376; makefile: 1,051; lisp: 29; perl: 29; ruby: 19; sql: 11
file content (48 lines) | stat: -rw-r--r-- 1,582 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//@ compile-flags: -Zunstable-options --generate-link-to-definition

#![crate_name = "foo"]

//@ has 'src/foo/jump-to-non-local-method.rs.html'

//@ has - '//a[@href="{{channel}}/core/sync/atomic/struct.AtomicIsize.html"]' 'std::sync::atomic::AtomicIsize'
use std::sync::atomic::AtomicIsize;
//@ has - '//a[@href="{{channel}}/std/io/trait.Read.html"]' 'std::io::Read'
use std::io::Read;
//@ has - '//a[@href="{{channel}}/std/io/index.html"]' 'std::io'
use std::io;
//@ has - '//a[@href="{{channel}}/std/process/fn.exit.html"]' 'std::process::exit'
use std::process::exit;
use std::cmp::Ordering;
use std::marker::PhantomData;

pub fn bar2<T: Read>(readable: T) {
    //@ has - '//a[@href="{{channel}}/std/io/trait.Read.html#tymethod.read"]' 'read'
    let _ = readable.read(&mut []);
}

pub fn bar() {
    //@ has - '//a[@href="{{channel}}/core/sync/atomic/struct.AtomicIsize.html#method.new"]' 'AtomicIsize::new'
    let _ = AtomicIsize::new(0);
    //@ has - '//a[@href="#48"]' 'local_private'
    local_private();
}

pub fn extern_call() {
    //@ has - '//a[@href="{{channel}}/std/process/fn.exit.html"]' 'exit'
    exit(0);
}

pub fn macro_call() -> Result<(), ()> {
    //@ has - '//a[@href="{{channel}}/core/macro.try.html"]' 'try!'
    try!(Err(()));
    Ok(())
}

pub fn variant() {
    //@ has - '//a[@href="{{channel}}/core/cmp/enum.Ordering.html#variant.Less"]' 'Ordering::Less'
    let _ = Ordering::Less;
    //@ has - '//a[@href="{{channel}}/core/marker/struct.PhantomData.html"]' 'PhantomData'
    let _: PhantomData::<usize> = PhantomData;
}

fn local_private() {}