]> git.lizzy.rs Git - rust.git/commit
Treat associated types the same as type parameters when it comes to region bounding...
authorNiko Matsakis <niko@alum.mit.edu>
Sat, 3 Jan 2015 09:40:33 +0000 (04:40 -0500)
committerNiko Matsakis <niko@alum.mit.edu>
Mon, 5 Jan 2015 15:14:35 +0000 (10:14 -0500)
commitc8868942e845254abfd3623a709847d65e015a2f
treee02fd8a094bd337c8544a3203e5c2754163420d3
parent8e83af6e879535c33fd83d247d16619e39e0b951
Treat associated types the same as type parameters when it comes to region bounding. Fixes #20303.

Strictly speaking, this is a [breaking-change] (if you are using
associated types). You are no longer free to wantonly violate the type
system rules by closing associated types into objects without any form
of region bound. Instead you should add region bounds like `T::X :
'a`, just as you would with a normal type parameter.
src/librustc/middle/infer/error_reporting.rs
src/librustc/middle/infer/mod.rs
src/librustc/middle/infer/region_inference/mod.rs
src/librustc_typeck/check/regionck.rs
src/librustc_typeck/check/regionmanip.rs
src/test/compile-fail/regions-close-associated-type-into-object.rs [new file with mode: 0644]
src/test/compile-fail/regions-close-param-into-object.rs [new file with mode: 0644]