File: 05-variance.rs

package info (click to toggle)
rust-glib 0.20.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,308 kB
  • sloc: makefile: 18
file content (13 lines) | stat: -rw-r--r-- 237 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
use glib::MatchInfo;

// pass
fn covariance_check<'short>(input: MatchInfo<'static>) -> MatchInfo<'short> {
    input
}

// fail
fn contravariance_check<'short>(input: MatchInfo<'short>) -> MatchInfo<'static> {
    input
}

fn main() {}