2024-02-02 18:28:08 -06:00
|
|
|
//@ compile-flags: -Zunstable-options --generate-link-to-definition
|
|
|
|
|
|
|
|
#![crate_name = "foo"]
|
|
|
|
|
2024-02-02 18:35:46 -06:00
|
|
|
// @has 'src/foo/jump-to-non-local-method.rs.html'
|
|
|
|
|
|
|
|
// @has - '//a[@href="{{channel}}/core/sync/atomic/struct.AtomicIsize.html"]' 'std::sync::atomic::AtomicIsize'
|
2024-02-02 18:28:08 -06:00
|
|
|
use std::sync::atomic::AtomicIsize;
|
2024-02-02 18:35:46 -06:00
|
|
|
// @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;
|
2024-02-02 18:28:08 -06:00
|
|
|
|
2024-02-02 18:35:46 -06:00
|
|
|
pub fn bar2<T: Read>(readable: T) {
|
|
|
|
// @has - '//a[@href="{{channel}}/std/io/trait.Read.html#tymethod.read"]' 'read'
|
|
|
|
let _ = readable.read(&mut []);
|
|
|
|
}
|
2024-02-02 18:28:08 -06:00
|
|
|
|
|
|
|
pub fn bar() {
|
2024-02-02 18:35:46 -06:00
|
|
|
// @has - '//a[@href="{{channel}}/core/sync/atomic/struct.AtomicIsize.html#method.new"]' 'AtomicIsize::new'
|
2024-02-02 18:28:08 -06:00
|
|
|
let _ = AtomicIsize::new(0);
|
2024-02-02 18:35:46 -06:00
|
|
|
// @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;
|
2024-02-02 18:28:08 -06:00
|
|
|
}
|
|
|
|
|
2024-02-02 18:35:46 -06:00
|
|
|
fn local_private() {}
|